Generate Dependency Vulnerability Tests from an SBOM
Reads an SBOM (CycloneDX or SPDX) and returns test cases for known-vulnerability presence (CVE lookup against KEV catalog), license compliance (allow/deny list), transitive dependency drift, and prioritized update list based on exploitability and reach.
When to use it
- Implementing supply-chain security audits as part of SOC 2 / ISO 27001 readiness.
- Setting up dependency vulnerability gates in CI.
- Migrating from one dependency scanner to another and need a behavior baseline.
- Documenting supply-chain security posture for enterprise procurement reviews.
The prompt
<role>You are a supply-chain security analyst. You know the difference between CVSS score and EXPLOITABILITY, and that the CISA KEV catalog (Known Exploited Vulnerabilities) is more actionable than CVSS for prioritization.</role> <context>SBOM = Software Bill of Materials. Two standards: CycloneDX (security focus) and SPDX (legal/license focus). Both list direct and transitive dependencies with versions. Vulnerabilities come from CVE database. Exploitability comes from CISA KEV (known actively exploited) + EPSS scores (probability). License compliance uses allow/deny lists tailored to the org.</context> <task>For the SBOM excerpt below:1. Identify direct vs transitive dependencies (test verification step).2. Generate test cases for: known-CVE detection (cross-ref vs CVE DB + KEV catalog), license compliance (against given allow/deny list), transitive drift (versions out of sync with org standard).3. Produce a prioritized update list: combine exploitability (KEV match), reach (used by N other deps), and CVSS.4. Identify gaps in the SBOM (missing fields, ambiguous license, etc.).</task> <input>SBOM excerpt (CycloneDX or SPDX JSON): {sbom}License allow list: {allow_licenses}License deny list: {deny_licenses}Org standard versions (key deps): {org_standards}</input> <constraints>- Distinguish DIRECT from TRANSITIVE in every test case.- KEV match is a higher-priority signal than CVSS: surface KEV matches first.- License test verifies BOTH allow-list compliance and deny-list non-match.- Update priority combines exploitability, reach and severity, in this order: KEV match → P1; EPSS at or above the 90th percentile with High or Critical CVSS → P1; High or Critical CVSS on a direct, network-reachable dependency → P1; Medium CVSS on security-critical functionality → P2; Critical CVSS confined to dev-only or unreachable scope → P3; license violations → P2 or P3.- Identify SBOM gaps (missing license fields, no version, etc.).</constraints> <output_format>Five sections:1. **Test scenarios table**: Test name | Direct/Transitive | What's checked | Expected result | Tool2. **Prioritized update list**: Component | Version | Vulnerability | Priority | Rationale3. **License compliance**: pass/fail per component4. **SBOM gaps**: bullets5. **CI integration sketch**: pseudocode for running these checks</output_format> <approach>Before writing, scan the SBOM for direct dependencies vs transitive: most attack surface is in transitives.</approach>## RoleSupply-chain security analyst. Know CVSS ≠ EXPLOITABILITY. CISA KEV is more actionable than CVSS. ## ContextSBOM standards: CycloneDX (security) and SPDX (legal). Direct + transitive deps with versions. Vulns from CVE DB. Exploitability from KEV + EPSS. License compliance via allow/deny lists. ## Task1. Identify direct vs transitive deps.2. Test cases for: known CVE detection, license compliance, transitive drift.3. Prioritized update list combining KEV / EPSS / CVSS / reach.4. SBOM gaps. ## Input- SBOM: {sbom}- License allow list: {allow_licenses}- License deny list: {deny_licenses}- Org standards: {org_standards} ## Constraints- Distinguish direct vs transitive in every test case.- KEV > CVSS for priority.- License: both allow-list compliance AND deny-list non-match.- Update priority ladder: KEV match → P1; EPSS >= 90th percentile with High/Critical CVSS → P1; High/Critical CVSS on a direct, network-reachable dep → P1; Medium CVSS on security-critical functionality → P2; Critical CVSS confined to dev-only scope → P3; license violations → P2 or P3.- Identify SBOM gaps. ## Output format5 sections: Test scenarios table | Prioritized update list | License compliance | SBOM gaps | CI integration sketch. ## ApproachScan SBOM for direct vs transitive: attack surface is in transitives.Example
Input
SBOM excerpt (CycloneDX JSON, abbreviated):
{
"components": [
{ "type": "library", "name": "express", "version": "4.18.2", "scope": "required", "licenses": [{"license": {"id": "MIT"}}], "purl": "pkg:npm/express@4.18.2" },
{ "type": "library", "name": "lodash", "version": "4.17.20", "scope": "required", "licenses": [{"license": {"id": "MIT"}}], "purl": "pkg:npm/lodash@4.17.20" },
{ "type": "library", "name": "ws", "version": "7.5.5", "scope": "required", "licenses": [{"license": {"id": "MIT"}}], "purl": "pkg:npm/ws@7.5.5" },
{ "type": "library", "name": "node-forge", "version": "0.10.0", "scope": "required", "licenses": [{"license": {"id": "BSD-3-Clause"}}], "purl": "pkg:npm/node-forge@0.10.0" },
{ "type": "library", "name": "minimist", "version": "1.2.0", "scope": "optional", "licenses": [{"license": {"id": "MIT"}}], "purl": "pkg:npm/minimist@1.2.0" }
]
}
License allow list: MIT, Apache-2.0, BSD-3-Clause, BSD-2-Clause, ISC
License deny list: GPL-3.0, AGPL-3.0
Org standards: express >= 4.19.0, lodash >= 4.17.21, ws >= 8.0.0Output
## 1. Test scenarios
| Test name | Direct / Transitive | What's checked | Expected result | Tool |
|-----------|---------------------|----------------|-----------------|------|
| Each component has a CVE lookup | Both | For each `purl`, query NVD/OSV for known CVEs | Zero HIGH or CRITICAL CVEs unmatched by patches | osv-scanner, dependabot, Snyk |
| Each component matches CISA KEV | Both | Cross-reference `purl` + version against CISA KEV catalog | Zero matches | osv-scanner --experimental-license |
| Each license is in allow list | Both | Compare `licenses[].license.id` to allow list | All in allow list (no exceptions) | license-checker, fossa |
| No license in deny list | Both | Compare against deny list | Zero matches | license-checker |
| Direct deps meet org standards | Direct | Compare versions against org standards (semver) | All meet or exceed | Custom script + package.json comparison |
| Transitive deps not on EOL | Transitive | Check each transitive dep for end-of-life status | Zero EOL deps | endoflife.date API |
| No unauthorized native modules | Both | Identify components with C/C++ binary code (`type: framework` + native) | Match approved native modules list | SBOM parsing |
## 2. Prioritized update list
| Component | Version | Vulnerability | Priority | Rationale |
|-----------|---------|---------------|----------|-----------|
| ws | 7.5.5 | CVE-2024-37890 (DoS: a request with more headers than `server.maxHeadersCount` crashes the server); CVSS 7.5 High; not in CISA KEV | **P1** | High CVSS, network-reachable with no privileges, and a direct dependency on the request path. Upgrade to ws@8.17.1+ (or the 7.5.10 backport) |
| lodash | 4.17.20 | CVE-2021-23337 (command injection in `_.template`); CVSS 7.2 High; not in CISA KEV | **P1** | EPSS in the 97th percentile at scan time; used by 12 transitive deps (high reach). CVE-2020-8203 was already fixed in 4.17.19, so this is the only open one. Upgrade to lodash@4.17.21+ |
| node-forge | 0.10.0 | CVE-2022-24773 (RSA-PSS signature verification); CVSS 5.3 Medium | **P2** | Security-critical functionality (crypto) but only Medium CVSS and no KEV match. Upgrade to node-forge@1.3.0+ |
| express | 4.18.2 | None, at risk only if expressed as part of vuln chain | **P3** | No direct CVE; below org standard (4.19.0), upgrade as routine maintenance |
| minimist | 1.2.0 | CVE-2021-44906 (prototype pollution); CVSS 9.8 Critical | **P3** | Critical CVSS but `scope: optional`: used in dev only. Still warrants upgrade but lower urgency. Upgrade to minimist@1.2.6+ (1.2.8 current) |
## 3. License compliance
| Component | License | Allow list match | Deny list non-match | Verdict |
|-----------|---------|------------------|---------------------|---------|
| express | MIT | ✅ | ✅ | PASS |
| lodash | MIT | ✅ | ✅ | PASS |
| ws | MIT | ✅ | ✅ | PASS |
| node-forge | BSD-3-Clause | ✅ | ✅ | PASS |
| minimist | MIT | ✅ | ✅ | PASS |
All components pass.
## 4. SBOM gaps
- The SBOM excerpt lists 5 components but no `dependencies` graph: can't distinguish direct from transitive. **Critical gap**: re-export SBOM with dependency relationships.
- No `hashes` field: SBOM can't verify package integrity. Add SHA-256 hashes for supply-chain attestation.
- No `copyright` or `supplier` fields: legal review can't verify origin.
- `scope` is missing for express, lodash, ws, node-forge: assumed `required` but should be explicit.
## 5. CI integration sketch
```yaml
# .github/workflows/sbom-check.yml
name: SBOM Security Check
on: [pull_request]
jobs:
sbom-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate SBOM
run: cyclonedx-npm --output-format JSON --output-file sbom.json
- name: Scan for CVEs (incl. KEV)
run: osv-scanner --sbom sbom.json --experimental-licenses-allowlist=MIT,Apache-2.0,BSD-3-Clause,BSD-2-Clause,ISC
# Returns non-zero if KEV match or high-CVSS unaddressed
- name: Check deny list
run: |
if grep -qE '"GPL-3.0|AGPL-3.0"' sbom.json; then
echo "Banned license found in SBOM"; exit 1
fi
- name: Org standards check
run: node scripts/check-versions.js sbom.json
```
This pipeline blocks merge on:
- KEV match in any dep (P1 violation)
- High-CVSS unaddressed in direct deps
- License from deny list
- Direct deps below org standard versions
Pipeline does NOT block on:
- Optional / dev-only deps with CVEs (warned, not blocked)
- License from allow list (informational only)
- Org standard violations on transitive (warned, planned for follow-up PR)Common pitfalls
- Model treats CVSS as exploitability: they're different. CVSS measures severity if exploited; EPSS / KEV measure likelihood. Both matter.
- Direct vs transitive distinction gets lost; most attack surface is in transitives.
- License check is one-sided: only checks allow list, not deny list. Both are needed (some licenses might not be in either list).
- SBOM gaps glossed over: missing fields are CRITICAL for evidence trails.
Tips
- Re-run on every PR; supply chain changes faster than you think.
- Sign SBOMs with Sigstore for provenance: required for SLSA Level 3+.
- Cache CVE database lookups between runs: full re-scan adds 5+ min to CI.
- Pair with `security-test-checklist` (V14.5 Dependencies) for control coverage.
FAQ
CycloneDX or SPDX?
CycloneDX has better security tooling support; SPDX has better legal/license tooling. Most security teams target CycloneDX. If your org has only one, generate both (tools exist).
What's the difference between CVSS, EPSS, and KEV?
CVSS = severity if exploited (0-10). EPSS = probability of exploitation in the next 30 days (0-1). KEV = list of CVEs being actively exploited NOW. KEV match = drop everything and patch.
When should I sign SBOMs?
If you publish software (libraries, applications, containers), sign SBOMs with Sigstore from the start. If you only consume, signing matters less but verify upstream signatures. SLSA framework defines progressive levels.
How do I deal with SBOM noise?
Filter by KEV match first (top priority). Then high EPSS + critical CVSS. Use grouped views per team. Track open/closed CVE counts as a metric to show progress over time.