GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Hosted yarn classic rewrite drops the `#sha1` fragment when the grant has no sha1, so yarn's cache serves stale bytes: yarn ≤1.17 silently installs the unpatched package, and yarn ≥1.19 fails every warm-cache install · Issue #558 · SocketDev/socket-patch Closed Labels agent:triagedbugSomething isn't workingSomething isn't workingbughuntFound by a scheduled package-manager bug-hunt agentFound by a scheduled package-manager bug-hunt agentcompatibilityPublic CLI/JSON, saved state, upgrades, or package-manager compatibility.Public CLI/JSON, saved state, upgrades, or package-manager compatibility.pm:yarn-classicYarn classic (1.x)Yarn classic (1.x)priority:p1v5-blockerMust resolve before v5: public interface/migration or ordinary patch-install-undo failure.Must resolve before v5: public interface/migration or ordinary patch-install-undo failure. Description[agent] Found by the scheduled Yarn classic (1.x) bug-hunt routine (ledger #304). SummaryIn hosted mode, Yarn classic names its cache slot
The URL plays no part in the cache key, so yarn reuses whatever bytes are already in that slot:
ImpactOn yarn ≤ 1.17, a hosted-patched project can reinstall unpatched code with no error. On yarn ≥ 1.19, a developer or CI machine with a warm cache can't install at all until it runs Repro (Linux, main
|
| yarn | warm-cache frozen install after the sha1-less hosted rewrite |
|---|---|
| 1.0.2 | exit 0, unpatched |
| 1.7.0 | exit 0, unpatched |
| 1.10.1 | exit 0, unpatched (superseding variant: stale patch A) |
| 1.17.3 | exit 0, unpatched |
| 1.19.0 | exit 1, Incorrect integrity when fetching from the cache |
| 1.21.1 | exit 1, same |
| 1.22.22 | exit 1, same (superseding variant too) |
| any (cold cache) | patched (pass) |
| any, grant with sha1 | patched (pass): the fragment gives a distinct cache slot |
The OS doesn't matter, because the cache-key logic is yarn's own. macOS / Windows weren't probed.
Not a regression: v4.0.0 (npm @socketsecurity/[email protected]) writes the same fragmentless resolved.
crates/socket-patch-core/src/patch/redirect/mod.rs:3110-3115: frag falls back to unwrap_or_default() when dep.integrity.sha1 is None, and no warning or refusal is emitted. Compare formats/composer/hosted.rs:186 (redirect_composer_missing_sha1).
[agent] A correction to the "Expected" citation: the contract is crates/socket-patch-cli/CLI_CONTRACT.md. Its lockfile-discovery table (line 363) lists the yarn classic hosted pin as "classic integrity / #sha1, required". docs/ecosystems.md doesn't state the fragment explicitly, so please disregard that part of the citation.
Generated by Claude Code
[agent] Triage: priority:p1 (yarn classic). Hosted rewrite_yarn_classic writes a fragmentless resolved URL when the grant carries no sha1, colliding in yarn's cache slot. Composer has an equivalent guard (redirect_composer_missing_sha1); yarn classic does not. Distinct root cause; no open PR covers it.
Generated by Claude Code
[agent] Re-triage on main 05ecc6e: still reproduces on Linux, ×2 per version, using the issue's repro (warm the cache with a fragmentless upstream [email protected] lock, then a hosted scan against a grant whose artifact integrity has only sha512).
redirected: 1 and no warning. The lock gets resolved "<hosted>/left-pad-1.3.0.tgz" with no #sha1 fragment.yarn install --frozen-lockfile exits 0 and installs unpatched bytes.Incorrect integrity when fetching from the cache for "left-pad".sha1 pins #<sha1>, and the warm-cache install is patched on both versions.Generated by Claude Code
[agent] Re-triage on main e2d9633 (after #1057, the yarn.lock grammar move): still reproduces, Linux, ×2 per version, same repro (warm the cache from a fragmentless upstream lock, then a hosted scan against a grant whose artifact integrity has only sha512).
resolved "<hosted>/left-pad-1.3.0.tgz" with no #sha1 fragment and no warning.install --frozen-lockfile exits 0 and installs unpatched bytes.Incorrect integrity when fetching from the cache for "left-pad".Generated by Claude Code
v5 release blocker (P1). A normal first hosted Yarn classic install with a warm cache can use upstream bytes or fail when the service supplies SHA-512 only. Fix the cache identity or the supported grant contract.
This follows the maintainer's release scope: one normally completing CLI instance, prioritizing valid-lockfile patch/install behavior, compatibility, and actionable CLI UX.
[agent] Claiming for v5 blocker burn-down (shared root cause: hosted yarn classic rewrite writes a fragmentless resolved URL when the grant lacks sha1). Branch: agent/v5-yarn-classic-sha1. Claim-ID: 2026-10-09T16:42:02Z-9ea6d3
[agent] Re-triage from the Yarn classic bug-hunt (ledger #304), Linux, local mock whose grant artifact integrity has only sha512. Same repro as before: warm the yarn cache from a fragmentless upstream lock, run a hosted scan, then yarn install --frozen-lockfile against the same cache.
| binary | yarn | scan | resolved written |
warm-cache frozen install |
|---|---|---|---|---|
main 9ab72d4 |
1.10.1 | exit 0, no warning | no #sha1 |
exit 0, unpatched bytes |
main 9ab72d4 |
1.22.22 | exit 0, no warning | no #sha1 |
exit 1, Incorrect integrity when fetching from the cache |
PR #1328 head 494932e |
1.10.1 | exit 0 | …/left-pad-1.3.0.tgz#81960ffa… |
exit 0, patched |
PR #1328 head 494932e |
1.22.22 | exit 0 | …/left-pad-1.3.0.tgz#81960ffa… |
exit 0, patched |
On #1328 the control cell also passes on both releases (an upstream lock that already had a fragment, so the cache key is distinct). So #1328 fixes the repro, and main still reproduces it.
Generated by Claude Code