Skip to content

Commit 15601cf

Browse files
authored
Merge pull request #3 from softrams/cvss-data
Update usage, addl cvss details
2 parents 34cbe9d + e39035e commit 15601cf

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

bin/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ async function checkCVSS(cveID) {
105105
}
106106

107107
const cvssScoreV31 = data.vulnerabilities[0].cve.metrics.cvssMetricV31;
108-
return cvssScoreV31 ? cvssScoreV31[0].cvssData : null;
108+
return cvssScoreV31 ? cvssScoreV31[0] : null;
109109
}
110110

111111
async function audit(
@@ -167,10 +167,12 @@ async function audit(
167167
if (!cvssScoreV31) {
168168
console.log(` No CVSS score found for CVE ${cveID}\n`);
169169
} else {
170-
const { baseScore, baseSeverity } = cvssScoreV31;
171-
console.log(` CVSS v3.1 Base Score: ${baseScore} (${baseSeverity})\n`);
170+
const { exploitabilityScore, impactScore } = cvssScoreV31;
171+
const { baseScore, baseSeverity } = cvssScoreV31.cvssData;
172+
console.log(` CVSS v3.1 Base Score: ${baseScore} (${baseSeverity})
173+
\n\t Exploitability Score: ${exploitabilityScore} Impact Score : ${impactScore} \n`);
172174

173-
// If CVSS score is above threshold, fail the audit
175+
// If CVSS score is above threshold, fail the audiat
174176
if (Number(score) > 0.0 && parseFloat(baseScore) > score) {
175177
console.warn(
176178
` CVSS v3.1 Base Score is above threshold of ${score}. Failing the audit.\n`
@@ -187,13 +189,13 @@ async function audit(
187189
const options = yargs
188190
.scriptName("cve-risk-scores")
189191
.usage(
190-
"Usage: $0 <CVE-NUMBER> [-v|--verbose] [-r|--refresh] [-f|--fail-on-past-duedate] [-t|--threshold]"
192+
"Usage: $0 <CVE-NUMBER> [-v|--verbose] [-r|--refresh] [-f|--fail-on-past-duedate] [-t|--threshold] [-s|--score] "
191193
)
192194
.option("v", {
193195
alias: "verbose",
194196
describe: "Verbose output",
195197
})
196-
.option("r", { alias: "refresh", describe: "Refresh EPSS scores" })
198+
.option("r", { alias: "refresh", describe: "Refresh EPSS, KEV data" })
197199
.option("f", {
198200
alias: "fail-on-past-duedate",
199201
describe: "Fail on past CISA KVE due date",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cve-risk-scores",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "Check risk scores for CVEs",
55
"main": "bin/index.js",
66
"bin": {

0 commit comments

Comments
 (0)