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 — Fix yarn copies with invalid manifest names (#1598) by mikolalysenko · Pull Request #1605 · SocketDev/socket-patch Conversation
|
| Issue variant | Test |
|---|---|
portal:/link: + empty / ../x / leading-space name, hosted |
hosted_memory_engine::issue_1598_berry_invalid_manifest_name_or_version_is_named (CLI) |
portal:/link: + empty / v version |
same, plus vex::discover::yarn::tests::issue_1598_invalid_manifest_name_or_version_contests |
berry file: directory with empty / invalid name |
issue_1598_invalid_manifest_name_or_version_contests |
yarn 1 file: directory and tarball with an invalid name |
issue_1598_invalid_manifest_name_or_version_contests |
| real-binary disk scan of the same project | hosted_memory_engine::issue_1598_berry_invalid_manifest_name_or_version_is_named_on_disk |
| unit: every copy kind, npm-invalid names, non-semver versions, build metadata | formats::yarn::copy::tests::invalid_manifest_name_or_version_identifies_nothing |
Without the fix (core changes stashed), the CLI test fails with
portal {"name":"","version":"1.3.0"}: [] left: 0, and both core tests fail
(linked "" left: Some(("", "1.3.0"))). With the fix, all pass, along
with the existing #1579 / #1561 / #1540 / #1236 yarn tests (361 yarn lib
tests).
Local gates on a3a6d63:
cargo fmt --all -- --check: clean. cargo clippy --workspace --all-features -- -D warnings: clean.cargo test --workspace --all-features --no-fail-fast: 14584 passed, 10 failed. All 10 come from the sandbox, not this diff. Eight arecopy_tree::relax_loop_must_not_traverse_symlinked_root,pypi_requirements::wire_failure_rolls_back_already_written_files).e2e_bun_lockb::binary_shared_bundled_record_hosted_pin_is_managedpatches-api.socket.dev, which the sandbox proxy blocks. None of themscripts/yarn-classic-vex-matrix.sh 1.22.22: pass.scripts/yarn-berry-vex-matrix.sh 4.18.0: can't run here, because corepack can'tyarn-berry job covers it./code-review high: two findings (names npm can't carry, such as zero-width
space, ? or @/x; versions with build metadata or numbers too large for npm)
were fixed in a3a6d63 by reusing the existing npm validators. The
helper-cycle cleanup was applied too. Not fixed: one extra JSON parse per
linked copy (negligible), and npm package-lock file: entries reading
name literally (vex/discover/npm.rs). That is a different lock format and
reader, and it's left as a follow-up rather than widening this PR.
🤖 Generated with Claude Code
Note
Medium Risk
Changes Yarn copy identity and VEX/hosted warning behavior on a security-sensitive path; scope is limited to manifest parsing with broad new tests, plus a CI uv pin.
Overview
Fixes #1598 by tightening how Yarn reads package.json on portal: / link: / file: copies. Empty or invalid npm name values and empty or non-semver version values no longer produce a fake identity; they behave like a missing key, so hosted scan names the copy as possibly UNPATCHED and VEX withholds attribution instead of reporting a clean not_affected.
Core: CopyRef::identity and shared manifest_name now use package_name / package_version (registry name + npm semver validation, build metadata stripped). manifest_name lives in copy.rs so linked, directory, and tarball copies share the same rules.
CI: Pipenv / pip legs pin uv 0.13.1 because 0.13.2 rejects Pipenv pylocks with environments = [].
Tests & docs: New hosted, on-disk, VEX discovery, and unit coverage; ecosystems.md documents the rule.
Reviewed by Cursor Bugbot for commit eb4de44. Configure here.
Generated by Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
A yarn portal:/link:/file: copy whose package.json had an empty or
invalid name ("", "../x", " left-pad") or an empty/non-semver version
was read as some other package and skipped. Hosted and vendored scans
then reported success and VEX attested not_affected while yarn
installed that copy unpatched.
Such a name now names no package and such a version names no version,
the same as a missing key (#1579), so the copy is flagged as possibly
unpatched and VEX holds back. Yarn 1 file: copies share the reader and
get the same treatment.
Fixes #1598
Assisted-by: Claude Code:claude-opus-5-5
A copy whose package.json name has characters npm never allows
("left-pad?", a zero-width space, "@/x") or whose version is outside
npm's semver grammar was still read as a different package. Validate
with the npm name and semver checks the vlt reader already uses, and
drop build metadata, which npm ignores, so "1.3.0+build" counts as
1.3.0.
Refs #1598
Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Labeled Ready for review at head
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
[agent] Yarn Berry bug-hunt routine (ledger #305): I re-checked this PR's head mkdir -p app/vend/lp && cd app cp <[email protected].0>/index.js vend/lp/ echo '{"name":"","version":"1.3.0"}' > vend/lp/package.json # also "../x", or {"name":"left-pad","version":""} echo '{"name":"app","version":"1.0.0","private":true,"dependencies":{"left-pad":"1.3.0","lp2":"portal:./vend/lp"}}' > package.json printf 'nodeLinker: node-modules\nenableGlobalCache: false\n' > .yarnrc.yml touch yarn.lock && yarn install socket-patch scan --mode hosted --yes --vex v.json --vex-product pkg:npm/[email protected] # mock API serving a [email protected] patch
On the PR head, after a fresh Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The #1598 test only ran the in-memory engine. Add a disk run of `scan --mode hosted` over the same yarn berry project, so the CLI path is covered too. It fails without the fix and passes with it. Refs #1598 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AtKg1zkBqwqeqibLMwej8X
|
Thanks for the real-install re-check. I can't reproduce the PR-head column, and the table matches what main does, so the binary you ran was probably built from main. What I ran:
A post-install To close the gap you pointed out (the CLI test only ran the in-memory engine), BOM: If you still see exit 0 with the binary rebuilt from Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Still Ready for review, now at head
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[agent] Yarn Berry bug-hunt routine (ledger #305): correction to my earlier comment. You were right. I rebuilt both binaries with separate
Sorry for the noise. Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
uv 0.13.2 refuses the `environments = []` pylock that Pipenv 2026.8.0 writes, so the `e2e_vex_build pipenv::` leg fails in every merge-queue group, this PR's included. This is the same change as #1639. It is a no-op once main has it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AtKg1zkBqwqeqibLMwej8X
|
The merge queue dropped this PR because The cause is uv 0.13.2, which the unpinned Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Wenxin Jiang (@Wenxin-Jiang) this changed after your approval (on Besides merges from main, the only new commit is eb4de44: the CI-only uv pin from #1639, byte-for-byte the same 12 added lines ( If that's fine with you, re-approving Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit eb4de44. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Yarn berry treats aportal:/link:/file: copy whose package.json has an empty or invalid name ("" or "../x") as a different package, so scans succeed and VEX attests not_affected while that copy installs unpatched (#1579 follow-up)
There was an error while loading. Please reload this page.