-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Component.copyright should be escaped when serializing to XML #538
Comments
Please note that this issue is not as trivial as adding Even with it, the validation of the XML produced fails with:
This is because the CDATA section in XML must only contain valid XML characters : https://www.w3.org/TR/xml/#sec-cdata-sect. Therefore, an extra sanitization is also required. |
nnobelis
added a commit
to boschglobal/oss-review-toolkit
that referenced
this issue
Nov 20, 2024
Some characters in copyrights cannot be outputted to XML. Therefore, sanitize the copyrights content for XML. Please note that this is not optimal as this does the sanitization also for JSON output which is not required. Originally, it was intended to do a fix in the library upstream. Unfortunately, this is not trivial (see [1]). [1]: CycloneDX/cyclonedx-core-java#538 (comment) Signed-off-by: Nicolas Nobelis <nicolas.nobelis@bosch.com>
nnobelis
added a commit
to boschglobal/oss-review-toolkit
that referenced
this issue
Nov 20, 2024
Some characters in copyrights cannot be outputted to XML. Therefore, sanitize the copyrights content for XML. Please note that this is not optimal as this does the sanitization also for JSON output which is not required. Originally, it was intended to do a fix in the library upstream. Unfortunately, this is not trivial (see [1]). [1]: CycloneDX/cyclonedx-core-java#538 (comment) Signed-off-by: Nicolas Nobelis <nicolas.nobelis@bosch.com>
nnobelis
added a commit
to boschglobal/oss-review-toolkit
that referenced
this issue
Nov 20, 2024
Some characters in copyrights cannot be outputted to XML. Therefore, sanitize the copyrights content for XML. Please note that this is not optimal as this does the sanitization also for JSON output which is not required. Originally, it was intended to do a fix in the library upstream. Unfortunately, this is not trivial (see [1]). [1]: CycloneDX/cyclonedx-core-java#538 (comment) Signed-off-by: Nicolas Nobelis <nicolas.nobelis@bosch.com>
nnobelis
added a commit
to boschglobal/oss-review-toolkit
that referenced
this issue
Nov 20, 2024
Some characters in copyrights cannot be outputted to XML. Therefore, sanitize the copyrights content for XML. Please note that this is not optimal as this does the sanitization also for JSON output which is not required. Originally, it was intended to do a fix in the library upstream. Unfortunately, this is not trivial (see [1]). [1]: CycloneDX/cyclonedx-core-java#538 (comment) Signed-off-by: Nicolas Nobelis <nicolas.nobelis@bosch.com>
nnobelis
added a commit
to boschglobal/oss-review-toolkit
that referenced
this issue
Nov 20, 2024
Some characters in copyrights cannot be outputted to XML. Therefore, sanitize the copyrights content for XML. Please note that this is not optimal as this does the sanitization also for JSON output which is not required. Originally, it was intended to do a fix in the library upstream. Unfortunately, this is not trivial (see [1]). [1]: CycloneDX/cyclonedx-core-java#538 (comment) Signed-off-by: Nicolas Nobelis <nicolas.nobelis@bosch.com>
nnobelis
added a commit
to oss-review-toolkit/ort
that referenced
this issue
Nov 20, 2024
Some characters in copyrights cannot be outputted to XML. Therefore, sanitize the copyrights content for XML. Please note that this is not optimal as this does the sanitization also for JSON output which is not required. Originally, it was intended to do a fix in the library upstream. Unfortunately, this is not trivial (see [1]). [1]: CycloneDX/cyclonedx-core-java#538 (comment) Signed-off-by: Nicolas Nobelis <nicolas.nobelis@bosch.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We are running in an exception with cyclonedx-core-java version 9.1.0
When we try to generate a CycloneDXBOM in XML. This is the BOM in JSON:
The problem are the special characters in
component.copyright
.It seems the
component.evidence.copyright
is handled by a special serializerEvidenceSerializer
that wraps the copyright inCDATA
e.g.cyclonedx-core-java/src/test/resources/1.5/valid-evidence-1.5.xml
Line 27 in 6cfef32
Would it be possible to have the same handling for
component.copyright
?The text was updated successfully, but these errors were encountered: