Skip to content

Commit

Permalink
Fix for CVE corner case
Browse files Browse the repository at this point in the history
  • Loading branch information
bbossola committed Sep 15, 2024
1 parent 6c2daea commit 57e99b3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 104 deletions.
116 changes: 14 additions & 102 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions advisories.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,11 @@ def _getExternalVulnUrl(linkObj):
maybeUrl = linkObj["url"]
if maybeUrl.startswith("https") or maybeUrl.startswith("http"):
return maybeUrl
cve = linkObj["cve"] if "cve" in linkObj else maybeUrl
if linkObj["type"] == "CVE":
return "https://cve.mitre.org/cgi-bin/cvename.cgi?name=" + linkObj["cve"]
return "https://cve.mitre.org/cgi-bin/cvename.cgi?name=" + cve
if linkObj["type"] == "NVD":
return "https://nvd.nist.gov/vuln/detail/" + linkObj["cve"]
return "https://nvd.nist.gov/vuln/detail/" + cve

return None

Expand Down

0 comments on commit 57e99b3

Please sign in to comment.