Dev.to Security 🔐 Cybersecurity 👁 2 📖 5 min read

86 audit advisories to 3 in one commit: 25 were one framework, 19 were four overrides, and none needed a major version

Two weeks ago I dated every direct dependency of PubTrivia and found 42 of 50 behind, nine of them by a major version. Yesterday the commit 1c7be48 landed with the unglamorous message "Bump dependencies and align lockfil

Two weeks ago I dated every direct dependency of PubTrivia and found 42 of 50 behind, nine of them by a major version. Yesterday the commit 1c7be48 landed with the unglamorous message "Bump dependencies and align lockfile with pnpm overrides". It changes four files, with 2,186 insertions, nearly all of them in pnpm-lock.yaml.

I had never run pnpm audit on this project. This post is that run, twice: once on the lockfile from before the commit, once on the lockfile after it.

How to repeat it

The point is that you do not need to check anything out or install anything. pnpm audit reads the lockfile, so two directories with two copies of three files is enough:

mkdir -p /tmp/before/ws-server /tmp/after/ws-server
git show 321d63a:package.json              > /tmp/before/package.json
git show 321d63a:pnpm-lock.yaml            > /tmp/before/pnpm-lock.yaml
git show 321d63a:pnpm-workspace.yaml       > /tmp/before/pnpm-workspace.yaml
git show 321d63a:ws-server/package.json    > /tmp/before/ws-server/package.json
# same four with HEAD into /tmp/after
cd /tmp/before && pnpm audit --json > audit.json

--json matters, because the summary line counts severities and the file lets you group by package.

The headline

before the commit after
Packages in the lockfile 834 842
Advisories 86 3
Critical 7 0
High 35 0
Moderate 33 3
Low 11 0

Two things about those numbers before the story. First, they count advisories, not packages: the 86 sit on 20 distinct packages, and one package can carry a dozen. Second, they are a statement about the lockfile, not about any particular running system. Whether an advisory is reachable in your app is a separate question that audit cannot answer, and I am deliberately not describing individual advisories here. They are public, one command lists them, and a blog post is not the place to narrate them.

The audit's own dev flag marks 16 of the 86 as appearing only on development-dependency paths. The other 70 were on paths that include something we list under dependencies.

Where the 86 came from

Grouping the old advisories by package and then by what actually fixed each group:

What closed them Advisories Packages
Bumping the framework itself, next 16.2.7 to 16.4.6 25 next
The four new overrides lines 19 fast-uri 11, vite 5, browserslist 2, baseline-browser-mapping 1
Other direct bumps 4 vitest and its mocker 3, @sentry/nextjs 1
Everything else, which moved when the lockfile was re-resolved 38 brace-expansion 12, dompurify 8, postcss 4, sharp 3, nanoid 2, esbuild 2, glob 2, and six more with one each

The first row is the headline and also the least interesting. One package accounts for 29 per cent of the total, and it is the one every Next.js project updates anyway.

The last row is the one I would have guessed wrong. Thirty-eight advisories, 44 per cent, were in packages I have never typed into a package.json: a brace expander, an HTML sanitiser, a CSS parser, an image library. They came in through something else, they were pinned in the lockfile at whatever version was current when it was last resolved, and they were fixed without anyone deciding to fix them. pnpm install with an existing lockfile keeps what it has. Regenerating the lockfile within the same declared ranges is what moved them.

That is a different kind of maintenance from "update our dependencies". Nothing in that row required a decision.

The row that did: four overrides

pnpm-workspace.yaml gained four lines in this commit:

overrides:
  '@types/react': 19.2.16
  '@types/react-dom': 19.2.3
  fast-uri: ^3.1.9
  browserslist: ^4.28.7
  baseline-browser-mapping: ^2.11.0
  vite: ^8.1.6

The first two were already there. The other four are floors for packages that arrive only through something else. I will take them apart one at a time in a follow-up, because the interesting question is which of them still do any work, and I have an experiment for that. Here the point is only the shape: nineteen advisories sat behind four lines of YAML.

If you want to see what a floor like that does in a lockfile, pnpm why prints the chain:

pnpm why vite
# [email protected]
# └─┬ @vitest/[email protected]
#   └─┬ [email protected]

We never import vite. It is in the tree because the test runner needs it.

The three that are left

All three are moderate, and all three come in through tools rather than through our own code:

Package Version Reached through
esbuild 0.18.20 drizzle-kit, via its older @esbuild-kit loader
glob 13.0.7 @sentry/nextjs, via its bundler plugin
minimatch 10.2.6 the same glob

The esbuild one is the interesting survivor, because a lockfile with three esbuild versions in it has a second story to tell, and I will write that one separately too. For now: it is a development server advisory in a version that only the database CLI loads.

What the commit did not touch

The nine majors from the November post are all still behind, exactly the same nine:

@sentry/nextjs   10.78.0 -> 11.21.0
@types/node      25.9.12 -> 26.6.11
@vitest/coverage-v8, vitest   4.1.12 -> 5.1.2
dotenv           17.4.2 -> 18.0.10
framer-motion    12.43.0 -> 14.14.0
postgres         3.4.9 -> 4.2.0
stripe           22.6.2 -> 23.2.0
typescript       6.0.3 -> 7.0.2

pnpm outdated now lists 14 packages instead of 42. The other five are react and react-dom, pinned to an exact version on purpose, the two type packages that are overridden to a pin, and @supabase/ssr on a 0.x line where a minor can be breaking.

So the bump moved everything that could move inside its declared range and touched none of the nine that could not. Three of the nine sit on the paths that matter most: the Postgres driver, the payments SDK and the error reporter. Those I want to upgrade one at a time with a reason, not in a sweep.

Did it break anything

The cheapest honest answer I have: tsc --noEmit exits 0 in about six seconds, and all 24 test files pass. The site that is live today was built from this lockfile; you can tell, because its asset URLs now sit under /_next/static/immutable/, which does not exist before Next 16.3. I wrote about what that did to our cache headers earlier today.

What I take from it

Seeing 86 on a lockfile you have not looked at in five months is not alarming, it is arithmetic. Every package in a tree of 834 is a window, and a tree that is only ever installed from a frozen lockfile ages at the speed of its oldest pin.

The useful habit is cheap: run pnpm audit --json against git show <commit>:pnpm-lock.yaml, and group by package, not by severity. The severity table is a mood. The package table tells you which of the 86 are one decision and which are 38 non-decisions.

If you want to see the product the lockfile is for, the free tools need no account, and the homepage is the page that is built from every one of these 842 packages.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.