Skip to content

Commit

Permalink
Handle zero scores from npm
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu committed Feb 25, 2024
1 parent 9486ed9 commit 5d9b5d4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vdb/lib/npm.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,10 @@ def to_vuln(self, v, ret_data):
)
cvss = v.get("cvss")
if cvss:
score = cvss.get("score")
vector_string = cvss.get("vectorString")
if cvss.get("score"):
score = cvss.get("score")
if cvss.get("vectorString"):
vector_string = cvss.get("vectorString")
exploitability_score = score
metadata = v.get("metadata", {})
if isinstance(metadata, dict) and metadata.get("exploitability"):
Expand Down

0 comments on commit 5d9b5d4

Please sign in to comment.