Create Reports
-
Use the Report Builder to present customizable reports of Findings.
+
Use the Report Builder to present customizable reports of Findings.
diff --git a/docs/package-lock.json b/docs/package-lock.json
index 187c86624d8..254062bd28d 100644
--- a/docs/package-lock.json
+++ b/docs/package-lock.json
@@ -3636,16 +3636,15 @@
"license": "MIT"
},
"node_modules/nanoid": {
- "version": "3.3.7",
- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
- "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
+ "version": "3.3.8",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz",
+ "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
- "license": "MIT",
"bin": {
"nanoid": "bin/nanoid.cjs"
},
diff --git a/dojo/tools/osv_scanner/parser.py b/dojo/tools/osv_scanner/parser.py
index b79b4e6c5a2..e3ba3961340 100644
--- a/dojo/tools/osv_scanner/parser.py
+++ b/dojo/tools/osv_scanner/parser.py
@@ -37,18 +37,23 @@ def get_findings(self, file, test):
vulnerabilitydetails = vulnerability.get("details", "")
vulnerabilitypackagepurl = ""
cwe = None
+ mitigation = None
# Make sure we have an affected section to work with
if (affected := vulnerability.get("affected")) is not None:
if len(affected) > 0:
# Pull the package purl if present
if (vulnerabilitypackage := affected[0].get("package", "")) != "":
vulnerabilitypackagepurl = vulnerabilitypackage.get("purl", "")
- # Extract the CWE
if (cwe := affected[0].get("database_specific", {}).get("cwes", None)) is not None:
cwe = cwe[0]["cweId"]
- # Create some references
+ ranges = affected[0].get("ranges", [])
+ for range_item in ranges:
+ for event in range_item.get("events", []):
+ if "fixed" in event:
+ mitigation = f"Upgrade to version: {event['fixed']}"
+
reference = ""
- for ref in vulnerability.get("references"):
+ for ref in vulnerability.get("references", []):
reference += ref.get("url") + "\n"
# Define the description
description = vulnerabilitysummary + "\n"
@@ -56,6 +61,7 @@ def get_findings(self, file, test):
description += "**package_ecosystem**: " + package_ecosystem + "\n"
description += "**vulnerabilitydetails**: " + vulnerabilitydetails + "\n"
description += "**vulnerabilitypackagepurl**: " + vulnerabilitypackagepurl + "\n"
+
sev = vulnerability.get("database_specific", {}).get("severity", "")
finding = Finding(
title=vulnerabilityid + "_" + package_name,
@@ -70,8 +76,11 @@ def get_findings(self, file, test):
file_path=source_path,
references=reference,
)
+ if mitigation:
+ finding.mitigation = mitigation
if vulnerabilityid != "":
finding.unsaved_vulnerability_ids = []
finding.unsaved_vulnerability_ids.append(vulnerabilityid)
findings.append(finding)
return findings
+