Skip to content

Conversation

@saksham-malhotra-27
Copy link
Contributor

As mentioned in the issue #8837, BOM files in cyclonedx format created by npm-sbom contain an invalid statically UUID value in the serialNumber field: "serialNumber": "urn:uuid:***", because it was being redacted each time.

This change uses output.standard() with { [META]: true, redact: false } to bypass redaction for SBOM output, following the same pattern used in lib/commands/token.js for outputting authentication tokens that should not be redacted.

Before:

"serialNumber": "urn:uuid:***"

After:

"serialNumber": "urn:uuid:12345678-1234-1234-1234-123456789abc"
image

Testing

  • All existing tests pass
  • Verified locally that serialNumber now displays the complete UUID

References

Fixes #8837

@saksham-malhotra-27 saksham-malhotra-27 requested a review from a team as a code owner December 15, 2025 21:07
@wraithgar
Copy link
Member

It looks like because our fixture serial number is all 0's they weren't being redacted. If we update the test to use a real uuid then we can make sure it ends up in the snapshots unredacted.

@saksham-malhotra-27
Copy link
Contributor Author

saksham-malhotra-27 commented Dec 15, 2025

It looks like because our fixture serial number is all 0's they weren't being redacted. If we update the test to use a real uuid then we can make sure it ends up in the snapshots unredacted.

Yup, found it. Even after making it a random-
const FAKE_UUID = '12345678-90ab-cdef-1234-567890abcdef'

it totally works:
image

let me know if there's something else left. Thank you.

@wraithgar
Copy link
Member

wraithgar commented Dec 16, 2025

Great, thanks. That's a best effort there and we can land this now once CI is green. Thanks for fixing this.

@wraithgar wraithgar merged commit c2f784d into npm:latest Dec 16, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] sbom cyclonedx files contain invalid serialNumber

2 participants