Skip to content

Commit 8917680

Browse files
🎉 Add 'fix_available' field to zora parser (#13760)
* 🎉 Add 'fix_available' field to zora parser * ruff * review
1 parent 678bc65 commit 8917680

3 files changed

Lines changed: 20 additions & 5 deletions

File tree

dojo/tools/zora/parser.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ def get_findings(self, content, test: Test) -> list[Finding]:
4343
description += f"**Image**: {row.get('image')}\n"
4444
description += f"**ID**: {row.get('id')}\n"
4545
description += f"**Details**: {row.get('description')}\n"
46-
if row.get("fixVersion"):
47-
description += f"**Fix Version**: {row.get('fixVersion')}\n"
4846
mitigation = row.get("description", "")
4947
unique_id = f"{row.get('source')}-{row.get('image')}-{row.get('id')}"
5048
status = row.get("status", "").upper()
@@ -60,6 +58,11 @@ def get_findings(self, content, test: Test) -> list[Finding]:
6058
test=test,
6159
is_mitigated=is_mitigated,
6260
)
61+
if row.get("fixVersion"):
62+
finding.fix_available = True
63+
finding.fix_version = row.get("fixVersion")
64+
else:
65+
finding.fix_available = False
6366
vuln_id = row.get("id")
6467
if vuln_id:
6568
finding.unsaved_vulnerability_ids = [vuln_id]

unittests/scans/zora/scan_many.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public key verification failed by calling SSL_get_verify_result(), and those
2121
that do, and take appropriate action, are not affected. This issue was
2222
introduced in the initial implementation of RPK support in OpenSSL 3.2.
2323
24-
The FIPS modules in 3.4, 3.3, 3.2, 3.1 and 3.0 are not affected by this issue.","3.3.3-r0"
24+
The FIPS modules in 3.4, 3.3, 3.2, 3.1 and 3.0 are not affected by this issue.",""
2525
"Trivy","ghcr.io/undistro/popeye:0.21","CVE-2024-13176","openssl: Timing side-channel in ECDSA signature computation","MEDIUM","fixed","Issue summary: A timing side-channel which could potentially allow recovering
2626
the private key exists in the ECDSA signature computation.
2727
@@ -38,7 +38,7 @@ process must either be located in the same physical computer or must
3838
have a very fast network connection with low latency. For that reason
3939
the severity of this vulnerability is Low.
4040
41-
The FIPS modules in 3.4, 3.3, 3.2, 3.1 and 3.0 are affected by this issue.","3.3.2-r2"
41+
The FIPS modules in 3.4, 3.3, 3.2, 3.1 and 3.0 are affected by this issue.",
4242
"Trivy","ghcr.io/undistro/popeye:0.21","CVE-2025-9230","openssl: Out-of-bounds read & write in RFC 3211 KEK Unwrap","MEDIUM","fixed","Issue summary: An application trying to decrypt CMS messages encrypted using
4343
password based encryption can trigger an out-of-bounds read and write.
4444

unittests/tools/test_zora_parser.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,20 @@ def test_parse_file_with_many_vuln_has_many_findings(self):
1919
findings = parser.get_findings(content, Test())
2020
self.assertEqual(198, len(findings)) # Adjust based on your test file
2121
# Check a specific finding for correctness
22+
finding = findings[0]
23+
self.assertEqual(True, finding.fix_available)
24+
self.assertEqual("1.2.5-r1", finding.fix_version)
25+
finding = findings[1]
26+
self.assertEqual(False, finding.fix_available)
27+
self.assertEqual(None, finding.fix_version)
28+
finding = findings[2]
29+
self.assertEqual(False, finding.fix_available)
30+
self.assertEqual(None, finding.fix_version)
31+
finding = findings[3]
32+
self.assertEqual(True, finding.fix_available)
33+
self.assertEqual("3.3.5-r0", finding.fix_version)
2234
finding = findings[10]
2335
self.assertEqual("net/url: Insufficient validation of bracketed IPv6 hostnames in net/url", finding.title)
2436
self.assertEqual("Medium", finding.severity)
2537
self.assertTrue(finding.unique_id_from_tool.startswith(f"{finding.description.splitlines()[0].split(': ')[1]}"))
26-
self.assertIn("Fix Version", finding.description)
38+
self.assertEqual('**Source**: Trivy\n**Image**: ghcr.io/undistro/popeye:0.21\n**ID**: CVE-2025-47912\n**Details**: The Parse function permits values other than IPv6 addresses to be included in square brackets within the host component of a URL. RFC 3986 permits IPv6 addresses to be included within the host component, enclosed within square brackets. For example: "http://[::1]/". IPv4 addresses and hostnames must not appear within square brackets. Parse did not enforce this requirement.\n', finding.description)

0 commit comments

Comments
 (0)