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 <prabhu@appthreat.com>
  • Loading branch information
prabhu committed Feb 25, 2024
1 parent 3de8883 commit e4a6628
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "appthreat-vulnerability-db"
version = "5.6.2"
version = "5.6.3"
description = "AppThreat's vulnerability database and package search library with a built-in file based storage. OSV, CVE, GitHub, npm are the primary sources of vulnerabilities."
authors = [
{name = "Team AppThreat", email = "cloud@appthreat.com"},
Expand Down
6 changes: 4 additions & 2 deletions vdb/lib/npm.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ def to_vuln(self, v, ret_data):
)
cvss = v.get("cvss")
if cvss:
score = cvss.get("score")
vectorString = cvss.get("vectorString")
if cvss.get("score"):
score = cvss.get("score")
if cvss.get("vectorString"):
vectorString = cvss.get("vectorString")
exploitabilityScore = score
metadata = v.get("metadata", {})
if isinstance(metadata, dict) and metadata.get("exploitability"):
Expand Down

0 comments on commit e4a6628

Please sign in to comment.