When to Use This Skill
- Before any release to production — scan all dependencies for known CVEs
- When setting up CI/CD pipelines — integrate vulnerability scanning as a blocking gate
- After adding new dependencies — verify no known vulnerabilities or license conflicts
- During periodic security audits — quarterly dependency health check
- When a new critical CVE drops (Log4Shell, Spring4Shell) — rapid impact assessment
- Before enterprise customer onboarding — generate SBOM for procurement review
- When preparing for SOC 2, FedRAMP, ISO 27001, or PCI DSS compliance audits
- After a supply chain security incident — verify lockfile integrity and package provenance
- When evaluating a new third-party library — license and vulnerability pre-check
How It Works
┌──────────────────────────────────────────────────────────────────────────┐
│ DEPENDENCY VULNERABILITY SCAN FLOW │
│ │
│ ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ │
│ │ PHASE 1 │ │ PHASE 2 │ │ PHASE 3 │ │ PHASE 4 │ │
│ │ Dependency │─▶│ Vuln │─▶│ CVE │─▶│ SBOM │ │
│ │ Discovery │ │ Scanning │ │ Triage │ │ Generation│ │
│ └───────────┘ └───────────┘ └───────────┘ └───────────┘ │
│ Lockfiles npm audit CVSS scoring CycloneDX │
│ Manifests Snyk/Trivy Reachability SPDX │
│ Dep tree pip-audit Exploitability VEX │
│ Phantom deps cargo-audit Risk decision Distribution │
│ │ │ │
│ ▼ ▼ │
│ ┌───────────┐ ┌───────────┐ ┌───────────┐ │
│ │ PHASE 5 │ │ PHASE 6 │ │ PHASE 7 │ │
│ │ License │─▶│ Supply │ │ Patch Mgmt│ │
│ │ Compliance│ │ Chain │ │ & Report │ │
│ └───────────┘ └───────────┘ └───────────┘ │
│ License scan Typosquatting SLA tracking │
│ Copyleft det. Dep confusion Auto-update │
│ Compatibility Lockfile Breaking chg │
│ Policy enforce integrity 35+ checklist │
│ │
│ ┌──────────────────────────────────────────────────────────────┐ │
│ │ SEVERITY → SLA MAPPING │ │
│ │ CRITICAL (CVSS 9.0-10.0) → 24 hours — Pipeline blocks │ │
│ │ HIGH (CVSS 7.0-8.9) → 7 days — Sprint priority │ │
│ │ MEDIUM (CVSS 4.0-6.9) → 30 days — Scheduled patch │ │
│ │ LOW (CVSS 0.1-3.9) → 90 days — Next maintenance │ │
│ └──────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────────────┘
Phase 1 — Dependency Discovery
Map every dependency in the project — direct, transitive, dev, optional, peer, and phantom.
Scanning Layers
┌──────────────────────────────────────────────────────────────┐
│ DEPENDENCY DISCOVERY LAYERS │
│ │
│ Layer 1: Manifests (package.json, requirements.txt, etc.) │
│ │ │
│ ▼ │
│ Layer 2: Lockfiles — source of truth for exact versions │
│ (package-lock.json, yarn.lock, Pipfile.lock, etc.) │
│ │ │
│ ▼ │
│ Layer 3: Full Dependency Tree — transitive resolution │
│ (npm ls --all, pipdeptree, cargo tree, etc.) │
│ │ │
│ ▼ │
│ Layer 4: Container Images — OS packages + app deps │
│ (Trivy, Grype, Docker Scout) │
└──────────────────────────────────────────────────────────────┘
Discovery Checklist
Phase 2 — Vulnerability Scanning
Run vulnerability scanners against the full dependency tree using multiple data sources.
Scanner Configuration by Language
| Language | Primary Scanner | Secondary Scanner | Database Source | |
|---|
| JavaScript/Node | npm audit | Snyk CLI | GitHub Advisory DB, Snyk Intel | |
| Python | pip-audit | Safety, Snyk | PyPI Advisory DB, OSV | |
| Ruby | bundle-audit | Snyk | RubySec Advisory DB | |
| Go | govulncheck | Trivy | Go Vulnerability DB | |
| Rust | cargo-audit | Trivy | RustSec Advisory DB | |
| Java/Kotlin | OWASP Dep-Check | Snyk | NVD, OSS Index | |
| PHP | composer audit | Snyk | PHP Security Advisories | |
| Container Images | Trivy | Grype, Docker Scout | NVD, GHSA, vendor DBs | |
Key Scanning Commands
npm audit --audit-level=critical # JS/Node — CI gate: fail on critical
pip-audit --strict # Python — fail on any known vuln
govulncheck ./... # Go — reachability-aware scanning
cargo audit --json > cargo-audit.json # Rust
trivy fs --severity CRITICAL,HIGH --exit-code 1 . # Multi-language + containers
Scan Results — Fields to Capture
For each vulnerability: CVE ID, affected package, installed version, fixed version, CVSS score + vector, severity label, direct vs transitive, reachability (yes/no/unknown), exploit availability (Metasploit, PoC, in-the-wild), and EPSS score (exploitation probability in 30 days).
Phase 3 — CVE Triage and Risk Prioritization
Not all CVEs are equal. Triage based on exploitability, reachability, and business context.
CVSS Severity SLA Table
| Severity | CVSS Range | Patch SLA | CI Behavior | Escalation | |
|---|
| CRITICAL | 9.0 - 10.0 | 24 hours | Build fails, deploy blocked | Immediate notification to security lead | |
| HIGH | 7.0 - 8.9 | 7 days | Build warns, deploy allowed with override | Added to current sprint backlog | |
| MEDIUM | 4.0 - 6.9 | 30 days | Build warns, no deploy block | Scheduled in next maintenance window | |
| LOW | 0.1 - 3.9 | 90 days | Info only, no build impact | Bundled with regular dependency updates | |
Risk Decision Tree
┌──────────────────────────────────────────────────────────────┐
│ CVE TRIAGE DECISION TREE │
│ │
│ New CVE found in dependency │
│ │ │
│ ▼ │
│ Is it a direct dependency? │
│ ├── YES → Is the vulnerable function called in your code? │
│ │ ├── YES → CONFIRMED RISK ──▶ Patch per SLA │
│ │ └── NO → Check if input reaches the vuln path │
│ │ ├── YES → CONFIRMED RISK │
│ │ └── NO → REDUCED RISK (still patch) │
│ └── NO (transitive) │
│ │ │
│ ▼ │
│ Is the vulnerable code reachable via your direct dep? │
│ ├── YES → Same as direct — patch per SLA │
│ ├── NO → REDUCED RISK — patch within 2x SLA │
│ └── UNKNOWN → Assume YES — patch per standard SLA │
│ │
│ ADDITIONAL RISK FACTORS (escalate severity by one tier): │
│ • Exploit is public (PoC, Metasploit module) │
│ • Listed in CISA KEV catalog │
│ • EPSS score > 0.5 (50% exploitation probability) │
│ • Network-reachable attack vector (AV:N) │
│ • No authentication required (PR:N) │
│ • Package processes untrusted input (parsers, serializers)│
└──────────────────────────────────────────────────────────────┘
For each triaged vulnerability, document: CVE ID and package/version, CVSS score and vector, reachability determination, EPSS score and KEV status, risk decision (patch now / patch per SLA / accept), fixed version with breaking change assessment, remediation owner and target date.
Phase 4 — SBOM Generation
Generate a machine-readable inventory of every component in your software.
SBOM Formats
| Format | Standard Body | Use Case | Output | |
|---|
| CycloneDX | OWASP | Application security, VEX integration | JSON or XML | |
| SPDX | Linux Foundation | License compliance, legal review | JSON, RDF, or tag-value | |
NTIA Minimum Elements (required by EO 14028)
| Element | Description | Example | |
|---|
| Supplier Name | Who provides the component | lodash maintainers | |
| Component Name | Package name | lodash | |
| Component Version | Exact version | 4.17.21 | |
| Unique Identifier | PURL or CPE | pkg:npm/lodash@4.17.21 | |
| Dependency Relationship | Direct or transitive | direct | |
| Author of SBOM | Who generated it | CI pipeline (GitHub Actions) | |
| Timestamp | When SBOM was created | 2026-04-14T12:00:00Z | |
Generation Commands
npx @cyclonedx/cdxgen -o sbom.json --spec-version 1.5 # CycloneDX (auto-detect)
syft . -o spdx-json > sbom-spdx.json # SPDX via Syft
trivy fs --format cyclonedx --output sbom.json . # Trivy SBOM
SBOM Distribution Checklist
Phase 5 — License Compliance
Detect and enforce license policies to prevent legal risk.
License Compatibility Matrix
| License | Proprietary SaaS | Open Source (MIT) | Open Source (GPL) | SaaS (No Distribution) | |
|---|
| MIT | ALLOW | ALLOW | ALLOW | ALLOW | |
| Apache-2.0 | ALLOW | ALLOW | ALLOW (GPL-3.0 only) | ALLOW | |
| BSD-2-Clause | ALLOW | ALLOW | ALLOW | ALLOW | |
| BSD-3-Clause | ALLOW | ALLOW | ALLOW | ALLOW | |
| ISC | ALLOW | ALLOW | ALLOW | ALLOW | |
| 0BSD | ALLOW | ALLOW | ALLOW | ALLOW | |
| MPL-2.0 | REVIEW (file-level copyleft) | ALLOW | ALLOW | ALLOW | |
| LGPL-2.1 | REVIEW (dynamic linking OK) | ALLOW | ALLOW | REVIEW | |
| LGPL-3.0 | REVIEW (dynamic linking OK) | ALLOW | ALLOW | REVIEW | |
| GPL-2.0 | BLOCK (copyleft) | BLOCK | ALLOW | REVIEW (SaaS loophole) | |
| GPL-3.0 | BLOCK (copyleft) | BLOCK | ALLOW | REVIEW (SaaS loophole) | |
| AGPL-3.0 | BLOCK (network copyleft) | BLOCK | ALLOW | BLOCK (no SaaS loophole) | |
| SSPL | BLOCK | BLOCK | BLOCK | BLOCK | |
| EUPL-1.2 | BLOCK (copyleft) | REVIEW | ALLOW | REVIEW | |
| Unlicense | ALLOW (public domain) | ALLOW | ALLOW | ALLOW | |
| CC-BY-4.0 | ALLOW (attribution req) | ALLOW | ALLOW | ALLOW | |
| CC-BY-SA-4.0 | BLOCK (share-alike) | BLOCK | ALLOW | REVIEW | |
| No License | BLOCK (all rights reserved) | BLOCK | BLOCK | BLOCK | |
License Scanning Commands
npx license-checker --failOn "GPL-2.0;GPL-3.0;AGPL-3.0;SSPL" # Node.js
trivy fs --scanners license --format json --output license-report.json . # Multi-language
pip-licenses --fail-on="GNU General Public License v3 (GPLv3)" # Python
License Compliance Checklist
Phase 6 — Supply Chain Attack Prevention
Detect and prevent common dependency supply chain attack patterns.
Supply Chain Attack Patterns
| Attack Type | Description | Detection Method | |
|---|
| Typosquatting | Malicious package with a name similar to a popular one (lodahs vs lodash) | Package name similarity analysis, OpenSSF Package Analysis | |
| Dependency Confusion | Public package overwrites private package of the same name | Registry scoping (@org/pkg), .npmrc registry config | |
| Malicious Postinstall | Package runs arbitrary code during npm install via postinstall script | --ignore-scripts flag, script auditing | |
| Compromised Maintainer | Legitimate maintainer account hijacked, publishes malicious version | Version diff analysis, provenance verification (npm provenance, Sigstore) | |
| Star-jacking | Package claims popularity by referencing another project's GitHub repo | Cross-reference npm/GitHub ownership | |
| Protestware | Maintainer intentionally adds destructive code as political protest | Version diff analysis, behavioral monitoring | |
| Dependency Hijacking | Abandoned package name re-registered by attacker | Monitor for ownership changes on critical deps | |
| CI/CD Poisoning | Malicious code targets CI environment variables (secrets, tokens) | Sandbox CI builds, restrict env var access in install scripts | |
Prevention Checklist
Phase 7 — Patch Management and Remediation
Establish SLA-driven patching workflows with breaking change assessment.
Patch Priority Matrix
| Priority | Criteria | Action | Timeline | |
|---|
| P0 — Emergency | CVSS 9.0+, exploit in the wild, or in CISA KEV | Stop current work. Patch, test, deploy immediately | < 24 hours | |
| P1 — Urgent | CVSS 7.0-8.9, or CVSS 4.0+ with public exploit | Add to current sprint, prioritize above feature work | < 7 days | |
| P2 — Scheduled | CVSS 4.0-6.9, no known exploit | Schedule in next maintenance window | < 30 days | |
| P3 — Routine | CVSS 0.1-3.9, or vulnerability in dev-only dependency | Bundle with regular dependency update cycle | < 90 days | |
| P4 — Accept | Not reachable, dev-only, or mitigated by other controls | Document risk acceptance with justification | Review quarterly | |
Breaking Change Assessment
Before upgrading, evaluate by version bump type:
| Bump Type | Risk Level | Review Policy | Example | |
|---|
| PATCH (4.18.2 → 4.18.3) | Low | Auto-merge with passing CI | Bug fixes only | |
| MINOR (4.18.2 → 4.19.0) | Medium | Manual review required | New features, possible deprecations | |
| MAJOR (4.18.2 → 5.0.0) | High | Security team + dev review | Removed APIs, changed defaults, new runtime requirements | |
After upgrading: run unit tests (API contract changes), integration tests (behavior changes), E2E tests (runtime errors), and build (type/compilation errors). If tests fail on a security-critical patch, apply a workaround while fixing the breaking change.
Automated Updates
Configure Dependabot (
.github/dependabot.yml) or Renovate (
renovate.json) with:
- Weekly schedule for each package ecosystem and directory
- Group patch/minor updates together, separate major updates
- Auto-merge patches with passing CI, require review for minor/major
- Labels (
dependencies, security) and security team as reviewers
Phase 8 — CI Pipeline Integration
Configure vulnerability scanning as a mandatory CI gate. The CI workflow should:
- Trigger on PRs that modify dependency files (
package.json, lock, requirements.txt)
- Run weekly scheduled scans for newly disclosed CVEs
- Run
npm audit --audit-level=critical for each service directory
- Run Trivy filesystem scan with
--severity CRITICAL,HIGH --exit-code 1
- Run license checker with
--failOn "GPL-2.0;GPL-3.0;AGPL-3.0;SSPL"
- Generate and upload SBOM as build artifact on main branch merges
CI Gate Rules
| Check | Blocking? | Condition | |
|---|
| Critical CVE in direct dep | YES — build fails | CVSS >= 9.0 in production dependency | |
| Critical CVE in transitive dep | YES — build fails | CVSS >= 9.0, reachable or unknown reachability | |
| High CVE in direct dep | WARNING | CVSS 7.0-8.9, logged but does not block | |
| GPL/AGPL license detected | YES — build fails | Any copyleft license in production dependency tree | |
| No license detected | YES — build fails | Package has no license field or file | |
| Lockfile out of sync | YES — build fails | npm ci fails (lockfile doesn't match manifest) | |
| SBOM generation failed | YES — build fails | CycloneDX generation produces invalid output | |
| High CVE with public exploit | YES — build fails | CVSS 7.0+ AND exploit available AND EPSS > 0.3 | |
Phase 9 — Vulnerability Dashboard and Tracking
Track open vulnerabilities, SLA compliance, and dependency health trends.
Track each open vulnerability with: CVE ID, package, severity, CVSS, EPSS, discovery date, SLA deadline, status, and owner.
Dependency Health Metrics
| Metric | Target | Red Flag | |
|---|
| Open critical CVEs | 0 | Any > 0 for > 24 hours | |
| Open high CVEs | < 3 | Any > 7 days past SLA | |
| SLA compliance rate | > 95% | < 90% | |
| Median dependency age | < 12 months behind latest | > 24 months | |
| SBOM coverage | 100% of releases | < 100% | |
| License violations | 0 copyleft in production | Any | |
| MTTR (mean time to remediate) | Within SLA per severity | > 2x SLA | |
Dependency Vulnerability Checklist
Discovery
Vulnerability Scanning
CVE Triage
SBOM
License Compliance
Supply Chain Security
Patch Management & CI
Tips for Best Results
- Start with discovery — you cannot secure what you cannot see. Map every dependency before scanning.
- Scan lockfiles, not manifests —
package.json says ^4.18.0 but your lockfile says 4.18.2. The lockfile is what runs in production.
- Use multiple scanners — no single vulnerability database is complete. npm audit + Snyk or Trivy catches more than either alone.
- Reachability matters — a CVSS 9.8 CVE in code your application never calls is lower risk than a CVSS 7.0 in your hot path. Prioritize accordingly, but still patch both.
- Automate everything — manual dependency updates do not scale. Dependabot or Renovate PRs should be a weekly routine, not a quarterly fire drill.
- Track SLA compliance, not just vulnerability count — the metric that matters is "how fast do we patch?" not "how many vulns do we have right now?"
- License scanning is not optional — one AGPL dependency discovered during an enterprise deal can delay a contract by months. Scan proactively.
- Treat SBOM as a product deliverable — enterprise customers and government contracts increasingly require SBOMs. Build the pipeline now.
- Monitor for supply chain attacks actively — typosquatting and dependency confusion are not theoretical. Subscribe to OpenSSF Package Analysis and Socket.dev alerts.
- Keep the vulnerability window small — the time between CVE publication and your production patch is your exposure. Weekly automated updates keep this window under 7 days for most packages.