Pin the xlsx tarball by integrity, not just by URL - #9
Open
hatemhamad wants to merge 1 commit into
Open
Conversation
The lockfile records this dependency as a URL with no checksum:
xlsx@https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz:
resolution: {tarball: https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz}
Every other dependency carries an integrity hash, so the lockfile pins what will
be installed. This one pins only where to look for it. Every install — CI, a
fresh clone, a deploy build — fetches from that host and accepts whatever comes
back, with no check that it is the same payload anyone reviewed. If the bytes at
that URL ever change, nothing notices.
pnpm does honour integrity for URL tarballs; it simply does not compute one for
a bare URL. Verified both directions: with a deliberately wrong hash the install
fails with ERR_PNPM_TARBALL_INTEGRITY and names the mismatch, and with the hash
below it succeeds.
The recorded hash is of the tarball the URL currently serves, which is the same
payload installs have been fetching all along. That is worth being precise
about: this does not prove the bytes are what the publisher intended, it makes
any future change to them fail loudly instead of passing silently. That is the
property a lockfile is supposed to have.
No behaviour change — the same bytes are installed either way.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The lockfile records this dependency as a URL with no checksum:
Every other dependency carries an integrity hash, so the lockfile pins what will be installed. This one pins only where to look for it. Every install — CI, a fresh clone, a deploy build — fetches from that host and accepts whatever comes back, with no check that it is the same payload anyone reviewed. If the bytes at that URL ever change, nothing notices.
pnpm does honour integrity for URL tarballs; it simply does not compute one for a bare URL. Verified both directions: with a deliberately wrong hash the install fails with ERR_PNPM_TARBALL_INTEGRITY and names the mismatch, and with the hash below it succeeds.
The recorded hash is of the tarball the URL currently serves, which is the same payload installs have been fetching all along. That is worth being precise about: this does not prove the bytes are what the publisher intended, it makes any future change to them fail loudly instead of passing silently. That is the property a lockfile is supposed to have.
No behaviour change — the same bytes are installed either way.