Skip to content

Commit 26cdfa5

Browse files
author
Heiko Stuebner
committed
fix: don't drop response field on CycloneDX VEX generation
As per https://cyclonedx.org/docs/1.6/json/#vulnerabilities_items_analysis_response the response field in CycloneDX is of type array and lib4sbom will silently drop it, if the type does not match. So add the full response array for CycloneDX files when generating VEX files. Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
1 parent a5b3224 commit 26cdfa5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

cve_bin_tool/vex_manager/generate.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,10 @@ def __get_vulnerabilities(self) -> list[Vulnerability]:
213213
if cve.justification:
214214
vulnerability.set_justification(cve.justification)
215215
if cve.response:
216-
vulnerability.set_value("remediation", cve.response[0])
216+
if self.vextype == "cyclonedx":
217+
vulnerability.set_value("remediation", cve.response)
218+
else:
219+
vulnerability.set_value("remediation", cve.response[0])
217220
detail = (
218221
f"{cve.remarks.name}: {cve.comments}"
219222
if cve.comments

0 commit comments

Comments
 (0)