Safeguard
Security Guides•

How do I find vulnerable dependencies in my project?

Find vulnerable dependencies by listing every package at its exact version, checking each against advisory data, and reading direct findings first.

Safeguard Security Team
3 min read

To find vulnerable dependencies, list every package in your project at its exact version, including transitive ones, then check that list against an advisory database. Use your package manager's built in audit command or a dedicated scanner. Run it in CI so new advisories surface on their own.

Definitions

Manifest. The file where you declare what you want, such as package.json or pom.xml.

Lockfile. The file that records the exact versions that were resolved, such as package-lock.json or Cargo.lock.

Advisory database. A collection of published vulnerability records, mapped to package names and affected version ranges.

Steps

  1. Commit your lockfile. A scan of exact versions is more accurate than a scan of loose ranges. The npm documentation notes that without a lockfile, results can differ between runs because the tree is rebuilt each time.
  2. Run the audit built into your package manager. Several ecosystems ship one. See the table below.
  3. Include transitive packages. Some tools need a flag for that. The .NET command for listing vulnerable packages, for example, does not include transitive packages unless you ask.
  4. Read direct findings first. A direct dependency you control is quicker to fix than a deep one.
  5. Find the path for transitive findings. Trace which top level package pulls the vulnerable one in, then upgrade the closest parent.
  6. Re-run after each change and confirm the finding is gone.

Ecosystem starting points

EcosystemBuilt in or common starting pointNotes
npmnpm auditNeeds a package-lock.json by default
Pythonpip-auditReads requirements files and environments
.NETdotnet list package with the vulnerable optionAdd the transitive option
GogovulncheckReports whether vulnerable code is called
JavaOWASP Dependency-CheckMaven, Gradle and CLI integrations
AnyOSV-ScannerMatches lockfiles against the OSV database

Common mistakes

  • Scanning once at release and never again. Advisories keep arriving.
  • Treating every finding as equal. Severity, fix availability and whether the code is called all matter.
  • Scanning just the direct dependencies, which misses most of the tree.

Try it yourself

Click through it at your own pace, or open it full screen.

Open a finding and look for the affected version, the fixed version and the dependency path.

Quick check

Do I need a paid tool to start?

No. Most package managers or open source scanners can give you a first list. A dedicated tool helps when you need history, policy and several repositories.

Why does my scan show findings in packages I never installed?

They are transitive. Another package you installed depends on them.

Safeguard scans manifests and lockfiles for dependency risk and can run reachability analysis on the results. A free scan is available.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.