GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(vendor): accept sha1-only SRI as last-resort verification in registry_fetch by mikolalysenko · Pull Request #134 · SocketDev/socket-patch

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

The regression

A clean scan --mode vendored run on a real 2019-era yarn-classic monorepo (strapi 3.6.8) failed 14 of 62 patchable packages with vendor_fetch_failed: no usable hash in SRI 'sha1-…' — all npm-era packages whose lockfile entries carry only legacy integrity sha1-… ([email protected], [email protected], [email protected], [email protected], …).

verify_sri (registry_fetch, #115) ranks sha512/384/256 and refuses everything else. The path only triggers when the prebuilt-artifact service misses (e.g. freshly rotated patch UUIDs) and the local-build fallback fetches the pristine registry tarball — which is why earlier runs, served entirely from the service, never hit it.

The fix

sha1 joins the ranking at the bottom — never preferred over sha256+, used only when it's all the lockfile records. That's the exact guarantee the package manager itself enforces for those entries, and the same trust decision the LockIntegrity::Sha1Hex bare-hex arm already made in this file. md5/unknown algos stay refused.

Tests

New unit test pins all four properties: sha1-only verifies; sha1 mismatch refuses (not fail-open); sha1 never outranks a stronger hash in multi-hash SRIs (wrong-sha512 + right-sha1 fails, right-sha512 + wrong-sha1 passes); md5 still refused.

End-to-end validation (real monorepo)

Rebuilt and re-ran the clean vendored flow on the strapi repo: all 14 previously-failing packages now vendor (scan exits success, 62 wired lockfile entries), and [email protected] install delivers 62/62 packages byte-identical to their patched blobs.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mikolalysenko @claude
fix(vendor): accept sha1-only SRI as last-resort verification in regi…
0c34f48
…stry_fetch

npm-era lockfile entries carry ONLY `integrity sha1-…` (yarn classic
writes them for packages published before sha512 metadata existed).
verify_sri ranked sha512/384/256 and refused everything else, so every
legacy package became unvendorable whenever the prebuilt-artifact
service missed and the local-build fallback fetched the pristine
tarball: `vendor_fetch_failed: no usable hash in SRI sha1-…`. A clean
vendored run on a real 2019-era monorepo failed 14 of 62 packages this
way ([email protected], [email protected], [email protected], …).

sha1 now ranks BELOW sha256/384/512 (never preferred, only used when
it is all the lockfile records) — the same trust the package manager
itself enforces for those entries, and the same decision the
LockIntegrity::Sha1Hex bare-hex arm already made in this file.

New unit test pins: sha1-only verifies, sha1 mismatch refuses (not
fail-open), sha1 never outranks a stronger hash in multi-hash SRIs,
md5 still refused.

Validated end-to-end on the real monorepo: all 14 previously-failing
packages vendor, scan exits success, yarn 1 installs 62/62 vendored
packages byte-identical to their patched blobs.

Co-Authored-By: Claude Fable 5 <[email protected]>
@mikolalysenko
Mikola Lysenko (mikolalysenko) enabled auto-merge (squash) July 24, 2026 20:01
Wenxin-Jiang
Wenxin Jiang (Wenxin-Jiang) approved these changes Jul 24, 2026
View reviewed changes
@mikolalysenko
Mikola Lysenko (mikolalysenko) merged commit 14eeec6 into main Jul 27, 2026
54 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the fix/registry-fetch-sha1-sri branch July 27, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Wenxin-Jiang Wenxin Jiang (Wenxin-Jiang) Wenxin-Jiang approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@mikolalysenko @Wenxin-Jiang
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.