How to Find and Prioritize Vulnerabilities in Transitive Dependencies

Summary
A practical guide to tracing transitive dependencies, assessing whether vulnerable code is reachable and exploitable, and prioritizing fixes using package-manager tools, overrides and lockfile reviews.
Key points
- Use commands such as npm ls --all, npm explain, and ecosystem-specific dependency-tree tools to identify indirect packages and the paths that pull them in.
- Prioritize vulnerabilities by whether the affected code is reachable and whether attackers can control its input; a package version match alone does not establish exploitability.
- Update the direct dependency that brings in a vulnerable package when possible. Overrides or resolutions can force a patched version, but may break compatibility and should be tested.
- Review lockfile changes during dependency updates because lockfiles record resolved packages and versions.
- The article describes a September 2025 compromise of debug, chalk, and other packages reaching teams through transitive dependencies.
- In a vendor demonstration, Aikido traced two paths to a vulnerable qs version, identified one as exploitable through an Express endpoint, and proposed an Express update.
Article Details
- Defense Focus
- Secure transitive dependencies by identifying vulnerable packages and their dependency paths, assessing reachability and exploitability, and prioritizing fixes.
- Detection Methods
- Use npm ls --all to inventory the dependency tree, npm ls <package> to trace paths to a specific package, and npm explain <package> to identify why it is present.
- Review lockfile contents and dependency-update diffs to identify resolved packages and versions.
- Use reachability analysis to trace call paths to vulnerable functions and assess whether the application can execute them.
- Assess whether reachable vulnerable code receives attacker-controlled input.
- Use dependency analysis to map paths from application code to vulnerable packages and review findings and auto-ignored items.
- Data Sources
- Dependency trees and package manifests
- Lockfiles and lockfile diffs
- Application source code and call paths
- Vulnerability advisories and CVE database matches
- Dependency-analysis findings and fix-time estimates
- Platforms
- Aikido Security
- Defensive Actions
- Prioritize vulnerabilities that are both reachable and exploitable in the application.
- Update the direct dependency that pulls in a vulnerable transitive package when a fixed version is available.
- If an upstream fix is unavailable, consider forcing a patched version with npm overrides or Yarn resolutions, then test for breakage.
- Review lockfile diffs during dependency updates.
- Review the reasoning behind auto-ignored findings and proposed automated fixes before accepting changes.
CVE
Vendors
Products
Aikido SecurityAikido Security runs those steps for you. To show the workflow, I connected a demo repository with a small Express app, pinned to [email protected] so it pulls in the vulnerable qs version from the tree above, and letAutofix4. Fix it. AutoFix proposes bumping express from 4.17.1 to 4.17.3, the version that resolves the qs finding, and updates the lockfile. Before you let it open the pull request, it explains why the change doesn't breaknpmadd one library, you inherit every package it uses (and every package those packages use). Research on the npm ecosystem found that installing an average npm package implicitly trusts 79 other packages, most of whichYarnthat bumps it, or you force the version yourself with an overrides entry in npm or a resolutions entry in Yarn, and then test that the forced version doesn't break the library that wanted the old one. When something
