Skip to content

fix: resolve every dependency from npmjs.org, not a corporate mirror - #109

Merged
austenstone merged 1 commit into
mainfrom
fix/lockfile-registry
Aug 20, 2026
Merged

fix: resolve every dependency from npmjs.org, not a corporate mirror#109
austenstone merged 1 commit into
mainfrom
fix/lockfile-registry

Conversation

@austenstone

Copy link
Copy Markdown
Owner

34 entries in package-lock.json resolved to Microsoft-internal Azure DevOps feeds rather than npmjs.org:

https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@babel/code-frame/-/code-frame-7.29.7.tgz

They were written by npm install running behind a machine-level registry proxy. This is my own regression — look at which packages: postcss, undici, nanoid, brace-expansion, js-yaml. Those are exactly the ones bumped in #104 to clear the Dependabot advisories, so the fix for the advisories quietly shipped the mirror along with it. The rest are the @babel / browserslist chain.

Why CI never caught it

The feed is 1es-public / npm-public and answers anonymously (303), so npm ci on a GitHub runner succeeds. Green check, wrong source. That's the same shape as everything else found in this repo — a signal that looks fine because the failure mode isn't loud.

It's still worth fixing:

  • A public OSS repo shouldn't route contributors' installs through another company's infrastructure.
  • It splits the trust root specifically for the packages that were bumped to fix security advisories, which is the worst possible set to be fuzzy about.
  • It leaks internal feed hostnames into a public lockfile.

What changed

Only the URL host. The tarballs are byte-identical, which is verified rather than assumed: a clean rm -rf node_modules && npm ci --registry https://registry.npmjs.org/ re-checks all 310 integrity hashes against npmjs.org and passes unchanged. If any tarball had differed, npm ci would have failed on the hash.

.npmrc pins the registry at the repo level so the proxy can't rewrite these URLs again the next time anyone runs npm install on a configured machine. Confirmed working — npm config get registry inside the repo now returns npmjs.org despite the global setting still pointing at the proxy.

Verification

npm ci from npmjs.org, lint, typecheck, 286 tests, and build all pass. The lockfile is stable — npm ci does not modify it, so the diff is exactly the 34 intended URL rewrites and nothing else.

34 entries in package-lock.json pointed at Microsoft-internal Azure
DevOps feeds (ms-feed-*.pkgs.visualstudio.com) instead of npmjs.org.
They were written by npm install running behind a machine-level
registry proxy, and most of them arrived with the security bumps in
04bc0ae, so the fix for the advisories quietly shipped the mirror too.

The feed is publicly readable, which is why CI never went red. It is
still wrong: a public repo should not route anyone's install through
another company's infrastructure, and it splits the trust root for
exactly the packages that were bumped to fix advisories.

The tarballs are byte-identical, so only the URL host changes. npm ci
against npmjs.org re-verifies all 310 integrity hashes unchanged.

.npmrc pins the registry so the same proxy can't rewrite these URLs
again the next time anyone runs npm install on a configured machine.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3cf40db0-fafb-4793-92c6-3fe2b92d70bd
@austenstone
austenstone merged commit 798c090 into main Aug 20, 2026
3 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.

1 participant