You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] npm sbom emits duplicate entries in CycloneDX dependsOn / SPDX relationships when a node has multiple edges to the same name@version (incomplete fix for #6967) #9310
#6967 (PR #7992, shipped in 11.13.0) deduplicates top-level entries in components / dependencies (CycloneDX) and packages (SPDX) by name@version. However the per-node child arrays — CycloneDX dependsOn and
SPDX DEPENDENCY_OF relationships — are still emitted without deduplication.
This happens whenever a single node has multiple edgesOut resolving to the same name@version. The most common trigger is npm's package aliasing, where a package.json declares both a direct dependency and an alias
to the same underlying package:
toCyclonedxID returns ${packageName}@${version}, so two edges to the same package collapse to the same string and both end up in the array. The same shape exists in lib/utils/sbom-spdx.js for DEPENDENCY_OF
relationships.
CycloneDX 1.5 schema requires dependsOn arrays to have unique items, so downstream consumers that validate against the schema (e.g. Dependency Track) reject the SBOM:
$.dependencies[1557].dependsOn: must have only unique items in the array
Expected Behavior
Each dependsOn array (CycloneDX) and each set of DEPENDENCY_OF relationships from a single source (SPDX) contains a given name@version at most once.
Activity
iamstarkov commentedon May 5, 2026
can confirm the non compliance issue persists, as a workaround our shared setup-javascript action adjusts the sbom output a bit
fix(sbom): dedupe per-node dependsOn / relationships (npm#9311)