Dev.to Security 🔐 Cybersecurity 👁 0 📖 4 min read

A real dependency audit: 1,090 packages, 118 seconds cold, 1.5 seconds warm

Every "is this safe?" check pays a network cost the first time. Here is what that cost actually is, measured on a real lockfile. I keep saying that checking a dependency before you install it is cheap. "Cheap" is the ki

Every "is this safe?" check pays a network cost the first time. Here is what that cost actually is, measured on a real lockfile.

I keep saying that checking a dependency before you install it is cheap. "Cheap" is the kind of word that hides a number, so I measured the number instead.

The setup

OWASP NodeGoat is a deliberately vulnerable Node app. Its lockfile is from 2023, which makes it a useful stress test: real package shapes, real advisories, a thousand nodes.

The run is pinned to one commit:

git clone https://github.com/OWASP/NodeGoat
git checkout c5cb68a7084e4ae7dcc60e6a98768720a81841e8

Machine: 11th-gen Intel i7-11800H, Linux, 16 threads. Tool: Dep-Vet 0.16.0, release build, 19 MB binary. The cache is isolated in a temporary directory, so this is a genuine cold start and it does not touch my normal cache.

The result

Run Wall time Packages Exit
Cold 118.26 s 1,090 3
Warm 1.45 s 1,090 3

82× between the two runs, on the same input, with the same output.

The cold run left 1,866 cache entries behind, 115 MiB total. That is the actual cost of the first audit: every packument, every advisory batch and detail page, every EPSS and KEV lookup, and the download counts. Nothing is loaded in the background, nothing is preloaded on install, and no daemon is running between audits.

The warm run reads all of it from SQLite and finishes in under two seconds.

Why the two numbers matter differently

A cold run happens once per machine. The number that governs your day is the warm one, because almost every real check is a diff:

  • The CI action runs dep-vet lock on a pull request, so it checks added packages, not the whole tree.
  • watch re-audits when the lockfile changes.
  • guard runs before an install command, and only on the packages being installed.

So the honest framing is not "a 1,000-package audit takes two minutes". It is: the first audit of a tree costs a couple of minutes of wall clock, and every audit after that costs about a second and a half.

That distinction is also why the caching rules are conservative. Registry metadata is cached for 24 hours. Advisories are cached for five minutes, because a five-minute-old advisory list is fine and a day-old one is not. A warm run more than five minutes later will re-query OSV and take longer than 1.45 s — the number above is a genuinely warm run, not a best case with stale security data.

The exit code is part of the benchmark

Both runs exit 3, and that is not a bug in the measurement.

One dependency in that 2023 lockfile, [email protected], no longer exists on npm. Dep-Vet reports the 1,090 packages it could check — 210 HIGH findings across 101 packages, 356 WARN findings across 205 — and still refuses to print "clean":

  could not check 1 package:
    [email protected]: '0.2.0' of 'grunt-if' was not found on npm; dep-vet takes
    an exact version or dist-tag, not a range
  this report is incomplete

A package that was installable in 2023 and is gone in 2026 is a supply-chain event worth knowing about, not a parsing inconvenience. Exit 3 is how the tool says "I could not finish" without pretending the rest of the tree is clean.

That is also why a benchmark with a two-minute cold run is not a failure of the tool. The run made 1,866 metadata requests, with bounded retry and backoff, and then told the truth about the one thing it could not resolve.

What this is not

  • Not a comparison to npm audit. That answers a different question (known advisories for versions already in the lockfile) with a different amount of work (one bulk request to the registry's audit endpoint). A faster number from a smaller check is not a faster tool.
  • Not a claim about contemporary risk. NodeGoat is pinned to a deliberately old tree; the 101 HIGH packages are a property of the fixture, not of npm in 2026.
  • Not a general speed claim. One machine, one lockfile, one run each. The script is in the repo so you can get your own numbers.

Reproduce it

git clone https://github.com/nassih-yassine/Dep-Vet
cd Dep-Vet
cargo build --release
DEPVET_BIN=./target/release/dep-vet examples/benchmark/run.sh

The script clones NodeGoat to a temp directory, wipes an isolated cache, times dep-vet audit package-lock.json twice, then prints the cache entry count and size. It writes nothing to ~/.cache/dep-vet and stores no results.

Try the tool

npx @nassihyas/dep-vet npm [email protected]
npx @nassihyas/dep-vet audit package-lock.json

Repo: https://github.com/nassih-yassine/Dep-Vet

MIT, no account, no API key, no analytics. One opt-outable update check is the only request that isn't a registry, advisory, or archive fetch.

📰 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.