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
sbominterop: merged-document link check passes when the merged CycloneDX has no serialNumber #497
Where:internal/assurance/sbominterop/main.go, evaluateMergedLinks (the final identity check, around line 444).
What was claimed (CodeRabbit, Minor, round four on #398 — past the review cap, so not fixed there): a merged CycloneDX document with an empty or absent serialNumber passes the check.
Verified against the code: true. The check fails only when serialNumber equals one of the source namespaces. An empty string is never in that set, so a merged document with no serial is reported as merged document links N source(s).
Why it matters: ADR-0042 says a merge of two or more sources "mints its own" identity. serialNumber is optional in CycloneDX, so the official validator will not object to its absence. If the SDK codec ever stopped minting the serial for a merge, this check — the only one that looks at merged identity — would stay green.
Not a current defect: today's merged export does carry its own serial (v0.28.1's sbom-interoperability check passed on a real merged document). This is a gap in what the check can catch, not wrong output.
Proposed fix: before the adoption check,
ifstrings.TrimSpace(document.SerialNumber) =="" {
returnlinkVerdict{detail: "merged document has no serialNumber of its own"}, nil
}
plus a test case and a seed in FuzzEvaluateMergedLinks.
Still to check: whether the same gap exists on the SPDX side — spdxNamespace rejects an empty documentNamespace for the source documents, but the merged SPDX document's own namespace is not compared against its sources at all.
Activity