Skip to content

Qualys parser add CVEs to Vulnerability Ids for xml files#13710

Merged
rossops merged 3 commits intoDefectDojo:bugfixfrom
Jino-T:qualys-fix
Nov 17, 2025
Merged

Qualys parser add CVEs to Vulnerability Ids for xml files#13710
rossops merged 3 commits intoDefectDojo:bugfixfrom
Jino-T:qualys-fix

Conversation

@Jino-T
Copy link
Copy Markdown
Contributor

@Jino-T Jino-T commented Nov 14, 2025

[sc-12089]

While testing I discovered that the CSV parser already parses the CVE values into Vulnerabilty Ids so I only made changes to the xml parser.

PR Still needs Unittests

@Maffooch Maffooch requested a review from blakeaowens November 15, 2025 00:12
Copy link
Copy Markdown
Contributor

@mtesauro mtesauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

Comment thread dojo/tools/qualys/parser.py Outdated
Comment on lines +316 to +331
temp_cve_details = list(vuln_item.iterfind("CVE_ID_LIST/CVE_ID"))
if temp_cve_details:
cl = {
cve_detail.findtext("ID"): cve_detail.findtext("URL")
for cve_detail in temp_cve_details
}
temp["cve"] = "\n".join(list(cl.keys()))
temp["links"] = "\n".join(list(cl.values()))
cve_list = []
link_list = []
for cve_detail in temp_cve_details:
cve_id = cve_detail.findtext("ID")
cve_url = cve_detail.findtext("URL")
if cve_id:
cve_list.append(cve_id)
if cve_url:
link_list.append(cve_url)

temp["cve_list"] = cve_list # list of CVE strings
temp["links"] = "\n".join(link_list)
else:
temp["cve_list"] = []
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement to the parser. It doesn't intefere with dedupe as the vulnerability_ids are not part of the hash_code config.

Maybe nitpicking, but the (pre-existing) temp variable name feels a bit weird, could it just be cve_details?

If you want you can also simplify to the code using some python list features:

cve_data = [(cve.findtext("ID"), cve.findtext("URL")) 
            for cve in vuln_item.iterfind("CVE_ID_LIST/CVE_ID")]
cve_list = [cve_id for cve_id, _ in cve_data if cve_id]
link_list = [url for _, url in cve_data if url]

Copy link
Copy Markdown
Member

@valentijnscholten valentijnscholten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^

@rossops rossops merged commit 3096b0a into DefectDojo:bugfix Nov 17, 2025
150 checks passed
Maffooch pushed a commit to valentijnscholten/django-DefectDojo that referenced this pull request Feb 16, 2026
Qualys parser add CVEs to Vulnerability Ids for xml files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants