Skip to content

fix: ensure ASAR integrity buffer on windows is valid#1878

Merged
MarshallOfSound merged 1 commit intoelectron:mainfrom
webbuilders-group:bugfix-integrity-fixes
Feb 9, 2026
Merged

fix: ensure ASAR integrity buffer on windows is valid#1878
MarshallOfSound merged 1 commit intoelectron:mainfrom
webbuilders-group:bugfix-integrity-fixes

Conversation

@UndefinedOffset
Copy link
Contributor

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Summarize your changes:

This pull request fixes #1873 which was caused by the change in 8d64aa1 to resedit.js where .buffer was added when setting the data for the integrity resource resulting in it being written corruptly to the final exe.

The documentation for Buffer.buffer warns the result "is not guaranteed to correspond exactly to the original Buffer". This not corresponding exactly to the original buffer seems to be what is resulting in the corrupt integrity data as reverting that change results in the correct data being written to the resource and Electron starting as expected with integrity checking enabled.

It does make me wonder if the other uses of .buffer could be causing issues but I did not revert the other .buffer as it seems to be just matching up with behavior above it.

@UndefinedOffset UndefinedOffset requested a review from a team as a code owner February 9, 2026 21:26
@welcome
Copy link

welcome bot commented Feb 9, 2026

Thanks for opening a pull request!

Here are some highlighted action items that will help get it across the finish line, from the
pull request guidelines:

  • Follow the JavaScript coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes in NEWS.md and other docs.
  • Include tests when adding/changing behavior.

Development and triage is community-driven, so please be patient and we will get back to you as soon as we can.

@MarshallOfSound MarshallOfSound changed the title BUGFIX: Fixed corrupt ASAR Integrity fix: ensure ASAR integrity buffer on windows is valid Feb 9, 2026
@MarshallOfSound
Copy link
Member

I think the semantics here should be:

buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.length);

small buffers are allocated form a pool and when you need the actual ArrayBuffer you need to get a slice of the underlying arraybuffer like so.

@UndefinedOffset
Copy link
Contributor Author

@MarshallOfSound should be good now :)

@MarshallOfSound MarshallOfSound merged commit 73a74db into electron:main Feb 9, 2026
6 checks passed
@welcome
Copy link

welcome bot commented Feb 9, 2026

Thanks for your contribution! 🎉

@electron-npm-package-publisher

🎉 This PR is included in version 19.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ASAR integrity corrupt in v19

2 participants