Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions dojo/tools/nancy/parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json

from cvss.cvss3 import CVSS3
from cvss.cvss4 import CVSS4

from dojo.models import Finding

Expand Down Expand Up @@ -64,17 +65,18 @@ def get_items(self, vulnerable, test):
out_of_scope=False,
static_finding=True,
dynamic_finding=False,
vuln_id_from_tool=associated_vuln["Id"],
vuln_id_from_tool=associated_vuln.get("Id", associated_vuln.get("ID")),
references="\n".join(references),
)

finding.unsaved_vulnerability_ids = vulnerability_ids

cvss_vector = associated_vuln["CvssVector"]
# CVSSv3 vector
if associated_vuln["CvssVector"]:
if cvss_vector and cvss_vector.startswith("CVSS:3."):
finding.cvssv3 = CVSS3(
associated_vuln["CvssVector"]).clean_vector()

elif cvss_vector and cvss_vector.startswith("CVSS:4."):
finding.cvssv4 = CVSS4(
associated_vuln["CvssVector"]).clean_vector()
# do we have a CWE?
if associated_vuln["Title"].startswith("CWE-"):
cwe = (associated_vuln["Title"]
Expand Down
Loading