How to Find and Prioritize Vulnerabilities in Transitive Dependencies

· Original article ↗

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

Related Articles