Skip to content

Commit

Permalink
npm use cvss attribute if present to extract the score (#93)
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
  • Loading branch information
prabhu authored Feb 11, 2024
1 parent df6750e commit 3de8883
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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.1"
version = "5.6.2"
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
5 changes: 5 additions & 0 deletions vdb/lib/npm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This module implements basic functionality to query npm registry for security advisories
"""

import logging

try:
Expand Down Expand Up @@ -206,6 +207,10 @@ def to_vuln(self, v, ret_data):
score, severity, vectorString, attackComplexity = get_default_cve_data(
severity
)
cvss = v.get("cvss")
if cvss:
score = cvss.get("score")
vectorString = cvss.get("vectorString")
exploitabilityScore = score
metadata = v.get("metadata", {})
if isinstance(metadata, dict) and metadata.get("exploitability"):
Expand Down

0 comments on commit 3de8883

Please sign in to comment.