Skip to content

Commit 5b70637

Browse files
cyclonedx scan: handle missing description (#13963)
1 parent ff53419 commit 5b70637

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

dojo/tools/cyclonedx/xml_parser.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,15 @@ def _manage_vulnerability_xml(
194194
"b:ratings/b:rating/b:severity", namespaces=ns,
195195
)
196196
severity = Cyclonedxhelper().fix_severity(severity)
197+
# by the schema, only id is mandatory, even the severity and description are
198+
# optional
199+
if not description:
200+
description = "\n".join(
201+
[
202+
f"**Id:** {vuln_id}",
203+
f"**Severity:** {severity}",
204+
],
205+
)
197206
references = ""
198207
for advisory in vulnerability.findall(
199208
"b:advisories/b:advisory", namespaces=ns,

0 commit comments

Comments
 (0)