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 — Bun hosted and vendored rewiring rewrites `bundled: true` lock entries that Bun never fetches: the bundled copy stays unpatched, scan reports success, and vendored `vex` attests not_affected · Issue #469 · 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 agentpm:bunBunBunpriority:p1 Description[agent] Found by the scheduled Bun bug-hunt routine (ledger #306). SummaryBun records a package's Bun unpacks these from the parent's tarball and never fetches them. That's the same reason #325 / #337 made npm skip and contest
ImpactA project whose dependency bundles a vulnerable package gets a successful hosted/vendored run and, in vendored mode, a verified OpenVEX Repro (Linux, any Bun ≥ 1.1.39; mock patch API, no secrets)Fixture: a scoped package mkdir p && cd p echo '{"name":"p","version":"1.0.0","dependencies":{"@bh/bund":"1.0.0"}}' > package.json printf '[install.scopes]\n"@bh" = "http://127.0.0.1:18765/npm/"\n' > bunfig.toml bun install # bun.lock gets "@bh/bund/is-number": [..., {"bundled": true}, ...] export SOCKET_PATCH_SERVER_URL=http://127.0.0.1:18765 G="--api-url http://127.0.0.1:18765 --org org --api-token fake" socket-patch scan --mode vendored --json --yes --cwd . $G # status success, no warnings grep bundled bun.lock # "@bh/bund/is-number": ["[email protected]/vendor/npm/<uuid>/is-number-7.0.0.tgz", { "bundled": true }, "sha512-<patched>"], # fresh checkout, cold cache rm -rf node_modules && BUN_INSTALL_CACHE_DIR=$(mktemp -d) bun install --frozen-lockfile # exit 0 grep -c SOCKET-PATCHED node_modules/@bh/bund/node_modules/is-number/index.js # 0 <- the copy @bh/bund loads node -e 'const p=require.resolve("is-number",{paths:[require("path").dirname(require.resolve("@bh/bund"))]});console.log(p)' # …/node_modules/@bh/bund/node_modules/is-number/index.js (unpatched) socket-patch vex --cwd . --json $G -O out.vex.json; echo $? # 0, event "verified", statement not_affected Hosted is the same with Expected vs actual
Matrix (Linux; real Bun from npm
|
| Bun | lock | hosted scan | vendored scan | bundled copy after frozen install | hoisted phantom copy | vendored vex |
hosted vex |
hosted vex --no-verify |
|---|---|---|---|---|---|---|---|---|
| 1.1.45 | text v0 | success, no warning | success, no warning | unpatched | none | not_affected | not_applied (ok) | not_affected |
| 1.1.45 | bun.lockb | success | success | unpatched | none | not_affected | not_applied | not_affected |
| 1.2.23 | text v1 | success | success | unpatched | patched, unused | not_affected | not_applied | not_affected |
| 1.3.14 | text v1 | success | success | unpatched | patched, unused | not_affected | not_applied | not_affected |
| 1.4.2 | text v2 | success | success | unpatched | patched, unused | not_affected | not_applied | not_affected |
| 1.4.2 | bun.lockb | success | success | unpatched | none | not_affected | not_applied | not_affected |
Each 1.4.2 text cell reproduced on 2+ fresh runs. The "both" shape (the project also depends on [email protected] directly) gives the same result: both entries are rewired, and the bundled copy stays unpatched. macOS and Windows weren't probed. The behaviour is in lockfile parsing and rewriting, which isn't OS-specific.
First bad version: not a regression. Release 4.0.0 behaves the same, and also attests in hosted default vex.
crates/socket-patch-core/src/patch/redirect/mod.rs:3633 (rewrite_bun_lock entry loop: matches on the spec only, not the {meta}.bundled flag)crates/socket-patch-core/src/vendor/bun_lock.rs:285 / :1013 (vendored text rewrite)crates/socket-patch-core/src/patch/redirect/bun_binary.rs:18, crates/socket-patch-core/src/vendor/bun_binary.rs:25 (binary lock: the bundled record is rewritten too)crates/socket-patch-core/src/vex/discover/bun.rs:119 (discovery takes the bundled entry as a live Socket ref, and has no bundled contest like vex/discover/npm.rs got in Fix npm VEX attesting packages with an unpatched bundled copy (#325) #337)Related: #325 (npm, fixed by #337), #405 (another Bun VEX false attestation).
[agent] Triage: priority:p1 (Bun, npm-family). Not a duplicate. No open or merged PR covers it.
Shares root cause with #471: the bundled-copy handling from #337 (#325) exists only on the npm-lock paths (vex/discover/npm.rs, redirect_npm_bundled_instance_skipped in patch/redirect/mod.rs, vendor_bundled_instance_skipped in vendor/npm_lock.rs). The Bun and vlt rewriters and their VEX discovery (vex/discover/bun.rs, vex/discover/vlt.rs, patch/redirect/vlt.rs, vendor/bun_lock.rs) have no bundled-copy skip or contest, so they rewire or attest a copy that only the parent's tarball supplies. I checked on current main: grep bundled finds nothing in any Bun source file, and nothing in vlt discovery. Will be fixed together.
Generated by Claude Code
[agent] Claiming this issue (with #471; shared root cause: bundled-copy skip/contest from #337 exists only for npm locks, not Bun or vlt). Branch: agent/fix-bundled-copy-bun-vlt. Claim-ID: 2026-10-01T14:20:51Z-cf03cb
Generated by Claude Code