Skip to content

fix: capture resolvedUrl in pnpm, Yarn Classic, and Bun parsers for private registry detection#617

Merged
sonukapoor merged 3 commits into
mainfrom
fix/issue-616-resolvedurl-all-parsers
Jun 11, 2026
Merged

fix: capture resolvedUrl in pnpm, Yarn Classic, and Bun parsers for private registry detection#617
sonukapoor merged 3 commits into
mainfrom
fix/issue-616-resolvedurl-all-parsers

Conversation

@sonukapoor

Copy link
Copy Markdown
Collaborator

Fixes the gap introduced in #588 where private registry detection only worked for npm lockfiles.

pnpm, Yarn Classic, and Bun parsers now capture the resolved URL from their respective lockfile formats, so isPrivateRegistrySource() correctly fires and packages from non-npm sources show as ⚠ Unverifiable (private source) instead of ⚠ Malicious.

Parsers fixed:

  • pnpm legacy (v5-v8): reads resolution.tarball from the packages section
  • pnpm v9: builds a resolution URL map from packages: section before processing snapshots
  • Yarn Classic: reads the resolved field from lockfile entry metadata
  • Bun: reads the second element of the package array (entry[1])

New fixtures (all use node-ipc@9.2.3 resolved from a fake private registry, mirroring the existing mal-private-registry npm fixture):

  • examples/pnpm-mal-private-registry/ (pnpm v9)
  • examples/pnpm-legacy-mal-private-registry/ (pnpm v6)
  • examples/yarn-classic-mal-private-registry/
  • examples/bun-mal-private-registry/

Note: Yarn Berry is out of scope — GitHub/tarball packages are currently not parsed by the Berry parser at all (separate pre-existing issue).

Reported by a Discord engineer using pnpm v9 with GitHub-hosted first-party packages.

Closes #616

@sonukapoor sonukapoor merged commit 66d89f7 into main Jun 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: capture resolvedUrl in pnpm, Yarn, and Bun parsers for private registry detection

1 participant