Why npm audit Reports '0 Vulnerabilities' in a Fresh Next.js App—and What Vendored Dependencies HideNote · digest for November 27
Surrealist still life with a magnifying glass revealing hidden vendored Next.js packages in a mirror reflection
Note3 sections≈ 4 min

Why npm audit Reports '0 Vulnerabilities' in a Fresh Next.js App—and What Vendored Dependencies Hide

You spin up a fresh Next.js project, run npm audit, and see a reassuring green found 0 vulnerabilities. You get straight to coding. Yet that zero is an illusion: 139 third-party libraries already sit bundled inside the next package, and the standard scanner can't see them.

How Vendoring and Scaffolders Hide Vulnerabilities From npm audit

npm audit checks the tree in package-lock.json against a vulnerability database. If a package appears under dependencies, the scanner inspects it. When a framework compiles third-party code straight into its own package, that entry disappears from the lockfile. That practice is called vendoring.

Because those libraries live inside node_modules/next/dist/compiled, npm audit treats them as Next.js's own source code and skips them. Eleventy creator Zach Leatherman scanned that folder separately in a fresh create-next-app (next@16.4.6). Despite a zero in the standard report, he found 35 vulnerabilities across 26 packages: 3 critical, 19 high, 2 moderate, and 11 low. For comparison, a fresh create-gatsby project surfaced 78 open warnings, yet only 2 were critical—fewer than the hidden ones inside Next.js.

CLI scaffolders add a second blind spot. create-gatsby runs install with --no-audit, while create-astro, @tanstack/cli, and create-preact silence console output. create-nuxt and ng new only print logs on failure, and sv create clears them right after setup. Meanwhile, pnpm and yarn don't run audits during installation at all.

# Run audits explicitly: pnpm and yarn skip them during install
npm audit
pnpm audit
yarn npm audit

# Check how many vendored packages sit inside Next.js
ls node_modules/next/dist/compiled | wc -l

The first three commands only inspect the visible lockfile tree. That last line is a quick reality check: in a fresh next@16.4.6 app, it lists over a hundred folders that npm audit ignores completely.

What Prototype Pollution Report Found Across 13 Frameworks

To track this picture daily, Zach Leatherman launched Prototype Pollution Report. The name nods to prototype pollution—a JS flaw where unchecked keys like __proto__ mutate Object.prototype. The tracker audits 13 frameworks across two slices (full ecosystem and core plus required peer dependencies), including vendored folders inside Next.js and Vite.

Core Framework Vulnerabilities Including Vendored Code (PPR, Nov 25, 2026)

In the core slice, nine out of thirteen frameworks hold a clean zero: Eleventy, Astro, SvelteKit, SolidStart, TanStack Start, Angular, Lit, Preact, and Vite. vite@8.3.8 stands out—it also bundles a hundred dependencies into node_modules/vite/dist, yet keeps them up to date. Vendoring itself isn't the problem; update discipline is.

The tracker also revealed a nearly linear link between package count and bug count: correlation across the 13 frameworks hit r = 0.93 in the full ecosystem and r = 0.92 in core. Results map to a 0–5 'weather' scale, weighting critical at 10 points, high at 6, moderate at 3, and low at 1.

Where Criticism Stops and How to Audit Thoughtfully

Numbers inside dist/compiled aren't a reason to panic. Frameworks vendor packages for faster installs, tighter version control, and protection against broken transitive updates. A CVE sitting in a folder also doesn't guarantee it's exploitable in your app—much of that code may never run on live routes.

Execution context decides the risk. If a flaw lives in a Markdown parser used only during static builds (build-time), external users can't reach it. Server code handling live requests (request-time) in Next.js, Nuxt, or SvelteKit—plus client bundles—is a different story. There, blind spots stop your team from even assessing exposure. PPR has its own quirk too: its ecosystem table penalizes orgs for older packages that lack a deprecated flag.

How to Build an Honest Dependency Audit

  • Run npm audit, pnpm audit, or yarn npm audit as a dedicated CI job.
  • Check Prototype Pollution Report and release notes for frameworks that vendor code.
  • Add SCA scanners that inspect bundles and check reachability.
  • Prioritize fixes by runtime context: request-time servers and client bundles first, build-time tools second.
Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 3