cve-lite-cli 1.32.0 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -210,7 +210,7 @@ The closer a security tool is to a developer's natural workflow, the more likely
|
|
|
210
210
|
|
|
211
211
|
## How it compares
|
|
212
212
|
|
|
213
|
-
No other free tool combines all of the following: lockfile scanning across npm, pnpm, Yarn, and Bun; parent-aware transitive remediation that tells you which package to upgrade (not just which one is vulnerable); fix version validation before suggesting an upgrade; a fully offline advisory DB for restricted environments;
|
|
213
|
+
No other free tool combines all of the following: lockfile scanning across npm, pnpm, Yarn, and Bun; parent-aware transitive remediation that tells you which package to upgrade (not just which one is vulnerable); fix version validation before suggesting an upgrade; a fully offline advisory DB for restricted environments; CVE + license compliance scanning in a single pass; and an EPSS priority signal that combines CVSS severity with exploitation likelihood into four actionable tiers.
|
|
214
214
|
|
|
215
215
|
| Capability | CVE Lite CLI | npm audit | OSV-Scanner | Snyk CLI | Socket CLI |
|
|
216
216
|
|---|:---:|:---:|:---:|:---:|:---:|
|
|
@@ -232,6 +232,7 @@ No other free tool combines all of the following: lockfile scanning across npm,
|
|
|
232
232
|
| [Override hygiene auditing](https://owasp.org/cve-lite-cli/docs/override-hygiene) | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
233
233
|
| [Maintenance-risk detection (CVE-fix drag)](https://owasp.org/cve-lite-cli/docs/maintenance-risk) | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
234
234
|
| [License compliance scanning (copyleft / unknown)](https://owasp.org/cve-lite-cli/docs/cli-reference#license-scanning-options) | ✅ | ❌ | ❌ | ⚠️ | ⚠️ |
|
|
235
|
+
| [Priority signal: CVSS severity × EPSS exploitation likelihood](https://owasp.org/cve-lite-cli/docs/cli-reference#epss-priority-signal) | ✅ | ❌ | ❌ | ⚠️ | ❌ |
|
|
235
236
|
|
|
236
237
|
<sub>✅ = built-in strength · ⚠️ = partial or workflow-dependent · ❌ = not a core strength</sub>
|
|
237
238
|
|
|
@@ -7,6 +7,7 @@ import { getPrimaryParent, getRootDependencies } from "../utils/finding.js";
|
|
|
7
7
|
import { calculatePathCoverage, formatDependencyPath } from "../utils/path-coverage.js";
|
|
8
8
|
import { pluralize } from "../utils/string.js";
|
|
9
9
|
import { hasMaliciousAdvisory } from "../utils/vuln.js";
|
|
10
|
+
import { computePrioritySignal } from "../utils/priority-signal.js";
|
|
10
11
|
export function formatRelationshipLabel(value) {
|
|
11
12
|
if (value.startsWith("direct"))
|
|
12
13
|
return chalk.green(value);
|
|
@@ -242,6 +243,7 @@ export function serializeFinding(finding, plan) {
|
|
|
242
243
|
recommendedNpmTransitiveRemediation: finding.recommendedNpmTransitiveRemediation ?? null,
|
|
243
244
|
cves: finding.cveAliases,
|
|
244
245
|
epssScores: finding.epssScores ?? null,
|
|
246
|
+
prioritySignal: computePrioritySignal(finding.severity, finding.epssScores) ?? null,
|
|
245
247
|
dependencyPaths: finding.dependencyPaths,
|
|
246
248
|
usage: finding.usage ?? null,
|
|
247
249
|
maliciousUnverifiable: finding.maliciousUnverifiable ?? false,
|
|
@@ -253,6 +255,7 @@ export function serializeFinding(finding, plan) {
|
|
|
253
255
|
aliases: v.aliases ?? [],
|
|
254
256
|
summary: v.summary ?? "",
|
|
255
257
|
severity: inferSeverity(v),
|
|
258
|
+
cvssScore: (v.severity ?? []).find(s => s.type?.startsWith("CVSS"))?.score ?? null,
|
|
256
259
|
})),
|
|
257
260
|
};
|
|
258
261
|
}
|
|
@@ -10,6 +10,7 @@ import { hasMaliciousAdvisory } from "../utils/vuln.js";
|
|
|
10
10
|
import { renderOverrideFindingsHtml } from "./override-findings-html.js";
|
|
11
11
|
import { renderMaintenanceFindingsHtml } from "./maintenance-findings-html.js";
|
|
12
12
|
import { renderLicenseFindingsHtml } from "./license-findings-html.js";
|
|
13
|
+
import { PRIORITY_SIGNAL_LABELS, PRIORITY_SIGNAL_DESCRIPTIONS, PRIORITY_SIGNAL_LEGEND_DESCRIPTIONS } from "../utils/priority-signal.js";
|
|
13
14
|
import { UNVERIFIED_PARENT_UPGRADE_NOTE } from "../remediation/fix-commands.js";
|
|
14
15
|
import { getCompletenessImpact } from "../scan/completeness.js";
|
|
15
16
|
export function serializeHtmlFinding(finding, plan) {
|
|
@@ -210,7 +211,19 @@ button.header-link:hover{color:var(--link);border-color:var(--link)}
|
|
|
210
211
|
.maintenance-risk table tbody tr{border-bottom:1px solid var(--border-sub)}
|
|
211
212
|
.maintenance-risk table tbody tr:last-child{border-bottom:none}
|
|
212
213
|
.maintenance-risk table tbody tr:hover{background:var(--surface)}
|
|
213
|
-
.maintenance-risk table tbody td{padding:11px 14px;font-size:13px;color:var(--text);vertical-align:middle}
|
|
214
|
+
.maintenance-risk table tbody td{padding:11px 14px;font-size:13px;color:var(--text);vertical-align:middle}
|
|
215
|
+
.priority-badge{display:inline-flex;align-items:center;gap:4px;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.4px;padding:2px 7px;border-radius:4px;white-space:nowrap}
|
|
216
|
+
.priority-badge.fix-now{background:#f8514922;color:#f85149;border:1px solid #f8514966}
|
|
217
|
+
.priority-badge.fix-soon{background:#fb850022;color:#fb8500;border:1px solid #fb850066}
|
|
218
|
+
.priority-badge.monitor{background:#388bfd22;color:#388bfd;border:1px solid #388bfd66}
|
|
219
|
+
.priority-badge.low-priority{background:#8b949e22;color:#8b949e;border:1px solid #8b949e66}
|
|
220
|
+
.priority-none{font-size:11px;color:var(--text-3)}
|
|
221
|
+
.epss-val{font-size:11px;color:var(--text-2);font-family:monospace;white-space:nowrap;cursor:help;border-bottom:1px dotted var(--text-3)}
|
|
222
|
+
.epss-val.hot{color:#a371f7;border-bottom-color:#a371f7}
|
|
223
|
+
.priority-legend{background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:14px 18px;margin:0 32px 24px}
|
|
224
|
+
.priority-legend h4{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.4px;color:var(--text-2);margin-bottom:12px}
|
|
225
|
+
.priority-legend-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px}
|
|
226
|
+
.priority-legend-item{display:flex;align-items:flex-start;gap:10px;font-size:12px;color:var(--text-2);line-height:1.5}`;
|
|
214
227
|
export function renderHtmlReport(data) {
|
|
215
228
|
const projectName = path.basename(data.projectPath);
|
|
216
229
|
const scanDate = new Date(data.scannedAt).toLocaleString();
|
|
@@ -321,6 +334,8 @@ ${duplicatePackagesHtml}
|
|
|
321
334
|
<th onclick="sortBy('package')">Package <span class="sort-arrow">↕</span></th>
|
|
322
335
|
<th>Fix available</th>
|
|
323
336
|
<th onclick="sortBy('severity')" class="sorted">Severity <span class="sort-arrow" style="color:var(--link)">↓</span></th>
|
|
337
|
+
<th title="Exploit Prediction Scoring System - likelihood of exploitation in the next 30 days, relative to all CVEs (FIRST.org)">EPSS</th>
|
|
338
|
+
<th>EPSS Priority</th>
|
|
324
339
|
<th onclick="sortBy('relationship')">Type <span class="sort-arrow">↕</span></th>
|
|
325
340
|
<th>Root</th>
|
|
326
341
|
<th>CVE / Advisory</th>
|
|
@@ -328,9 +343,10 @@ ${duplicatePackagesHtml}
|
|
|
328
343
|
</thead>
|
|
329
344
|
<tbody id="findings-tbody">
|
|
330
345
|
${findingRowsHtml}
|
|
331
|
-
<tr id="no-results-row" style="display:none"><td colspan="
|
|
346
|
+
<tr id="no-results-row" style="display:none"><td colspan="9" class="no-results">No findings match your search.</td></tr>
|
|
332
347
|
</tbody>
|
|
333
348
|
</table>
|
|
349
|
+
${renderPriorityLegendHtml(data.findings)}
|
|
334
350
|
</div>
|
|
335
351
|
${renderOverrideFindingsHtml(data.overrideFindings, data.projectPath)}
|
|
336
352
|
${renderMaintenanceFindingsHtml(data.maintenanceFindings)}
|
|
@@ -489,15 +505,62 @@ function renderRelBadge(finding) {
|
|
|
489
505
|
}
|
|
490
506
|
return `<span class="rel-badge ${escapeHtml(finding.relationship)}">${escapeHtml(finding.relationship)}</span>`;
|
|
491
507
|
}
|
|
492
|
-
function
|
|
493
|
-
if (!
|
|
508
|
+
function renderPrioritySignalDetailHtml(priority, epssScores) {
|
|
509
|
+
if (!priority)
|
|
510
|
+
return "";
|
|
511
|
+
const label = PRIORITY_SIGNAL_LABELS[priority];
|
|
512
|
+
const desc = PRIORITY_SIGNAL_DESCRIPTIONS[priority];
|
|
513
|
+
const cssClass = priority.replace(/_/g, "-");
|
|
514
|
+
let epssLine = "";
|
|
515
|
+
if (epssScores && epssScores.length > 0) {
|
|
516
|
+
const best = epssScores.slice().sort((a, b) => b.percentile - a.percentile)[0];
|
|
517
|
+
const top = (1 - best.percentile) * 100;
|
|
518
|
+
const topStr = top < 0.01 ? "<0.01" : top < 1 ? top.toFixed(2) : top.toFixed(1);
|
|
519
|
+
epssLine = `<p style="font-size:12px;color:var(--text-3);margin-top:4px">${escapeHtml(best.cve)} - top ${topStr}% exploitation likelihood (EPSS: ${(best.epss * 100).toFixed(2)}%)</p>`;
|
|
520
|
+
}
|
|
521
|
+
return `<h4 class="detail-subheading">EPSS Priority Signal</h4>
|
|
522
|
+
<p><span class="priority-badge ${escapeHtml(cssClass)}">${escapeHtml(label)}</span> ${escapeHtml(desc)}</p>
|
|
523
|
+
${epssLine}`;
|
|
524
|
+
}
|
|
525
|
+
export function renderPriorityLegendHtml(findings) {
|
|
526
|
+
const hasEpss = findings.some(f => f.epssScores && f.epssScores.length > 0);
|
|
527
|
+
if (!hasEpss)
|
|
494
528
|
return "";
|
|
495
|
-
const
|
|
496
|
-
|
|
529
|
+
const items = [
|
|
530
|
+
{ signal: "fix_now", label: PRIORITY_SIGNAL_LABELS.fix_now, desc: PRIORITY_SIGNAL_LEGEND_DESCRIPTIONS.fix_now },
|
|
531
|
+
{ signal: "fix_soon", label: PRIORITY_SIGNAL_LABELS.fix_soon, desc: PRIORITY_SIGNAL_LEGEND_DESCRIPTIONS.fix_soon },
|
|
532
|
+
{ signal: "monitor", label: PRIORITY_SIGNAL_LABELS.monitor, desc: PRIORITY_SIGNAL_LEGEND_DESCRIPTIONS.monitor },
|
|
533
|
+
{ signal: "low_priority", label: PRIORITY_SIGNAL_LABELS.low_priority, desc: PRIORITY_SIGNAL_LEGEND_DESCRIPTIONS.low_priority },
|
|
534
|
+
];
|
|
535
|
+
const itemsHtml = items.map(({ signal, label, desc }) => {
|
|
536
|
+
const cssClass = signal.replace(/_/g, "-");
|
|
537
|
+
return `<div class="priority-legend-item"><span class="priority-badge ${escapeHtml(cssClass)}">${escapeHtml(label)}</span><span>${escapeHtml(desc)}</span></div>`;
|
|
538
|
+
}).join("\n");
|
|
539
|
+
return `<div class="priority-legend">
|
|
540
|
+
<h4>Priority Signal - severity x exploitation likelihood</h4>
|
|
541
|
+
<div class="priority-legend-grid">
|
|
542
|
+
${itemsHtml}
|
|
543
|
+
</div>
|
|
544
|
+
<p style="margin-top:10px;font-size:11px;color:var(--text-3)">EPSS = Exploit Prediction Scoring System (FIRST.org). "top X%" = this CVE is among the X% most likely to be exploited across all published CVEs. "-" is shown in the EPSS and EPSS Priority columns when EPSS data is unavailable for a finding.</p>
|
|
545
|
+
</div>`;
|
|
546
|
+
}
|
|
547
|
+
function renderEpssColumnHtml(epssScores) {
|
|
548
|
+
if (!epssScores || epssScores.length === 0)
|
|
549
|
+
return `<span class="priority-none">-</span>`;
|
|
550
|
+
const best = epssScores.slice().sort((a, b) => b.percentile - a.percentile)[0];
|
|
497
551
|
const top = (1 - best.percentile) * 100;
|
|
498
552
|
const topStr = top < 0.01 ? "<0.01" : top < 1 ? top.toFixed(2) : top.toFixed(1);
|
|
499
|
-
|
|
500
|
-
|
|
553
|
+
const isHot = best.percentile >= 0.90;
|
|
554
|
+
const hotClass = isHot ? " hot" : "";
|
|
555
|
+
const tooltip = `This CVE is more likely to be exploited than ${(best.percentile * 100).toFixed(0)}% of all published CVEs (EPSS score: ${(best.epss * 100).toFixed(2)}%)`;
|
|
556
|
+
return `<span class="epss-val${hotClass}" title="${escapeHtml(tooltip)}">top ${topStr}%</span>`;
|
|
557
|
+
}
|
|
558
|
+
function renderPriorityColumnHtml(priority) {
|
|
559
|
+
if (!priority)
|
|
560
|
+
return `<span class="priority-none">-</span>`;
|
|
561
|
+
const label = PRIORITY_SIGNAL_LABELS[priority];
|
|
562
|
+
const cssClass = priority.replace(/_/g, "-");
|
|
563
|
+
return `<span class="priority-badge ${escapeHtml(cssClass)}">${escapeHtml(label)}</span>`;
|
|
501
564
|
}
|
|
502
565
|
export function renderFindingRow(finding, idx, skippedKeys) {
|
|
503
566
|
const cveLinks = finding.cves.length > 0
|
|
@@ -539,17 +602,21 @@ export function renderFindingRow(finding, idx, skippedKeys) {
|
|
|
539
602
|
const rootDepsHtml = finding.rootDependencies.length > 0
|
|
540
603
|
? finding.rootDependencies.map(name => `<span class="root-dep">${escapeHtml(name)}</span>`).join(", ")
|
|
541
604
|
: `<span class="root-dep-none">-</span>`;
|
|
605
|
+
const epssHtml = renderEpssColumnHtml(finding.epssScores);
|
|
606
|
+
const priorityHtml = renderPriorityColumnHtml(finding.prioritySignal);
|
|
542
607
|
return `<tr id="row-${idx}" data-skipped="${isSkipped ? '1' : '0'}" onclick="toggleRow(${idx})">
|
|
543
608
|
<td><span class="expand-icon" id="icon-${idx}">▶</span></td>
|
|
544
609
|
<td><div class="pkg-name"><a href="https://www.npmjs.com/package/${encodeURIComponent(finding.package)}" target="_blank" rel="noopener noreferrer">${escapeHtml(finding.package)}</a></div><div class="pkg-version">${escapeHtml(finding.version)}</div></td>
|
|
545
610
|
<td>${fixHtml}</td>
|
|
546
611
|
<td><span class="sev-badge ${escapeHtml(finding.severity)}">${escapeHtml(finding.severity)}</span></td>
|
|
612
|
+
<td>${epssHtml}</td>
|
|
613
|
+
<td>${priorityHtml}</td>
|
|
547
614
|
<td>${renderRelBadge(finding)}</td>
|
|
548
615
|
<td>${rootDepsHtml}</td>
|
|
549
616
|
<td>${cveLinks}</td>
|
|
550
617
|
</tr>
|
|
551
618
|
<tr id="detail-${idx}" class="detail-row">
|
|
552
|
-
<td colspan="
|
|
619
|
+
<td colspan="9">
|
|
553
620
|
<div class="expanded-inner">
|
|
554
621
|
<div class="detail-col" style="max-width:320px">
|
|
555
622
|
<h4>Description</h4>
|
|
@@ -567,7 +634,7 @@ export function renderFindingRow(finding, idx, skippedKeys) {
|
|
|
567
634
|
<p>${escapeHtml(finding.riskSummary)}</p>
|
|
568
635
|
<h4 class="detail-subheading">Next action</h4>
|
|
569
636
|
<p>${escapeHtml(finding.nextAction)}</p>
|
|
570
|
-
${
|
|
637
|
+
${renderPrioritySignalDetailHtml(finding.prioritySignal, finding.epssScores)}
|
|
571
638
|
</div>
|
|
572
639
|
</div>
|
|
573
640
|
</td>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { aggregateMultiFolderCompleteness } from "../scan/completeness.js";
|
|
4
|
-
import { REPORT_STYLES, escapeHtml, openInBrowser, renderFindingRow, renderFixPlan, renderCompletenessBanner, serializeHtmlFinding, } from "./html-reporter.js";
|
|
4
|
+
import { REPORT_STYLES, escapeHtml, openInBrowser, renderFindingRow, renderFixPlan, renderCompletenessBanner, serializeHtmlFinding, renderPriorityLegendHtml, } from "./html-reporter.js";
|
|
5
5
|
import { renderOverrideFindingsHtml } from "./override-findings-html.js";
|
|
6
6
|
import { renderMaintenanceFindingsHtml } from "./maintenance-findings-html.js";
|
|
7
7
|
import { renderLicenseFindingsHtml } from "./license-findings-html.js";
|
|
@@ -79,7 +79,7 @@ function renderFolderSection(result, folderIdx, idxOffset, serialized, projectRo
|
|
|
79
79
|
? renderLicenseFindingsHtml(result.licenseFindings, { limitedToDirectOnly: result.licenseLimitedToDirectOnly })
|
|
80
80
|
: "";
|
|
81
81
|
const emptyRow = result.sorted.length === 0
|
|
82
|
-
? `<tr><td colspan="
|
|
82
|
+
? `<tr><td colspan="9" style="text-align:center;padding:24px;color:#8b949e">No findings</td></tr>`
|
|
83
83
|
: "";
|
|
84
84
|
return `
|
|
85
85
|
<details class="folder-section"${isOpen ? " open" : ""}>
|
|
@@ -114,6 +114,8 @@ function renderFolderSection(result, folderIdx, idxOffset, serialized, projectRo
|
|
|
114
114
|
<th onclick="sortBy('package',${fi})">Package <span class="sort-arrow">↕</span></th>
|
|
115
115
|
<th>Fix available</th>
|
|
116
116
|
<th onclick="sortBy('severity',${fi})" class="sorted">Severity <span class="sort-arrow" style="color:#58a6ff">↓</span></th>
|
|
117
|
+
<th title="Exploit Prediction Scoring System - likelihood of exploitation in the next 30 days, relative to all CVEs (FIRST.org)">EPSS</th>
|
|
118
|
+
<th>EPSS Priority</th>
|
|
117
119
|
<th onclick="sortBy('relationship',${fi})">Type <span class="sort-arrow">↕</span></th>
|
|
118
120
|
<th>Root</th>
|
|
119
121
|
<th>CVE / Advisory</th>
|
|
@@ -121,7 +123,7 @@ function renderFolderSection(result, folderIdx, idxOffset, serialized, projectRo
|
|
|
121
123
|
</thead>
|
|
122
124
|
<tbody id="findings-tbody-${fi}" data-offset="${idxOffset}">
|
|
123
125
|
${emptyRow}${findingRowsHtml}
|
|
124
|
-
<tr id="no-results-row-${fi}" style="display:none"><td colspan="
|
|
126
|
+
<tr id="no-results-row-${fi}" style="display:none"><td colspan="9" class="no-results">No findings match your search.</td></tr>
|
|
125
127
|
</tbody>
|
|
126
128
|
</table>
|
|
127
129
|
</div>
|
|
@@ -239,6 +241,8 @@ ${aggregateBannerHtml}
|
|
|
239
241
|
|
|
240
242
|
${folderSectionsHtml}
|
|
241
243
|
|
|
244
|
+
${renderPriorityLegendHtml(reportData.findings)}
|
|
245
|
+
|
|
242
246
|
<div class="report-footer">
|
|
243
247
|
<span>Generated by <strong>cve-lite v${escapeHtml(params.cliVersion)}</strong></span>
|
|
244
248
|
<span>${folderCount} ${pluralize(folderCount, "folder")} · ${totalFindings} findings · ${totalCVEs} CVEs</span>
|
package/dist/output/printers.js
CHANGED
|
@@ -7,6 +7,7 @@ import { formatSeverityLabel } from "../utils/severity.js";
|
|
|
7
7
|
import { pluralize } from "../utils/string.js";
|
|
8
8
|
import { hasMaliciousAdvisory } from "../utils/vuln.js";
|
|
9
9
|
import { selectFindingsForCompact } from "./finding-display.js";
|
|
10
|
+
import { computePrioritySignal, PRIORITY_SIGNAL_LABELS, PRIORITY_SIGNAL_TABLE_LABELS, PRIORITY_SIGNAL_DESCRIPTIONS } from "../utils/priority-signal.js";
|
|
10
11
|
import { renderLicenseFindings } from "./license-terminal.js";
|
|
11
12
|
import { getCompletenessImpact } from "../scan/completeness.js";
|
|
12
13
|
import { MAL_PRIVATE_REGISTRY_COMPACT_MESSAGE, MAL_PRIVATE_REGISTRY_LEGEND_MESSAGE, MAL_GIT_SOURCE_PINNED_MESSAGE, MAL_GIT_SOURCE_FLOATING_MESSAGE, MAL_GIT_SOURCE_COMPACT_MESSAGE, MAL_GIT_SOURCE_LEGEND_MESSAGE, MAL_GIT_SOURCE_PINNED_DISPLAY, MAL_GIT_SOURCE_FLOATING_DISPLAY, OVERRIDES_COMMAND, } from "../constants.js";
|
|
@@ -21,7 +22,8 @@ export function printSummary(findings, packageCount, scanInput) {
|
|
|
21
22
|
return;
|
|
22
23
|
}
|
|
23
24
|
const totalCVEs = countUniqueAdvisories(findings);
|
|
24
|
-
const
|
|
25
|
+
const uniquePkgCount = new Set(findings.map(f => `${f.pkg.name}@${f.pkg.version}`)).size;
|
|
26
|
+
const pkgLabel = uniquePkgCount === 1 ? "package" : "packages";
|
|
25
27
|
const cveLabel = totalCVEs === 1 ? "CVE" : "CVEs";
|
|
26
28
|
const counts = {
|
|
27
29
|
critical: findings.filter(f => f.severity === "critical").length,
|
|
@@ -30,7 +32,7 @@ export function printSummary(findings, packageCount, scanInput) {
|
|
|
30
32
|
low: findings.filter(f => f.severity === "low").length,
|
|
31
33
|
unknown: findings.filter(f => f.severity === "unknown").length
|
|
32
34
|
};
|
|
33
|
-
console.log(chalk.redBright(`✗ Found ${
|
|
35
|
+
console.log(chalk.redBright(`✗ Found ${uniquePkgCount} ${pkgLabel} (${totalCVEs} ${cveLabel}) with known OSV matches from ${scanInput.source}`));
|
|
34
36
|
console.log(renderSeverityTable(counts));
|
|
35
37
|
}
|
|
36
38
|
export function printActionSummary(findings, overrideCount = 0, packageManager) {
|
|
@@ -193,8 +195,21 @@ export function printSkippedDependencies(skipped) {
|
|
|
193
195
|
console.log(`${chalk.yellow("•")} ...and ${skipped.length - 10} more`);
|
|
194
196
|
}
|
|
195
197
|
}
|
|
198
|
+
function formatPrioritySignal(signal) {
|
|
199
|
+
if (!signal)
|
|
200
|
+
return chalk.gray("-");
|
|
201
|
+
const label = PRIORITY_SIGNAL_TABLE_LABELS[signal];
|
|
202
|
+
if (signal === "fix_now")
|
|
203
|
+
return chalk.red(label);
|
|
204
|
+
if (signal === "fix_soon")
|
|
205
|
+
return chalk.yellow(label);
|
|
206
|
+
if (signal === "monitor")
|
|
207
|
+
return chalk.blue(label);
|
|
208
|
+
return chalk.gray(label);
|
|
209
|
+
}
|
|
196
210
|
export function printTable(findings, threshold, skippedKeys) {
|
|
197
|
-
const headers = ["Package", "Version", "Severity", "Type", "Root", "Usage", "Fixed", "EPSS", "IDs"];
|
|
211
|
+
const headers = ["Package", "Version", "Severity", "Type", "Root", "Usage", "Fixed", "EPSS", "EPSS Priority", "IDs"];
|
|
212
|
+
const rowSignals = [];
|
|
198
213
|
const rawRows = findings.map(f => {
|
|
199
214
|
let usageText = "n/a";
|
|
200
215
|
if (f.usage) {
|
|
@@ -222,10 +237,14 @@ export function printTable(findings, threshold, skippedKeys) {
|
|
|
222
237
|
fixedDisplay = chalk.yellow("⚠ no fix");
|
|
223
238
|
}
|
|
224
239
|
let epssDisplay = "-";
|
|
240
|
+
let signal = null;
|
|
225
241
|
if (f.epssScores && f.epssScores.length > 0) {
|
|
226
|
-
const best = f.epssScores.slice().sort((a, b) => b.
|
|
242
|
+
const best = f.epssScores.slice().sort((a, b) => b.percentile - a.percentile)[0];
|
|
227
243
|
epssDisplay = `${(best.epss * 100).toFixed(1)}%`;
|
|
244
|
+
signal = computePrioritySignal(f.severity, f.epssScores);
|
|
228
245
|
}
|
|
246
|
+
rowSignals.push(signal);
|
|
247
|
+
const priorityDisplay = signal ? PRIORITY_SIGNAL_TABLE_LABELS[signal] : "-";
|
|
229
248
|
return [
|
|
230
249
|
f.pkg.name,
|
|
231
250
|
f.pkg.version,
|
|
@@ -235,6 +254,7 @@ export function printTable(findings, threshold, skippedKeys) {
|
|
|
235
254
|
usageText,
|
|
236
255
|
fixedDisplay,
|
|
237
256
|
epssDisplay,
|
|
257
|
+
priorityDisplay,
|
|
238
258
|
f.vulnerabilities.map(v => v.id).join(", ")
|
|
239
259
|
];
|
|
240
260
|
});
|
|
@@ -247,7 +267,7 @@ export function printTable(findings, threshold, skippedKeys) {
|
|
|
247
267
|
console.log(line("┌", "┬", "┐"));
|
|
248
268
|
console.log(renderRow(headers, widths));
|
|
249
269
|
console.log(line("├", "┼", "┤"));
|
|
250
|
-
|
|
270
|
+
rawRows.forEach((row, idx) => {
|
|
251
271
|
let usageDecorated = String(row[5]);
|
|
252
272
|
if (usageDecorated.includes("file(s)"))
|
|
253
273
|
usageDecorated = chalk.red(usageDecorated);
|
|
@@ -264,10 +284,11 @@ export function printTable(findings, threshold, skippedKeys) {
|
|
|
264
284
|
usageDecorated,
|
|
265
285
|
row[6],
|
|
266
286
|
chalk.gray(String(row[7])),
|
|
267
|
-
|
|
287
|
+
formatPrioritySignal(rowSignals[idx] ?? null),
|
|
288
|
+
row[9],
|
|
268
289
|
];
|
|
269
290
|
console.log(renderRow(decorated, widths));
|
|
270
|
-
}
|
|
291
|
+
});
|
|
271
292
|
console.log(line("└", "┴", "┘"));
|
|
272
293
|
const maliciousFindings = findings.filter(f => hasMaliciousAdvisory(f.vulnerabilities));
|
|
273
294
|
if (maliciousFindings.length > 0) {
|
|
@@ -442,11 +463,15 @@ export function printCompactOutput(findings, scanInput, options) {
|
|
|
442
463
|
console.log(`${formatSeverityLabel(sevLabel)} ${chalk.whiteBright(finding.pkg.name)}@${finding.pkg.version}`);
|
|
443
464
|
console.log(` ${typeLabel}${usageContext}`);
|
|
444
465
|
if (finding.epssScores && finding.epssScores.length > 0) {
|
|
445
|
-
const best = finding.epssScores.slice().sort((a, b) => b.
|
|
466
|
+
const best = finding.epssScores.slice().sort((a, b) => b.percentile - a.percentile)[0];
|
|
446
467
|
const pct = (best.epss * 100).toFixed(1);
|
|
447
468
|
const top = ((1 - best.percentile) * 100);
|
|
448
469
|
const topStr = top < 0.01 ? "<0.01" : top < 1 ? top.toFixed(2) : top.toFixed(1);
|
|
449
470
|
console.log(` ${chalk.gray(`EPSS: ${pct}% exploitation probability - ${best.cve} (top ${topStr}% of all CVEs)`)}`);
|
|
471
|
+
const priority = computePrioritySignal(finding.severity, finding.epssScores);
|
|
472
|
+
if (priority === "fix_now") {
|
|
473
|
+
console.log(` ${chalk.red(PRIORITY_SIGNAL_LABELS.fix_now)} - ${PRIORITY_SIGNAL_DESCRIPTIONS[priority]}`);
|
|
474
|
+
}
|
|
450
475
|
}
|
|
451
476
|
const isMalicious = hasMaliciousAdvisory(finding.vulnerabilities);
|
|
452
477
|
if (isMalicious) {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const EPSS_HIGH_EXPLOITATION_THRESHOLD = 0.90;
|
|
2
|
+
export const PRIORITY_SIGNAL_LABELS = {
|
|
3
|
+
fix_now: "⚡ Fix Now",
|
|
4
|
+
fix_soon: "Fix Soon",
|
|
5
|
+
monitor: "Monitor",
|
|
6
|
+
low_priority: "Low Priority",
|
|
7
|
+
};
|
|
8
|
+
// Emoji-free labels for fixed-width table columns (⚡ is 2-wide in terminals but 1 in JS string.length, breaking padEnd alignment)
|
|
9
|
+
export const PRIORITY_SIGNAL_TABLE_LABELS = {
|
|
10
|
+
fix_now: "Fix Now",
|
|
11
|
+
fix_soon: "Fix Soon",
|
|
12
|
+
monitor: "Monitor",
|
|
13
|
+
low_priority: "Low Priority",
|
|
14
|
+
};
|
|
15
|
+
export const PRIORITY_SIGNAL_DESCRIPTIONS = {
|
|
16
|
+
fix_now: "Critical or high severity + top 10% EPSS exploitation likelihood",
|
|
17
|
+
fix_soon: "Critical or high severity, EPSS not top 10%",
|
|
18
|
+
monitor: "Medium or lower severity, EPSS top 10% - watch closely",
|
|
19
|
+
low_priority: "Medium or lower severity, EPSS not top 10%",
|
|
20
|
+
};
|
|
21
|
+
export const PRIORITY_SIGNAL_LEGEND_DESCRIPTIONS = {
|
|
22
|
+
fix_now: "Critical or high severity and EPSS top 10% - high impact, actively exploited class of CVE",
|
|
23
|
+
fix_soon: "Critical or high severity, EPSS not top 10% - high impact but exploitation is less common",
|
|
24
|
+
monitor: "Medium or lower, EPSS top 10% - lower impact but exploitation is active",
|
|
25
|
+
low_priority: "Medium or lower, EPSS not top 10% - address in normal maintenance cycle",
|
|
26
|
+
};
|
|
27
|
+
export function computePrioritySignal(severity, epssScores) {
|
|
28
|
+
if (!epssScores || epssScores.length === 0)
|
|
29
|
+
return null;
|
|
30
|
+
const highImpact = severity === "critical" || severity === "high";
|
|
31
|
+
const maxPercentile = Math.max(...epssScores.map(e => e.percentile));
|
|
32
|
+
const highExploitation = maxPercentile >= EPSS_HIGH_EXPLOITATION_THRESHOLD;
|
|
33
|
+
if (highImpact && highExploitation)
|
|
34
|
+
return "fix_now";
|
|
35
|
+
if (highImpact)
|
|
36
|
+
return "fix_soon";
|
|
37
|
+
if (highExploitation)
|
|
38
|
+
return "monitor";
|
|
39
|
+
return "low_priority";
|
|
40
|
+
}
|