When you switch your config from a corporate mirror back to the public registry, installs finish in a fraction of a second. Under the hood, an old optimization kicked in: pnpm pulled resolved versions from the previous registry's cache and silently skipped security checks.
Zoltan Kochan's team patched this gap in minor release 12.22.0 and security patch 11.28.13. Branch 12.22.0 also adds isolated configuration for global CLI tools and a new flag to trace version conflicts.
Why Switching Registries Bypassed Protection
First, let's look at how the two safety filters work. minimumReleaseAge sets a quarantine window in minutes, blocking freshly published releases right after upload. trustPolicy checks a package's provenance signature so an attacker cannot slip in an unsigned build even if they hijack a maintainer's account.
You'd expect turning on both filters to cover your project. In practice, switching the main registry or a scoped registry (a separate URL for packages sharing a company prefix) caused pnpm install to trust the old cache and skip both checks against the new source.
Now, changing registries forces pnpm to re-verify entries in pnpm-lock.yaml. The same bug affected one-off tool runs via pnpm dlx: its cache key ignored security rules, so stale caches stayed valid even after tightening your config. Both releases bind the dlx cache key to minimumReleaseAge, trustPolicy, trustLockfile, blockExoticSubdeps, overrides, and packageExtensions. A separate fix also taught pnpm audit to recognize vulnerabilities with string IDs.
To close these gaps, update your client on either the main or LTS branch:
pnpm add -g pnpm@12.22.0
# Or for the 11.x LTS branch
pnpm add -g pnpm@11.28.13
Both versions revalidate caches on registry changes and include the audit fix. If you run an unfamiliar generator via dlx, you can block its build scripts upfront:
pnpm dlx --allow-build=!untrusted-cli untrusted-cli
The exclamation mark in --allow-build denies build scripts for that package. The tool cannot run arbitrary code during installation, and it won't pause for an interactive approval prompt.
globalPackagesConfig: Isolating Global Tools
Two conflicting needs collide on every developer machine. In work projects, you want strict provenance signatures from every dependency. Global CLI tools, on the other hand, often ship without signatures or rely on native builds.
Previously, any exception in your user config weakened local projects too—unless you set up workarounds in the global directory's pnpm-workspace.yaml. Version 12.22.0 moves global exceptions into globalPackagesConfig, while patch 11.28.13 warns you if it sees that key so you know it belongs to the newer release.
Here is a ~/.config/pnpm/config.yaml setup that protects projects while granting targeted permissions to global packages:
trustPolicy: no-downgrade
minimumReleaseAge: 1440
globalPackagesConfig:
trustPolicyExclude:
- vercel
- turbo
permissions:
esbuild:
build: true
The first two lines enforce a 24-hour (1,440-minute) quarantine and forbid lowering trustPolicy across all local projects. The globalPackagesConfig block applies strictly to global commands like pnpm add -g, pnpm update -g, and pnpm approve-builds -g.
Tools in trustPolicyExclude install globally without provenance signatures, and esbuild under permissions can run its build scripts without relaxing local repositories. Legacy settings in the global pnpm-workspace.yaml still work with a warning and migrate automatically into config.yaml the next time you run pnpm approve-builds -g.
pnpm why --ranges and Monorepo Ordering
When debugging dependencies, you often need to know which package pulled a conflicting version into the project. The package tree shows what landed on disk, but hides which direct parent asked for a broad range versus a pinned patch.
Version 12.22.0 adds a --ranges flag to the dependency tree command. Let's check it on a sample package:
pnpm why lodash --ranges
pnpm why lodash --ranges --json
The first command prints the exact semver range from each dependent package's manifest. The second adds those strings to a requires JSON field, which is handy for automated CI checks.
Finally, pnpm list --recursive in 12.22.0 now outputs monorepo projects in topological dependency order by default; pass --no-sort to restore the old order.

