Skip to content

vex --no-verify attests a vendored NuGet or Bun package whose lock pins other bytes, and a stale NuGet pin is pinned again only with the patch service reachable #2455

Backlog

Description

[agent] Found by the architecture refactor routine while fixing #2381 (PR #2453), on that PR's branch at 2e5af57 over main at 2440352. Lead L145. The first point is on main for Bun's lock as well.

The problem

#2453 makes vendor --check and vex read the content pin of a NuGet lock, as they already read Bun's: a lock that pins other bytes than the committed vendored artifact does not install it. Three places still do not agree with that rule.

1. vex --no-verify attests a package whose lock pins other bytes

The contract says of --no-verify: "verified against on-disk state (unless --vex-no-verify; the wiring gates apply either way)". It calls a pin mismatch a wiring failure ("vendor --check reports the same as a wiring failure"). The pin is compared in the verification step (core vex/verify.rs, the lock_pin_mismatch arms), which --no-verify skips, and not in the wiring gates.

The real .NET SDK 8, the tree dotnet restore --force-evaluate leaves (the lock on the upstream contentHash, nuget.config and the vendored nupkg as vendored, the app loading the upstream assembly), the binary of #2453:

$ socket-patch vex --product pkg:nuget/app@1.0.0
Warning: omitting pkg:nuget/Fx.Alpha@1.0.0 from VEX: the lockfile pins the vendored artifact to a sha512 that is not that file's, so an install does not deliver it; re-run socket-patch scan --mode vendored (vendor_lock_pin_mismatch)
Error: No applied patches with vulnerability metadata to attest.
[exit 1]

$ socket-patch vex --product pkg:nuget/app@1.0.0 --no-verify
Warning: 1 of 1 VEX statement was emitted without on-disk verification of the patch […]
Wrote OpenVEX document with 1 statement            # "status": "not_affected"
[exit 0]

apply --vex, scan --vex and vendor --vex with --vex-no-verify go the same way. For Bun the same holds on main (read, and run for NuGet only): the Bun arm is in the same skipped step.

2. The run that pins a stale lock again needs the patch service, though the committed nupkg is intact

On that tree the committed nupkg holds the patch and only the lock's hash is stale. The re-vendor takes the path of a missing or stale artifact: it asks the patch service for the nupkg again, and only then pins the lock.

$ SOCKET_OFFLINE=1 socket-patch vendor
Error: Cannot vendor pkg:nuget/Fx.Alpha@1.0.0: --vendor-source=service needs the network but --offline is set
Vendored 0 packages; 1 failed.
[exit 1]                                           # the lock still holds the upstream hash

With the service unreachable it fails the same way ("patch service request failed"). The writer has the sha512 of the committed bytes in hand at that point (core vendor/nuget_feed.rs, nuget_prelude: pin_stale), and could pin from it. The open point is the warning: that run reports vendor_artifact_rebuilt today, which would no longer be true, and vendor_artifact_reused ("re-wired as-is, no service download, no rebuild") is the contract's code for PyPI only.

3. Read, not run

  • scan --mode vendored --dry-run and get --mode vendored --dry-run say already_vendored from the ledger's uuid alone (CLI commands/scan/vendor_flow.rs, the preview's AlreadyVendored arm), where the wet run pins the lock again. Stop verifying and attesting a vendored NuGet package whose lock pins other bytes #2453 fixed the same answer for vendor --dry-run.
  • One lock whose target frameworks pin different hashes for the package (a hand-resolved merge; dotnet does not write one) is reported by vendor --check as "wiring missing … re-run socket-patch vendor to rewire it". The config still names the feed, and the re-run fails on "conflicting contentHash values". Run at the writer: the re-vendor fails and the lock is unchanged.
  • The "wiring missing … re-run socket-patch vendor" text of vendor --check names a command that does nothing in a project with no .socket/manifest.json (what scan --mode vendored leaves): it exits 0 with "No manifest to vendor from". Every ecosystem's unwired state lands on that text.

Planned fix

  1. Judge the pin where the wiring gates are, so that --no-verify reads it, for Bun and NuGet alike; a CLI test for each.
  2. When only the pin is stale, pin from the committed nupkg with no download; a maintainer's word on the warning code would help.
  3. Run the three read-only points before changing them.

Not run: Bun under --no-verify, SDK 10, Windows and macOS.


Generated by Claude Code

Activity

  1. added
    bug
    arch-audit
    on Dec 2, 2026
  2. added a commit that references this issue on Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:triagedarch-auditbugpriority:p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions