Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CycloneDX BOM validation fails when URLs contain %-encoded '[' and ']' characters - Reopen #4572

Open
2 tasks done
CPlusPlus17 opened this issue Jan 21, 2025 · 2 comments
Open
2 tasks done
Labels
defect Something isn't working pending more information

Comments

@CPlusPlus17
Copy link

Current Behavior

The fix #3831 is no longer in the 4.12.x branch.

Steps to Reproduce

See #3831

Expected Behavior

See #3831

Dependency-Track Version

4.12.2

Dependency-Track Distribution

Container Image

Database Server

Microsoft SQL Server

Database Server Version

N/A

Browser

Microsoft Edge

Checklist

@CPlusPlus17 CPlusPlus17 added defect Something isn't working in triage labels Jan 21, 2025
@nscuro
Copy link
Member

nscuro commented Jan 21, 2025

The fix is in the 4.12.x branch, and so is the test verifying it:

@Test // https://github.com/DependencyTrack/dependency-track/issues/3831
public void testValidateJsonWithUrlContainingEncodedBrackets() {
assertThatNoException()
.isThrownBy(() -> validator.validate("""
{
"bomFormat": "CycloneDX",
"specVersion": "1.5",
"components": [
{
"type": "library",
"name": "acme-library",
"externalReferences": [
{
"type": "website",
"url": "https://example.com/foo?bar=%5Bbaz%5D"
}
]
}
]
}
""".getBytes()));
}

What is the URL that fails validation for you, and what exactly does the validation error say?

@CPlusPlus17
Copy link
Author

Sorry took my a time to catch the sbom out of the CI/CD pipeline.

merged_final.json

Cook receipt:

docker sbom --format cyclonedx-json --output ta_container.json
dotnet-CycloneDX -o ccdx -j -f ta.json
cyclonedx-linux-x64 merge --input-files ./ccdx/ta.json ta_container.json --output-file merged_final.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Something isn't working pending more information
Projects
None yet
Development

No branches or pull requests

2 participants