Skip to content

sbominterop: merged-document link check passes when the merged CycloneDX has no serialNumber #497

Closed

Description

@bomly-guy

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,

if strings.TrimSpace(document.SerialNumber) == "" {
	return linkVerdict{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

  1. added theissue type on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions