Guides · ← All guides
Exposed package.json: Your Dependency List Is a Recon Gift
Published: November 14, 2026 · Last reviewed: November 14, 2026 · 6 min read
Run a free BreachHunter assessment on your site →
The manifest exposure belongs to the same family as the version banner — disclosure that aims exploits — with a multiplier: a banner names one component; a manifest names forty. Every dependency in the list has its own CVE history, its own abandoned-or-maintained status, and its own probability of being the weakest thing you run. Publishing the list is publishing your attack surface's table of contents.
This guide covers what a manifest actually reveals beyond versions (scripts, repository URLs, internal package names), how lockfiles sharpen the disclosure to exact builds, and the standard fix — manifests live outside the served root, and the server denies the filenames as a class — plus the software-composition habit (dependency auditing) that addresses the risk the manifest merely advertises.
What a manifest tells an attacker, line by line
Dependencies with versions are the headline: each entry is checked against vulnerability databases, and the intersection — your exact version's known CVEs — becomes the worklist. But the supporting fields leak too. The repository URL points at your source (sometimes a private repo name worth social-engineering with). Scripts reveal your build and deployment commands and tooling. Internal or scoped package names map your architecture and your employer's naming conventions. Even the “engines” field dates your runtime.
Lockfiles (package-lock.json, composer.lock) are the sharper instrument: resolved, exact versions of every transitive dependency — the full tree, not the declared ranges — including the nested library three levels down that nobody on your team chose directly and whose CVE neither of you has heard of. The scanner's table names the manifests; treat the locks as the same finding with better aim, and deny both. The banner parallel is in the version banners guide; the manifest is that problem at fleet scale.
Out of the root, denied by rule, audited as a habit
The structural fix is the one modern frameworks already assume: the web root is a public/ subdirectory, and the manifest sits one level above it, unservable by construction. Where the root cannot move (legacy Node apps served from the project directory), the server deny rule covers the filenames — package.json, package-lock.json, composer.json, composer.lock, yarn.lock — as a set, returning 404. Verify from outside: all five names, plus the .git-style dotfile rule from the .git guide, since manifest and repo exposure are usually the same misplacement.
Then the deeper point: the manifest's audience should be you. Dependency auditing (npm audit, composer audit, Dependabot-class tooling) runs the same CVE matching the attacker runs, on a schedule, with the advantage of also being able to fix what it finds. The exposed-manifest finding closes with the deny rule; the risk it advertised closes with the audit cadence. Both belong in the report response — reviewers credit the pair.
Worked example: pixelforge.example
PixelForge Apps, a small product studio, served its marketing site and API docs from the same Node process that ran its app — project directory as web root. The sensitive-path probe asked for the manifest and got the studio's entire dependency tree, resolved:
GET /package.json -> 200 MEDIUM (-4) 38 dependencies with ranges GET /package-lock.json -> 200 412 packages, exact versions (transitive included) Notable: one framework plugin at a version with a published RCE advisory
The studio's response split exactly along this guide's lines: the dangerous dependency was upgraded the same day (the advisory, not the exposure, was the emergency), the app was re-deployed behind a public/ root so manifests became structurally unservable, and lockfile names were added to the server deny list as a second wall. Dependency auditing joined the studio's CI that week. Retest showed 404 across the manifest set — and, more valuable, the next audit report from CI arrived before any scanner's did.
The five actions to take
Closing the manifest exposure:
- Probe your root for package.json, package-lock.json, composer.json, composer.lock and yarn.lock — any 200 is the finding.
- Move the web root to a public/ subdirectory so manifests sit outside it by construction, where your framework supports it.
- Add server deny rules for all manifest and lockfile names as a second layer.
- Run dependency audit (npm/composer audit or Dependabot-class tooling) and fix what it flags — starting with anything the exposed list advertised.
- Re-scan to confirm 404s, and put dependency auditing on the CI/release cadence permanently.
Run a free BreachHunter assessment on your site →
Frequently asked questions
Our dependencies are all open source anyway. What is secret?
The packages are public; your selection and exact versions are the intelligence. Security here is not secrecy of code but of configuration — the same reason a network map is sensitive though every road on it is public. The manifest tells an attacker which CVEs are worth their next hour.
Is this really MEDIUM? It feels like trivia.
The rating reflects that disclosure alone breaches nothing — an unpatched dependency must also exist. But the manifest is how that dependency gets found, and the base rate of “one outdated transitive package with a bad CVE” across real projects is high. MEDIUM with a fast fix is the honest grade.
Does hiding the manifest replace updating dependencies?
No — it removes the advertisement, not the vulnerability. A determined attacker fingerprints versions behaviorally. The pair is the answer: deny the manifest so casual targeting fails, and audit/update so determined targeting finds patched versions.
We serve the app from the project root and cannot move it this quarter. Interim step?
The deny-rule layer alone closes the external finding: server rules returning 404 for the five filenames. Log any hits on them (probing telemetry is free threat intel), and schedule the structural move — rules rot, directory layouts persist.
What about Python (requirements.txt) or Ruby (Gemfile) projects?
Same class, same fix: the scanner's named rows are the Node/PHP pair, but requirements.txt, Pipfile.lock, Gemfile and Gemfile.lock disclose identically and belong under the same deny rules and root discipline.
Sources
The primary sources behind this guide — the documents we check our own work against:
- OWASP Top 10 (2021) — A06:2021 Vulnerable and Outdated Components.
- npm documentation (2025) — what package.json and its lockfile record about a project.