vigievuln 1.2.0 → 1.3.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/CHANGELOG.md +23 -2
- package/README.md +13 -7
- package/lib/advisory-freshness.js +2 -0
- package/lib/airgap-project.js +35 -7
- package/lib/applicability-evidence.js +12 -0
- package/lib/artifacts/applications.js +54 -0
- package/lib/artifacts/cve-view.js +108 -0
- package/lib/artifacts/enrichment.js +86 -0
- package/lib/artifacts/go-main-identity.js +45 -0
- package/lib/artifacts/go-publisher-advisories.js +24 -0
- package/lib/artifacts/index.js +272 -0
- package/lib/artifacts/publisher-advisories.js +12 -0
- package/lib/artifacts/remediation-report.js +48 -0
- package/lib/artifacts/report-inventory.js +26 -0
- package/lib/artifacts/report.js +191 -0
- package/lib/artifacts/risk-report.js +120 -0
- package/lib/artifacts/sbom.js +68 -0
- package/lib/artifacts/scan.js +401 -0
- package/lib/cache-archive-sqlite.js +41 -25
- package/lib/certs/analyze.js +49 -13
- package/lib/charts.js +124 -32
- package/lib/cli-command-routing.js +20 -6
- package/lib/cli-groups.js +2 -1
- package/lib/cli-image.js +206 -0
- package/lib/codecs/binary/elf-metadata.js +42 -0
- package/lib/codecs/binary/go-buildinfo.js +37 -0
- package/lib/codecs/binary/metadata.js +7 -0
- package/lib/codecs/binary/pe-metadata.js +27 -1
- package/lib/codecs/binary/scan.js +44 -26
- package/lib/codecs/binary/sniff.js +16 -15
- package/lib/codecs/binary.codec.js +27 -4
- package/lib/codecs/go/parse.js +10 -4
- package/lib/codecs/go.codec.js +23 -6
- package/lib/codecs/gradle/parse.js +63 -2
- package/lib/codecs/gradle/versionless.js +175 -0
- package/lib/codecs/gradle.codec.js +20 -3
- package/lib/codecs/index.js +2 -2
- package/lib/codecs/maven.codec.js +9 -4
- package/lib/codecs/npm/collect.js +6 -11
- package/lib/codecs/nuget/parse.js +16 -5
- package/lib/codecs/nuget.codec.js +2 -1
- package/lib/codecs/pypi/parse.js +56 -15
- package/lib/codecs/pypi.codec.js +2 -0
- package/lib/csaf-export.js +46 -11
- package/lib/cve-download.js +33 -29
- package/lib/cve-match.js +10 -0
- package/lib/cve-packages-proxy.js +19 -0
- package/lib/cve-report.js +273 -165
- package/lib/deps-descriptor.js +25 -3
- package/lib/diagnostics.js +12 -0
- package/lib/diff.js +0 -0
- package/lib/epss.js +6 -6
- package/lib/euvd.js +34 -4
- package/lib/finding-enrichment.js +165 -0
- package/lib/finding-summary.js +4 -3
- package/lib/i18n.js +35 -9
- package/lib/image-network.js +54 -0
- package/lib/image-references.js +203 -0
- package/lib/image-registry.js +385 -0
- package/lib/image-update.js +39 -0
- package/lib/json-export.js +100 -10
- package/lib/kev.js +6 -6
- package/lib/maven-bom.js +2 -1
- package/lib/merge-sources.js +3 -0
- package/lib/native-advisories.js +9 -7
- package/lib/native-cna-identities.js +12 -0
- package/lib/native-package-match.js +159 -0
- package/lib/native-source-prepare.js +60 -0
- package/lib/nvd.js +34 -23
- package/lib/osv.js +33 -14
- package/lib/project-descriptor.js +3 -2
- package/lib/provenance.js +8 -2
- package/lib/providers/alpine.js +8 -0
- package/lib/providers/common.js +11 -3
- package/lib/providers/debian.js +11 -0
- package/lib/providers/euvd.js +2 -1
- package/lib/providers/freexian.js +13 -0
- package/lib/providers/github.js +1 -0
- package/lib/providers/go.js +2 -1
- package/lib/providers/index.js +18 -14
- package/lib/providers/nginx.js +5 -0
- package/lib/providers/nvd.js +1 -1
- package/lib/providers/osv.js +1 -1
- package/lib/providers/osvdb.js +2 -2
- package/lib/proxy-throttle.js +89 -29
- package/lib/purl.js +10 -2
- package/lib/record-freshness.js +22 -0
- package/lib/report-notices.js +47 -0
- package/lib/report-time.js +45 -0
- package/lib/request-failure.js +22 -0
- package/lib/resource-cache/engine.js +130 -26
- package/lib/resource-cache/snapshot-projection.js +33 -0
- package/lib/resource-cache/validate.js +22 -5
- package/lib/risk-evidence.js +18 -0
- package/lib/sarif-export.js +17 -9
- package/lib/sbom-export.js +38 -12
- package/lib/source-health.js +25 -8
- package/lib/source-image-scan.js +57 -0
- package/lib/source-profile.js +6 -3
- package/lib/sqlite-driver.js +15 -1
- package/lib/suppress.js +34 -13
- package/lib/system-inventory/advisories.js +169 -0
- package/lib/system-inventory/alpine-tracker.js +47 -0
- package/lib/system-inventory/collect.js +118 -0
- package/lib/system-inventory/current-debian.js +99 -0
- package/lib/system-inventory/distribution-sources.js +132 -0
- package/lib/system-inventory/freexian-ela.js +32 -0
- package/lib/system-inventory/freexian-release-evidence.js +35 -0
- package/lib/system-inventory/freexian-tracker.js +72 -0
- package/lib/system-inventory/historical-debian.js +196 -0
- package/lib/system-inventory/index.js +2 -0
- package/lib/system-inventory/nginx-advisories.js +39 -0
- package/lib/system-inventory/rpm-storage.js +86 -0
- package/lib/system-inventory/targeted.js +70 -0
- package/lib/system-inventory/versions.js +59 -0
- package/lib/transitive.js +11 -2
- package/lib/ui.js +8 -5
- package/lib/unmanaged.js +1 -1
- package/lib/xlsx-export.js +8 -2
- package/package.json +12 -3
- package/vigievuln.js +279 -127
package/lib/cve-report.js
CHANGED
|
@@ -15,6 +15,7 @@ const { computePriority, sortByPriority } = require("./priority");
|
|
|
15
15
|
const { buildInventory } = require("./unmanaged");
|
|
16
16
|
const { buildEmbeddedInventory } = require("./embedded");
|
|
17
17
|
const { renderCharts } = require("./charts");
|
|
18
|
+
const { renderLinkedCves, renderRiskEvidence, renderRiskAttribution, renderEuvdEvidence, renderDistributionAdvisories } = require("./artifacts/risk-report");
|
|
18
19
|
const { findDeclarations } = require("./descriptor-refs");
|
|
19
20
|
const { europeanReferences, euvdExploited } = require("./eu-refs");
|
|
20
21
|
|
|
@@ -79,18 +80,8 @@ function esc(s) {
|
|
|
79
80
|
.replace(/"/g, """);
|
|
80
81
|
}
|
|
81
82
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
function renderTimestamp(value) {
|
|
85
|
-
const raw = String(value || "");
|
|
86
|
-
if (!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/.test(raw)) return esc(raw);
|
|
87
|
-
const date = new Date(raw);
|
|
88
|
-
if (!Number.isFinite(date.getTime())) return esc(raw);
|
|
89
|
-
const text = new Intl.DateTimeFormat(RENDER_CTX.locale || "en", {
|
|
90
|
-
year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", timeZone: "UTC", timeZoneName: "short"
|
|
91
|
-
}).format(date);
|
|
92
|
-
return `<time datetime="${esc(raw)}">${esc(text)}</time>`;
|
|
93
|
-
}
|
|
83
|
+
const { renderTime, localizeReportTimes } = require("./report-time");
|
|
84
|
+
function renderTimestamp(value) { return renderTime(value, RENDER_CTX.locale || "en"); }
|
|
94
85
|
function renderTextWithTimestamps(value) {
|
|
95
86
|
const text = String(value || "");
|
|
96
87
|
const pattern = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})/g;
|
|
@@ -167,13 +158,17 @@ function priorityParts(m) {
|
|
|
167
158
|
function priorityCell(m, published) {
|
|
168
159
|
const { bandBadge, kev } = priorityParts(m);
|
|
169
160
|
// 1 — act on this one? fix-priority band, and the KEV flag that overrides everything.
|
|
170
|
-
const
|
|
161
|
+
const unratedAdvisory = m.dep?.artifactTargetId && !/^CVE-\d{4}-\d{4,}$/i.test(m.cve?.id || "") && (!m.cve.severity || m.cve.severity === "UNKNOWN") && m.cve.score == null;
|
|
162
|
+
const l1 = unratedAdvisory && !kev ? "" : `<div class="prio-line">${bandBadge}${kev ? " " + kev : ""}</div>`; // separator in the markup, see below
|
|
171
163
|
// 2 — how bad is it? CVSS severity and score.
|
|
172
164
|
// The separator lives in the MARKUP, not in CSS. A margin renders a gap on screen but
|
|
173
165
|
// is absent from textContent, which is what the clipboard's plain-text flavour and the
|
|
174
166
|
// TSV export read — they were producing "CRITICAL9.8".
|
|
175
167
|
const score = m.cve?.score != null ? ` <span class="prio-score" title="${esc(t("CVSS base score"))}">${esc(m.cve.score.toFixed(1))}</span>` : "";
|
|
176
|
-
const
|
|
168
|
+
const linkedScores = m.cve?.nvdEvidence?.records?.some(r => r.score != null || (r.severity && r.severity !== "UNKNOWN"));
|
|
169
|
+
const l2 = `<div class="prio-line">${unratedAdvisory ? `<span class="unrated-advisory">${t("Unrated advisory")}</span>` : badge(m.cve?.severity)}${score}</div>` +
|
|
170
|
+
(unratedAdvisory ? `<div class="prio-meta risk-note">${linkedScores ? t("Scores per linked CVE") : t("Severity not supplied by the available sources")}</div>` : "") +
|
|
171
|
+
`<div class="prio-meta risk-note">${renderRiskAttribution(m.cve, RENDER_CTX.locale)}</div>`;
|
|
177
172
|
// 3 and 4 — context, dimmed and LABELLED. A bare percentage and a bare date share no
|
|
178
173
|
// column header any more, so each says what it is rather than relying on the reader.
|
|
179
174
|
const meta = (key, value, title) =>
|
|
@@ -182,7 +177,7 @@ function priorityCell(m, published) {
|
|
|
182
177
|
? meta("EPSS", `${Math.round(m.cve.epssPercentile * 100)}%`,
|
|
183
178
|
t("EPSS score {pct}% — percentile among all scored CVEs", { pct: m.cve.epssScore != null ? (m.cve.epssScore * 100).toFixed(1) : "?" }))
|
|
184
179
|
: "";
|
|
185
|
-
const l4 = published ? meta
|
|
180
|
+
const l4 = published ? `<div class="prio-line prio-meta prio-date"><span class="prio-k">${t("Published")}:</span> ${renderTimestamp(published)}</div>` : "";
|
|
186
181
|
return `${l1}${l2}${l3}${l4}`;
|
|
187
182
|
}
|
|
188
183
|
|
|
@@ -266,7 +261,7 @@ td.prio .prio-meta { font-size: 10px; color: #6b7280; white-space: nowrap; }
|
|
|
266
261
|
inside the inline-block and therefore applies AFTER the colon, which min-width alone does
|
|
267
262
|
not guarantee: "Published:" is already wider than the minimum and butted against its value. */
|
|
268
263
|
td.prio .prio-k { display: inline-block; min-width: 5.4em; padding-right: 6px; color: #9ca3af; }
|
|
269
|
-
td.prio .prio-date { font-family: ui-monospace, monospace; }
|
|
264
|
+
td.prio .prio-date { font-family: ui-monospace, monospace; white-space: normal; }
|
|
270
265
|
td.prio .prio-band { white-space: nowrap; }
|
|
271
266
|
td.prio .kev-chip { display: inline-block; margin-left: 2px; font-size: 10px; font-weight: 700; color: #7c0008; white-space: nowrap; }
|
|
272
267
|
td.prio .epss-chip { display: block; margin-top: 2px; font-size: 10px; color: #6b7280; font-family: ui-monospace, monospace; white-space: nowrap; }
|
|
@@ -355,6 +350,10 @@ td.fix { overflow-wrap: normal; word-break: normal; min-width: 0; }
|
|
|
355
350
|
longer carries descriptor paths, so this is still far narrower than it used to be. */
|
|
356
351
|
td.dep { min-width: 11em; }
|
|
357
352
|
td.dep.fix { min-width: 0; }
|
|
353
|
+
td.image-remediation { min-width: 15em; font-family: inherit; }
|
|
354
|
+
td.image-remediation small { display: block; margin-top: .45em; line-height: 1.4; }
|
|
355
|
+
td.image-remediation code, .image-update-evidence code { overflow-wrap: anywhere; }
|
|
356
|
+
.image-update-evidence { line-height: 1.5; margin: .5em 0; }
|
|
358
357
|
th { background: #f3f4f6; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #4b5563; }
|
|
359
358
|
/* A header wraps at SPACES, never mid-word: the th,td rule's word-break: break-word lets
|
|
360
359
|
a table's min-content calculation crush a column to a few characters, and a two-word
|
|
@@ -422,11 +421,15 @@ td.desc { color: #4b5563; max-width: 480px; }
|
|
|
422
421
|
.warnings .warn-unresolved-versions code { background: #fecaca; }
|
|
423
422
|
.confidence { font-size: 10px; color: #9ca3af; text-transform: uppercase; }
|
|
424
423
|
.source { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; background: #e5e7eb; color: #374151; margin: 1px 2px 1px 0; }
|
|
424
|
+
a.source { text-decoration: none; }
|
|
425
425
|
.source.both { background: #c7d2fe; color: #312e81; }
|
|
426
426
|
.source.snyk { background: #fce7f3; color: #831843; }
|
|
427
427
|
.source.osv { background: #dcfce7; color: #166534; }
|
|
428
|
-
.source.CVEProject { background: #fef3c7; color: #92400e; }
|
|
428
|
+
.source.CVEProject, .source.cveproject { background: #fef3c7; color: #92400e; }
|
|
429
429
|
.source.nvd { background: #cffafe; color: #155e75; }
|
|
430
|
+
.source.euvd { background: #dbeafe; color: #1e40af; }
|
|
431
|
+
.source.gcve { background: #ede9fe; color: #5b21b6; }
|
|
432
|
+
.source.ghsa { background: #e5e7eb; color: #24292f; }
|
|
430
433
|
.chip { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; margin-left: 4px; }
|
|
431
434
|
.chip.transitive { background: #fef3c7; color: #92400e; }
|
|
432
435
|
.chip.direct { background: #d1fae5; color: #065f46; }
|
|
@@ -453,10 +456,10 @@ details.report-section > summary:hover h2 { color: #4338ca; }
|
|
|
453
456
|
details.report-subsection { margin: 16px 0 0; }
|
|
454
457
|
details.report-subsection > summary { cursor: pointer; list-style: none; user-select: none; outline: none; padding: 0; }
|
|
455
458
|
details.report-subsection > summary::-webkit-details-marker { display: none; }
|
|
456
|
-
details.report-subsection > summary h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
|
|
457
|
-
details.report-subsection > summary h3::before { content: "▾"; color: #9ca3af; font-size: 12px; transition: transform .15s ease; display: inline-block; }
|
|
458
|
-
details.report-subsection:not([open]) > summary h3::before { transform: rotate(-90deg); }
|
|
459
|
-
details.report-subsection > summary:hover h3 { color: #4b5563; }
|
|
459
|
+
details.report-subsection > summary :is(h3,h4) { margin: 0; display: flex; align-items: center; gap: 8px; }
|
|
460
|
+
details.report-subsection > summary :is(h3,h4)::before { content: "▾"; color: #9ca3af; font-size: 12px; transition: transform .15s ease; display: inline-block; }
|
|
461
|
+
details.report-subsection:not([open]) > summary :is(h3,h4)::before { transform: rotate(-90deg); }
|
|
462
|
+
details.report-subsection > summary:hover :is(h3,h4) { color: #4b5563; }
|
|
460
463
|
/* Hierarchical indentation: every subsection's content gets a padded,
|
|
461
464
|
bordered container. Nested subsections inherit + add to the indent so
|
|
462
465
|
children visually nest under their parent. */
|
|
@@ -556,6 +559,50 @@ tr.detail-row > td { padding: 0; border-bottom: 2px solid #c7d2fe; background: #
|
|
|
556
559
|
.detail-panel .kv span { font-family: ui-monospace, monospace; font-size: 12px; }
|
|
557
560
|
.detail-panel .via-list { font-family: ui-monospace, monospace; font-size: 11px; color: #4b5563; max-height: 200px; overflow-y: auto; }
|
|
558
561
|
.detail-panel .via-list div { padding: 2px 0; }
|
|
562
|
+
.linked-cves { margin-top: 6px; font-size: 10px; line-height: 1.5; white-space: normal; }
|
|
563
|
+
.linked-cves a { white-space: nowrap; }
|
|
564
|
+
.risk-attribution { display: block; font-size: 10px; overflow-wrap: anywhere; white-space: normal; }
|
|
565
|
+
td.prio .risk-note { white-space: normal; max-width: 190px; }
|
|
566
|
+
.detail-panel, .linked-cve-evidence { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
|
|
567
|
+
.detail-panel .kv > div { flex: 1 1 200px; min-width: 0; max-width: 100%; }
|
|
568
|
+
.detail-panel .kv span, .detail-panel .cvss-vector { overflow-wrap: anywhere; white-space: normal; }
|
|
569
|
+
.detail-panel .ref-list a { overflow-wrap: anywhere; }
|
|
570
|
+
.distribution-advisories { margin: 12px 0; }
|
|
571
|
+
.unrated-advisory { font-weight: 600; color: #4b5563; }
|
|
572
|
+
.linked-cve-evidence { margin-top: 12px; }
|
|
573
|
+
.linked-cve-evidence .kv { margin: 8px 0; }
|
|
574
|
+
details[id] { scroll-margin-top: 76px; }
|
|
575
|
+
#chimages code, #chimages h3, #chimages-cves h3 { overflow-wrap: anywhere; }
|
|
576
|
+
.image-inventory th:nth-child(5), .image-inventory td:nth-child(5) { min-width: 4.5em; white-space: nowrap; }
|
|
577
|
+
.image-totals { max-width: 720px; table-layout: fixed; margin: 16px 0; border: 1px solid #e5e7eb; }
|
|
578
|
+
.image-totals th { width: 25%; white-space: normal; overflow-wrap: anywhere; }
|
|
579
|
+
.image-totals .image-total-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: #1f2937; }
|
|
580
|
+
.image-severity-label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 600; color: #4b5563; }
|
|
581
|
+
.image-severity { display: inline-block; margin: 3px 6px 3px 0; padding: 3px 7px; border-radius: 4px; font-size: 11px; white-space: nowrap; background: #f3f4f6; color: #4b5563; }
|
|
582
|
+
.image-severity strong { margin-left: 5px; font-variant-numeric: tabular-nums; }
|
|
583
|
+
.image-severity.critical { background: #fee2e2; color: #991b1b; }
|
|
584
|
+
.image-severity.high { background: #ffedd5; color: #9a3412; }
|
|
585
|
+
.image-severity.medium { background: #fef3c7; color: #92400e; }
|
|
586
|
+
.image-severity.low { background: #dbeafe; color: #1e40af; }
|
|
587
|
+
.image-section-nav { margin: 12px 0 20px; }
|
|
588
|
+
.report-section-link { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; padding: 8px 12px; border: 1px solid #c7d2fe; border-radius: 6px; background: #eef2ff; color: #4338ca; font-size: 12px; font-weight: 600; line-height: 1.4; text-decoration: none; }
|
|
589
|
+
.report-section-link > span { flex-shrink: 0; font-size: 16px; line-height: 1; }
|
|
590
|
+
.report-section-link:hover { background: #e0e7ff; border-color: #a5b4fc; color: #3730a3; }
|
|
591
|
+
.report-section-link:focus-visible { outline: 2px solid #6366f1; outline-offset: 3px; }
|
|
592
|
+
@media screen and (max-width: 600px) {
|
|
593
|
+
html, body { overflow-x: clip; }
|
|
594
|
+
.toc { position: static; }
|
|
595
|
+
.toc .toc-item { flex: 1 1 25%; box-sizing: border-box; }
|
|
596
|
+
.charts-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
597
|
+
.table-wrap > table:has(tr > :nth-child(4)) { min-width: 720px; }
|
|
598
|
+
}
|
|
599
|
+
@media print {
|
|
600
|
+
.toolbar, .toc, .table-actions, .btn-copy, .chart-copy-btn { display: none !important; }
|
|
601
|
+
.table-wrap { overflow: visible; }
|
|
602
|
+
thead { display: table-header-group; }
|
|
603
|
+
tr { break-inside: avoid; }
|
|
604
|
+
details[id] { scroll-margin-top: 0; }
|
|
605
|
+
}
|
|
559
606
|
`;
|
|
560
607
|
|
|
561
608
|
// Module-local render context — set at the start of buildBody so deep helpers
|
|
@@ -628,6 +675,10 @@ function descriptorCount(paths) {
|
|
|
628
675
|
}
|
|
629
676
|
|
|
630
677
|
function renderDefinedIn(dep, srcRoot) {
|
|
678
|
+
if (dep.artifactTargetId) {
|
|
679
|
+
const path = dep.artifactPath || dep.manifestPaths?.[0] || dep.pomPaths?.[0];
|
|
680
|
+
return path ? `<div class="defined-in"><span class="defined-label">${t("Evidence in image")}</span> <code>${esc(path)}</code></div>` : "";
|
|
681
|
+
}
|
|
631
682
|
const paths = (dep.manifestPaths && dep.manifestPaths.length) ? dep.manifestPaths
|
|
632
683
|
: (dep.pomPaths && dep.pomPaths.length) ? dep.pomPaths
|
|
633
684
|
: [];
|
|
@@ -660,7 +711,14 @@ function renderDefinedIn(dep, srcRoot) {
|
|
|
660
711
|
const versionLine = (vs && (vs.via === "bom" || vs.via === "parent") && vs.bom)
|
|
661
712
|
? `<div class="defined-in"><span class="defined-label">${t("version managed by:")}</span> <code>${esc(vs.bom)}</code> (${vsKind})</div>`
|
|
662
713
|
: "";
|
|
663
|
-
return definedLine + versionLine;
|
|
714
|
+
return definedLine + versionLine + renderGraphVersionSource(dep);
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
function renderGraphVersionSource(dep) {
|
|
718
|
+
const source = dep.versionSource;
|
|
719
|
+
if (source?.via !== "gradle-graph" || !Array.isArray(source.paths)) return "";
|
|
720
|
+
const paths = source.paths.filter(p => Array.isArray(p) && p.length).map(p => `<code>${esc(p.join(" → "))}</code>`);
|
|
721
|
+
return paths.length ? `<div class="defined-in"><span class="defined-label">${t("version resolved through:")}</span> ${paths.join("; ")}</div>` : "";
|
|
664
722
|
}
|
|
665
723
|
|
|
666
724
|
/**
|
|
@@ -740,14 +798,14 @@ function codecFor(dep) { return getCodec(dep?.ecosystemType) || getCodec(dep?.ec
|
|
|
740
798
|
|
|
741
799
|
function depDisplayParts(dep) {
|
|
742
800
|
const c = codecFor(dep);
|
|
743
|
-
if (!c) return { groupLine: `${dep?.groupId
|
|
801
|
+
if (!c) return { groupLine: `${dep?.packageType || dep?.ecosystem || dep?.groupId || ""}:`, nameLine: dep?.name || dep?.artifactId || "" };
|
|
744
802
|
if (dep.ecosystem === "maven") return { groupLine: `${dep.namespace || dep.groupId || ""}:`, nameLine: dep.name || dep.artifactId || "" };
|
|
745
803
|
return { groupLine: `${dep.ecosystem}:`, nameLine: c.formatCoord(dep) };
|
|
746
804
|
}
|
|
747
805
|
|
|
748
806
|
function depDisplayName(dep) {
|
|
749
807
|
const c = codecFor(dep);
|
|
750
|
-
if (!c) return
|
|
808
|
+
if (!c) return [dep?.packageType || dep?.ecosystem || dep?.groupId, dep?.name || dep?.artifactId].filter(Boolean).join(":");
|
|
751
809
|
const coord = c.formatCoord(dep);
|
|
752
810
|
return dep.ecosystem === "maven" ? coord : `${dep.ecosystem}:${coord}`;
|
|
753
811
|
}
|
|
@@ -853,21 +911,40 @@ function vigievulnAdvisoryUrl(cve) {
|
|
|
853
911
|
}
|
|
854
912
|
|
|
855
913
|
function renderSources(m) {
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
|
|
914
|
+
const c=m.cve||{},sources=String(m.source||'').split('+').filter(Boolean),badges=new Map();
|
|
915
|
+
const put=(key,label,url=null)=>{if(!badges.has(key) || (url && !badges.get(key).url))badges.set(key,{label,url});};
|
|
916
|
+
for(const source of sources){
|
|
917
|
+
if(/^GCVE:GNA-/i.test(source)||/^github-publisher$/i.test(source))continue;
|
|
918
|
+
if(source==='debian-security-tracker-history'){put('debian','Debian',/^CVE-\d{4}-\d{4,}$/.test(c.id||'')?`https://security-tracker.debian.org/tracker/${encodeURIComponent(c.id)}`:null);continue;}
|
|
919
|
+
if(source==='nginx-vendor-advisories'){put('nginx','NGINX','https://nginx.org/en/security_advisories.html');continue;}
|
|
920
|
+
if(source==='freexian-ela'){put('freexian','Freexian','https://www.freexian.com/lts/extended/updates/');continue;}
|
|
921
|
+
const url=/^vigievuln$/i.test(source)?vigievulnAdvisoryUrl(c):/^nvd$/i.test(source)&&/^CVE-\d{4}-\d{4,}$/i.test(c.id||'')?`https://nvd.nist.gov/vuln/detail/${encodeURIComponent(c.id)}`:null;
|
|
922
|
+
put(source.toLowerCase(),source,/^cveproject$/i.test(source)&&/^CVE-\d{4}-\d{4,}$/i.test(c.id||'')?`https://www.cve.org/CVERecord?id=${encodeURIComponent(c.id)}`:url);
|
|
923
|
+
}
|
|
924
|
+
const evidence=(c.cveEvidence||[]).find(e=>String(e.id||'').toUpperCase()===String(c.id||'').toUpperCase())||{};
|
|
925
|
+
const euvd=c.euvdDetails||evidence.euvdDetails||c.euvd||evidence.euvd;
|
|
926
|
+
if(/^EUVD-\d{4}-\d+$/i.test(euvd?.id||'') && (c.euvdDetailsEvidence?.status==='enriched'||evidence.euvdDetailsEvidence?.status==='enriched'||c.euvdEvidence?.status==='enriched'||evidence.euvdEvidence?.status==='enriched'||euvd.source==='euvd'))put('euvd','EUVD',`https://euvd.enisa.europa.eu/vulnerability/${encodeURIComponent(euvd.id)}`);
|
|
927
|
+
const gnas=new Set(sources.map(s=>/^GCVE:GNA-(\d+)$/i.exec(s)?.[1]).filter(x=>x!==undefined));
|
|
928
|
+
const gcve=(c.sourceGcveIds||[]).find(id=>{const match=/^GCVE-(\d+)-/i.exec(id);return match && gnas.has(match[1]);}) || (c.gcveEvidence?.kind==='native-record'?c.gcve:null) || [c.gcveEvidence?.kind==='derived-alias'?null:c.gcve,...(c.distributionAdvisories||[]).map(a=>a.id),c.id].find(id=>{const match=/^GCVE-(\d+)-/i.exec(id||'');return match && gnas.has(match[1]);});
|
|
929
|
+
if(/^GCVE-\d+-[a-z0-9\-/]+$/i.test(gcve||''))put('gcve','GCVE',`https://www.vigievuln.fr/advisory/gcve/${encodeURIComponent(gcve)}`);
|
|
930
|
+
const ghsaIds=[...(c.sourceGhsaIds||[]),...(sources.some(s=>/^(?:osv|ghsa|github-publisher)$/i.test(s))?[m.advisoryId,c.id,...(c.aliases||[]),...(c.distributionAdvisories||[]).map(a=>a.id)]:[])];
|
|
931
|
+
const ghsa=ghsaIds.find(id=>/^GHSA-[a-z0-9-]+$/i.test(id||''));
|
|
932
|
+
if(ghsa){let url=`https://github.com/advisories/${encodeURIComponent(ghsa)}`;try{const u=new URL(c.advisorySource);if(sources.some(s=>/^github-publisher$/i.test(s))&&u.protocol==='https:'&&u.hostname==='github.com'&&!u.username&&!u.password&&!u.port&&!u.search&&!u.hash&&u.pathname.endsWith('/security/advisories/'+ghsa))url=u.href;}catch{}put('ghsa','GHSA',url);}
|
|
933
|
+
if(!badges.size)put('cache','cache');
|
|
934
|
+
return [...badges].map(([key,{label,url}])=>url?`<a class="source ${esc(key)}" href="${esc(url)}" target="_blank" rel="noopener noreferrer">${esc(label)}</a>`:`<span class="source ${esc(key)}">${esc(label)}</span>`).join('');
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
function renderDetailPanel(m, opts = {}) {
|
|
864
938
|
const cve = m.cve;
|
|
865
939
|
const dep = m.dep;
|
|
866
940
|
const sections = [];
|
|
941
|
+
if (dep.artifactTargetId) sections.push(`<p><a href="#${require("./artifacts/report").artifactAnchor(dep.artifactTargetId)}">${t("Replace or rebuild the image — remediation details")}</a></p>`);
|
|
942
|
+
if (dep.artifactTargetId) sections.push(section(t("Image update evidence"), require('./artifacts/remediation-report').renderImageUpdateSummary(opts.image, RENDER_CTX.locale)));
|
|
867
943
|
|
|
868
944
|
// 1. Description
|
|
869
|
-
|
|
870
|
-
|
|
945
|
+
const primaryDescription=cve.description || (cve.nvdEvidence?.records || []).find(r=>String(r.id||'').toUpperCase()===String(cve.id||'').toUpperCase())?.description || cve.euvdDetails?.description;
|
|
946
|
+
if (primaryDescription) {
|
|
947
|
+
sections.push(section(t("Description"), `<div class="full-desc">${esc(primaryDescription)}</div>`));
|
|
871
948
|
}
|
|
872
949
|
|
|
873
950
|
// 2. Weaknesses (CWE) — id + human name, links to mitre.org
|
|
@@ -881,17 +958,17 @@ function renderDetailPanel(m) {
|
|
|
881
958
|
if (cve.score != null) kv.push(`<div><label>${t("Base score")}</label><span>${esc(cve.score.toFixed ? cve.score.toFixed(1) : cve.score)} (${esc(cve.severity || "?")})</span></div>`);
|
|
882
959
|
if (cve.priority) kv.push(`<div><label>${t("Priority")}</label><span>${esc((cve.priority.band || "").toUpperCase())}${cve.priority.score != null ? ` · ${esc(cve.priority.score)}/100` : ""}</span></div>`);
|
|
883
960
|
if (cve.epssPercentile != null) kv.push(`<div><label>EPSS</label><span>${cve.epssScore != null ? t("{pct}% prob · ", { pct: (cve.epssScore * 100).toFixed(1) }) : ""}${t("{n}th pct", { n: Math.round(cve.epssPercentile * 100) })}</span></div>`);
|
|
884
|
-
if (cve.kev) kv.push(`<div><label>CISA KEV</label><span>${t("Known exploited")}${cve.kevDateAdded ? t(" · added {date}", { date:
|
|
885
|
-
if (cve.fixVersion) kv.push(`<div><label>${t("Advisory-specific candidate")}</label><span>${esc(cve.fixVersion)} — ${cve.fixEvidence === 'explicit-unaffected-version' ? t("This exact version was verified unaffected by this advisory; other versions remain unknown.") + ' ' : ''}${t("Package-wide safety has not been verified.")}</span></div>`);
|
|
886
|
-
if (cve.published) kv.push(`<div><label>${t("Published")}</label><span>${
|
|
887
|
-
if (cve.modified) kv.push(`<div><label>${t("Modified")}</label><span>${
|
|
961
|
+
if (cve.kev) kv.push(`<div><label>CISA KEV</label><span>${t("Known exploited")}${cve.kevDateAdded ? t(" · added {date}", { date: renderTimestamp(cve.kevDateAdded) }) : ""}${cve.kevDueDate ? t(" · due {date}", { date: renderTimestamp(cve.kevDueDate) }) : ""}${cve.kevRansomware ? t(" · ransomware") : ""}</span></div>`);
|
|
962
|
+
if (cve.fixVersion && !cve.distributionAdvisories?.length) kv.push(`<div><label>${t("Advisory-specific candidate")}</label><span>${esc(cve.fixVersion)} — ${cve.fixEvidence === 'explicit-unaffected-version' ? t("This exact version was verified unaffected by this advisory; other versions remain unknown.") + ' ' : ''}${t("Package-wide safety has not been verified.")}</span></div>`);
|
|
963
|
+
if (cve.published) kv.push(`<div><label>${t("Published")}</label><span>${renderTimestamp(cve.published)}</span></div>`);
|
|
964
|
+
if (cve.modified) kv.push(`<div><label>${t("Modified")}</label><span>${renderTimestamp(cve.modified)}</span></div>`);
|
|
888
965
|
if (cve.ghsa) kv.push(`<div><label>GHSA</label><span><a href="https://github.com/advisories/${esc(cve.ghsa)}" target="_blank">${esc(cve.ghsa)}</a></span></div>`);
|
|
889
966
|
// European references (lib/eu-refs.js): the EUVD id + ENISA's exploited flag, the GCVE id.
|
|
890
967
|
const euRefs = europeanReferences(cve);
|
|
891
968
|
const euvdRef = euRefs.find(r => r.source === "ENISA EUVD"), gcveRef = euRefs.find(r => r.source === "GCVE");
|
|
892
969
|
if (euvdRef || euvdExploited(cve)) {
|
|
893
970
|
const since = cve.euvd?.exploitedSince;
|
|
894
|
-
const flag = euvdExploited(cve) ? (since ? t(" · exploited since {date}", { date:
|
|
971
|
+
const flag = euvdExploited(cve) ? (since ? t(" · exploited since {date}", { date: renderTimestamp(since) }) : t(" · exploited")) : "";
|
|
895
972
|
kv.push(`<div><label>ENISA EUVD</label><span>${euvdRef ? `<a href="${esc(euvdRef.url)}" target="_blank">${esc(euvdRef.id)}</a>` : ""}${flag}</span></div>`);
|
|
896
973
|
}
|
|
897
974
|
if (gcveRef) kv.push(`<div><label>GCVE</label><span><a href="${esc(gcveRef.url)}" target="_blank">${esc(gcveRef.id)}</a></span></div>`);
|
|
@@ -899,18 +976,29 @@ function renderDetailPanel(m) {
|
|
|
899
976
|
if (m.source) kv.push(`<div><label>${t("Sources")}</label><span>${renderSources(m)}</span></div>`);
|
|
900
977
|
if (cve.severityOriginal) kv.push(`<div><label>Original severity</label><span>${esc(cve.severityOriginal)} (Drupal)</span></div>`);
|
|
901
978
|
if (cve.copyrightNotice) kv.push(`<div><label>Copyright</label><span>${esc(cve.copyrightNotice)}</span></div>`);
|
|
979
|
+
if (cve.riskEvidence && cve.riskEvidence.id !== cve.id) kv.push(`<div><label>${t("Risk evidence")}</label><span>${renderRiskAttribution(cve, RENDER_CTX.locale)}</span></div>`);
|
|
902
980
|
if (kv.length) sections.push(section(t("Metadata"), `<div class="kv">${kv.join("")}</div>`));
|
|
981
|
+
sections.push(renderDistributionAdvisories(cve, RENDER_CTX.locale));
|
|
982
|
+
sections.push(require('./artifacts/risk-report').renderHistoricalEvidence(cve,RENDER_CTX.locale));
|
|
983
|
+
sections.push(require('./artifacts/risk-report').renderVendorEvidence(cve,RENDER_CTX.locale));
|
|
984
|
+
sections.push(renderRiskEvidence(cve, RENDER_CTX.locale, { omitRepeated: true }));
|
|
985
|
+
sections.push(renderEuvdEvidence(cve, RENDER_CTX.locale, { omitRepeated: true }));
|
|
986
|
+
const relatedAdvisories=(Array.isArray(cve.relatedAdvisories)?cve.relatedAdvisories:[]).filter(a=>{
|
|
987
|
+
if(a?.relationship!=='reference'||!/^GHSA-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}$/i.test(a.id||''))return false;
|
|
988
|
+
try{const u=new URL(a.url);return u.protocol==='https:'&&u.hostname==='github.com'&&!u.username&&!u.password&&!u.port&&!u.search&&!u.hash&&u.pathname.endsWith('/security/advisories/'+a.id);}catch{return false;}
|
|
989
|
+
});
|
|
990
|
+
if(relatedAdvisories.length)sections.push(section(RENDER_CTX.locale==='fr'?'Avis associés (références)':'Related advisories (references)',`<ul class="ref-list">${relatedAdvisories.map(a=>`<li><a href="${esc(a.url)}" target="_blank" rel="noopener noreferrer">${esc(a.id)}</a> · ${esc(a.source||'')}</li>`).join('')}</ul>`));
|
|
903
991
|
|
|
904
992
|
// 3. External links — grouped
|
|
905
|
-
const grouped = groupExternalRefs(cve.nvdRefs || [], cve.osvRefs || []);
|
|
993
|
+
const grouped = groupExternalRefs(cve.nvdRefs || [], [...(cve.osvRefs || []),...(Array.isArray(cve.references)?cve.references:[]).map(r=>typeof r==='string'?{url:r}:r).filter(r=>r && typeof r==='object')]);
|
|
906
994
|
const order = ["patch", "exploit", "advisory", "vendor", "third-party", "fix", "mailing", "web", "other"];
|
|
907
995
|
const orderedKeys = order.filter(k => grouped[k]?.length);
|
|
908
996
|
if (orderedKeys.length) {
|
|
909
997
|
const totalRefs = Object.values(grouped).reduce((s, arr) => s + arr.length, 0);
|
|
910
998
|
const groupBlocks = orderedKeys.map(k => {
|
|
911
999
|
const label = t(REF_LABELS[k] || k);
|
|
912
|
-
const items = grouped[k].
|
|
913
|
-
const more =
|
|
1000
|
+
const items = grouped[k].map(u => `<li><a href="${esc(u)}" target="_blank">${esc(u)}</a></li>`).join("");
|
|
1001
|
+
const more = "";
|
|
914
1002
|
return `<div class="ref-group">
|
|
915
1003
|
<span class="ref-label ${esc(k)}">${esc(label)}</span><span style="color:#9ca3af;font-size:11px">${plural(grouped[k].length, "{n} link", "{n} links")}</span>
|
|
916
1004
|
<ul class="ref-list">${items}${more}</ul>
|
|
@@ -959,7 +1047,7 @@ function renderDetailPanel(m) {
|
|
|
959
1047
|
// ecosystem, so an npm-only project was told its package-lock.json was a POM.
|
|
960
1048
|
if (dep.pomPaths?.length) {
|
|
961
1049
|
const items = dep.pomPaths.slice(0, 10).map(p => `<div>${esc(makeRelative(p, RENDER_CTX.srcRoot))}</div>`).join("");
|
|
962
|
-
sections.push(section(t("Declared in"),
|
|
1050
|
+
sections.push(section(dep.artifactTargetId ? t("Evidence in image") : t("Declared in"),
|
|
963
1051
|
`<div class="via-list">${items}${dep.pomPaths.length > 10 ? `<div style="color:#9ca3af">${t("+{n} more", { n: dep.pomPaths.length - 10 })}</div>` : ""}</div>`,
|
|
964
1052
|
{ count: descriptorCount(dep.pomPaths), open: false }));
|
|
965
1053
|
}
|
|
@@ -967,12 +1055,6 @@ function renderDetailPanel(m) {
|
|
|
967
1055
|
return `<div class="detail-panel">${sections.join("")}</div>`;
|
|
968
1056
|
}
|
|
969
1057
|
|
|
970
|
-
function formatPubDate(iso) {
|
|
971
|
-
if (!iso) return "—";
|
|
972
|
-
const s = String(iso).slice(0, 10);
|
|
973
|
-
if (!/^\d{4}-\d{2}-\d{2}$/.test(s)) return "—";
|
|
974
|
-
return s;
|
|
975
|
-
}
|
|
976
1058
|
function formatCwes(cwes) {
|
|
977
1059
|
if (!Array.isArray(cwes) || !cwes.length) return `<span class="cwe-empty">—</span>`;
|
|
978
1060
|
const top = cwes.slice(0, 2);
|
|
@@ -1012,28 +1094,31 @@ function renderCveRow(m, opts = {}) {
|
|
|
1012
1094
|
const link = /^VV:CVE-\d{4}-\d{4,}$/i.test(advisoryId) ? vigievulnAdvisoryUrl(m.cve) :
|
|
1013
1095
|
/^CVE-\d{4}-\d{4,}$/i.test(advisoryId) ? `https://www.vigievuln.fr/cve/${encodeURIComponent(advisoryId.toUpperCase())}` :
|
|
1014
1096
|
/^GHSA-[A-Za-z0-9-]+$/i.test(advisoryId) ? `https://github.com/advisories/${encodeURIComponent(advisoryId)}` : null;
|
|
1015
|
-
const
|
|
1097
|
+
const advisoryUrl = link || (String(m.source || "").split("+").includes("osv") && m.advisoryId
|
|
1098
|
+
? `https://www.vigievuln.fr/advisory/osv/${encodeURIComponent(m.advisoryId)}` : null);
|
|
1099
|
+
const advisoryCell = advisoryUrl ? `<a href="${advisoryUrl}" target="_blank" rel="noopener">${esc(advisoryId)}</a>` : esc(advisoryId);
|
|
1016
1100
|
const source = renderSources(m);
|
|
1101
|
+
const linkedCves = renderLinkedCves(m.cve, RENDER_CTX.locale);
|
|
1017
1102
|
const conf = m.confidence ? `<div class="confidence">${esc(m.confidence)}</div>` : "";
|
|
1018
1103
|
const actionCell = withAction ? `<td class="action">${renderActionCell(m)}</td>` : "";
|
|
1019
|
-
const baseCols =
|
|
1104
|
+
const baseCols = 7; // Priority/severity/date, advisory, dependency, CWE, description, fix, source
|
|
1020
1105
|
const colspan = withAction ? baseCols + 1 : baseCols;
|
|
1021
|
-
const pub =
|
|
1106
|
+
const pub = m.cve.published || null;
|
|
1022
1107
|
const cwes = formatCwes(m.cve.cwes);
|
|
1023
1108
|
// Click-to-expand: clicking anywhere on tr.cve-row toggles the next sibling
|
|
1024
1109
|
// tr.detail-row. JS toggle is at the bottom of the document; links inside
|
|
1025
1110
|
// cells stay clickable (the handler ignores anchor/button clicks).
|
|
1026
1111
|
return `<tr class="cve-row${m.cpeFiltered ? " cpe-fp" : ""}">
|
|
1027
1112
|
<td class="prio">${priorityCell(m, pub)}</td>
|
|
1028
|
-
<td class="cve">${advisoryCell}${conf}${m.cpeFiltered ? `<div class="cpe-tag">${t("CPE-filtered")}</div>` : ""}</td>
|
|
1113
|
+
<td class="cve">${advisoryCell}${linkedCves}${conf}${m.cpeFiltered ? `<div class="cpe-tag">${t("CPE-filtered")}</div>` : ""}</td>
|
|
1029
1114
|
${depCell(m.dep)}
|
|
1030
1115
|
<td class="cwe">${cwes}</td>
|
|
1031
1116
|
<td class="desc">${esc(shortDesc(m.cve.description))}</td>
|
|
1032
|
-
|
|
1117
|
+
${m.dep?.artifactTargetId ? `<td class="image-remediation">${require('./artifacts/remediation-report').renderImageCveAction(m, opts.image, RENDER_CTX.locale)}</td>` : `<td class="dep fix">${esc(m.cve.fixVersion || "—")}</td>`}
|
|
1033
1118
|
<td>${source}</td>
|
|
1034
1119
|
${actionCell}
|
|
1035
1120
|
</tr>
|
|
1036
|
-
<tr class="detail-row"><td colspan="${colspan}">${renderDetailPanel(m)}</td></tr>`;
|
|
1121
|
+
<tr class="detail-row"><td colspan="${colspan}">${renderDetailPanel(m, opts)}</td></tr>`;
|
|
1037
1122
|
}
|
|
1038
1123
|
|
|
1039
1124
|
function renderActionCell(m) {
|
|
@@ -1066,8 +1151,9 @@ function renderCveTable(cveMatches, opts = {}) {
|
|
|
1066
1151
|
const rows = sortByPriority(cveMatches).map(m => renderCveRow(m, opts)).join("\n");
|
|
1067
1152
|
const actionHeader = withAction ? `<th>${t("Recommended action")}</th>` : "";
|
|
1068
1153
|
const idHeader = cveMatches.every(m => /^CVE-\d{4}-\d{4,}$/i.test(String(m.cve?.id || ""))) ? t("CVE ID") : t("Advisory ID");
|
|
1069
|
-
|
|
1070
|
-
|
|
1154
|
+
const images = cveMatches.every(m => m.dep?.artifactTargetId);
|
|
1155
|
+
return `<table data-tbl="cve"${images ? ' data-image-cves="true"' : ''}>
|
|
1156
|
+
<thead><tr><th title="${esc(t("Line 1: fix-priority band and CISA KEV flag. Line 2: CVSS severity and base score. Line 3: EPSS percentile and publication date."))}">${t("Priority / severity")}</th><th>${idHeader}</th><th>${t("Dependency")}</th><th>${t("CWE")}</th><th>${t("Description")}</th><th>${t(images ? "Image / component update" : "Advisory-specific candidate")}</th><th>${t("Source")}</th>${actionHeader}</tr></thead>
|
|
1071
1157
|
<tbody>${rows}</tbody>
|
|
1072
1158
|
</table>`;
|
|
1073
1159
|
}
|
|
@@ -1154,14 +1240,14 @@ function buildFixRecommendations(cveMatches, outdatedResults, resolvedDeps) {
|
|
|
1154
1240
|
return { transitivesList, directsList };
|
|
1155
1241
|
}
|
|
1156
1242
|
|
|
1157
|
-
function renderFixRecommendations(recos, allMatches = [], outdatedResults = []) {
|
|
1243
|
+
function renderFixRecommendations(recos, allMatches = [], outdatedResults = [], chapter = 5) {
|
|
1158
1244
|
// Direct deps to update. Aggregates every direct dep (not
|
|
1159
1245
|
// transitive, not parent, not vendored) that has at least one CVE and
|
|
1160
1246
|
// picks the highest fix-version found across its CVEs as the target.
|
|
1161
1247
|
const directs = buildDirectDepsToUpdate(allMatches, outdatedResults);
|
|
1162
1248
|
const warning = `<div class="fp-intro">${t("Review these proposed changes manually: affected ranges, other vulnerabilities, dependency constraints and compatibility can make a suggested version unsuitable. Re-resolve and test the project after changes.")}</div>`;
|
|
1163
1249
|
const directsSection = directs.length
|
|
1164
|
-
? minorSection(
|
|
1250
|
+
? minorSection(`${chapter}.1 ${t("Direct deps to update")} (${directs.length})`, renderDirectDepsToUpdateTable(directs))
|
|
1165
1251
|
: "";
|
|
1166
1252
|
|
|
1167
1253
|
if (!recos.transitivesList.length && !recos.directsList.length) {
|
|
@@ -1190,7 +1276,7 @@ function renderFixRecommendations(recos, allMatches = [], outdatedResults = [])
|
|
|
1190
1276
|
const meta = ECO_RECIPE[eco];
|
|
1191
1277
|
const inner = renderRecommendationsForEco(slice, meta);
|
|
1192
1278
|
const recoN = slice.trans.length + slice.directs.length;
|
|
1193
|
-
out.push(minorSection(
|
|
1279
|
+
out.push(minorSection(`${chapter}.${sectionNo++} ${meta.label} (${recoN})`, inner));
|
|
1194
1280
|
}
|
|
1195
1281
|
return out.join("") || `<div class="empty">${t("No actionable recommendations.")}</div>`;
|
|
1196
1282
|
}
|
|
@@ -1297,7 +1383,7 @@ function renderRecommendationsForEco(slice, meta) {
|
|
|
1297
1383
|
return `<tr>
|
|
1298
1384
|
<td>${badge(d.maxSeverity)}</td>
|
|
1299
1385
|
<td class="dep">${esc(d.key)}</td>
|
|
1300
|
-
<td>${updateNote}${d.releaseDate ? `<div class="confidence">${t("latest released {date}", { date:
|
|
1386
|
+
<td>${updateNote}${d.releaseDate ? `<div class="confidence">${t("latest released {date}", { date: renderTimestamp(d.releaseDate) })}</div>` : ""}</td>
|
|
1301
1387
|
<td class="confidence">${t("{n} CVE in transitives", { n: d.cveCount })}</td>
|
|
1302
1388
|
<td class="dep">${d.transitivesArr.slice(0, 4).map(x => esc(x.key) + ` (${x.cveCount})`).join("<br>")}${d.transitivesArr.length > 4 ? `<div class="confidence">${t("+{n} more", { n: d.transitivesArr.length - 4 })}</div>` : ""}</td>
|
|
1303
1389
|
</tr>`;
|
|
@@ -1481,6 +1567,8 @@ function renderEolDetail(e) {
|
|
|
1481
1567
|
if (vs && (vs.via === "bom" || vs.via === "parent") && vs.bom) {
|
|
1482
1568
|
blocks.push(`<div class="panel-title">${t("version managed by:")}</div><code>${esc(vs.bom)}</code> (${vs.via === "parent" ? t("parent POM") : "BOM"})`);
|
|
1483
1569
|
}
|
|
1570
|
+
const graphSource = renderGraphVersionSource(d);
|
|
1571
|
+
if (graphSource) blocks.push(graphSource);
|
|
1484
1572
|
if (!blocks.length) blocks.push(`<div class="confidence">${t("No descriptor recorded for this finding.")}</div>`);
|
|
1485
1573
|
return `<div class="eol-subwrap">${blocks.join("")}</div>`;
|
|
1486
1574
|
}
|
|
@@ -1494,7 +1582,7 @@ function renderEolTable(eolResults) {
|
|
|
1494
1582
|
<tbody>${list.map(e => `<tr class="cve-row">
|
|
1495
1583
|
<td class="dep">${esc(e.product)}</td>
|
|
1496
1584
|
<td class="dep">${esc(depDisplayName(e.dep))}<br><span style="color:#6b7280">${esc(e.dep.version || "?")}</span>${renderEolComponents(e)}${renderDepOrigin(e.dep, RENDER_CTX.srcRoot)}</td>
|
|
1497
|
-
<td>${
|
|
1585
|
+
<td>${renderTimestamp(eolDateCell(e))}</td>
|
|
1498
1586
|
<td>${esc(e.latest || "")}</td>
|
|
1499
1587
|
<td class="dep">${renderEolSource(e)}</td>
|
|
1500
1588
|
<td class="desc">${esc(eolNotesCell(e))}</td>
|
|
@@ -1546,7 +1634,7 @@ function renderOutdatedTable(out) {
|
|
|
1546
1634
|
<td class="dep">${esc(depDisplayName(o.dep))}${renderDefinedIn(o.dep, RENDER_CTX.srcRoot)}</td>
|
|
1547
1635
|
<td class="dep">${esc(o.dep.version || "?")}</td>
|
|
1548
1636
|
<td class="dep">${esc(o.latest || "?")}</td>
|
|
1549
|
-
<td>${
|
|
1637
|
+
<td>${renderTimestamp(o.releaseDate || "")}</td>
|
|
1550
1638
|
</tr>`).join("\n");
|
|
1551
1639
|
return `<table data-tbl="outdated">
|
|
1552
1640
|
<thead><tr><th>${t("Jump")}</th><th>${t("Dependency")}</th><th>${t("Current")}</th><th>${t("Latest")}</th><th>${t("Released")}</th></tr></thead>
|
|
@@ -1581,8 +1669,11 @@ function summaryCards(stats, eol, obs, out, extra = {}) {
|
|
|
1581
1669
|
{ v: stats.low, l: t("Low"), cls: "sev-low" },
|
|
1582
1670
|
...(stats.kev ? [{ v: stats.kev, l: t("KEV exploited"), cls: "sev-kev" }] : []),
|
|
1583
1671
|
{ v: stats.total, l: t("Total CVEs") },
|
|
1584
|
-
|
|
1585
|
-
|
|
1672
|
+
...(extra.hasImages ? [
|
|
1673
|
+
{ v: extra.imageCount, l: t("Image findings") },
|
|
1674
|
+
...(extra.sourceCount ? [{ v: extra.sourceCount, l: t("Source findings") }] : []),
|
|
1675
|
+
...(extra.sourceCount ? [{ v: extra.sourceStats.direct, l: t("in Direct") }, { v: extra.sourceStats.transitive, l: t("in Transitive") }] : []),
|
|
1676
|
+
] : [{ v: stats.direct, l: t("in Direct") }, { v: stats.transitive, l: t("in Transitive") }]),
|
|
1586
1677
|
{ v: extra.vendored ?? 0, l: t("Vendored JS"), cls: "sev-vendored" },
|
|
1587
1678
|
{ v: eol?.length || 0, l: t("EOL") },
|
|
1588
1679
|
{ v: obs?.length || 0, l: t("Obsolete") },
|
|
@@ -1604,7 +1695,7 @@ function mergeMatches(matches) {
|
|
|
1604
1695
|
for (const m of matches) {
|
|
1605
1696
|
// A finding with a physical occurrence ID must never be merged with a
|
|
1606
1697
|
// different installation of the same package and version.
|
|
1607
|
-
const key = m.findingId || `${m.dep.groupId}:${m.dep.artifactId}
|
|
1698
|
+
const key = m.findingId || JSON.stringify([m.dep.artifactTargetId || "", m.dep.coordKey || `${m.dep.groupId}:${m.dep.artifactId}`, m.dep.version, m.dep.artifactTargetId ? m.dep.artifactPath : "", m.cve.id]);
|
|
1608
1699
|
if (!byKey.has(key)) {
|
|
1609
1700
|
// Deep-ish copy so we can mutate dep.viaPaths
|
|
1610
1701
|
byKey.set(key, { ...m, dep: { ...m.dep, viaPaths: m.dep.viaPaths ? [...m.dep.viaPaths] : (m.dep.via ? [m.dep.via] : []) } });
|
|
@@ -1915,6 +2006,7 @@ function numberedSubsections(chapter, entries) {
|
|
|
1915
2006
|
}
|
|
1916
2007
|
|
|
1917
2008
|
const WARNING_HEADINGS = {
|
|
2009
|
+
"image-scan-failed": { icon: "⚠️", title: "Image analysis blocked" },
|
|
1918
2010
|
"no-lockfile": { icon: "⚠️", title: "Manifests without a lockfile — best-effort (ranges skipped)" },
|
|
1919
2011
|
"parse-error": { icon: "⚠️", title: "Manifests that failed to parse — contents not scanned" },
|
|
1920
2012
|
"yarn-berry-unsupported": { icon: "⚠️", title: "Yarn 2+/Berry lockfile" },
|
|
@@ -1962,7 +2054,7 @@ function renderEcoSection(matches, sectionPrefix, srcRoot, ecoKey) {
|
|
|
1962
2054
|
.sort((a, b) => makeRelative(a[0], srcRoot).localeCompare(makeRelative(b[0], srcRoot)));
|
|
1963
2055
|
|
|
1964
2056
|
if (sortedManifests.length) {
|
|
1965
|
-
const manifestKind = ECO_MANIFEST_KIND[ecoKey] || t("manifest");
|
|
2057
|
+
const manifestKind = ecoKey === "gradle" ? t("Gradle descriptor") : ECO_MANIFEST_KIND[ecoKey] || t("manifest");
|
|
1966
2058
|
const perManifest = sortedManifests.map(([manifestPath, mList]) => {
|
|
1967
2059
|
const rel = makeRelative(manifestPath, srcRoot);
|
|
1968
2060
|
return minorSection(`<code class="path">${esc(rel)}</code> (${mList.length})`,
|
|
@@ -2075,7 +2167,7 @@ function execWeakness(m) {
|
|
|
2075
2167
|
return m.cve.id || t("an unspecified weakness");
|
|
2076
2168
|
}
|
|
2077
2169
|
|
|
2078
|
-
function renderExecutiveSummary({ projectInfo, prodStats, devStats, retireStats, eolResults, obsoleteResults, outdatedResults, warnings, totalDeps, topCriticalMatches, nativeBinaryCount = 0, interactive = false }) {
|
|
2170
|
+
function renderExecutiveSummary({ projectInfo, prodStats, devStats, retireStats, eolResults, obsoleteResults, outdatedResults, warnings, totalDeps, topCriticalMatches, nativeBinaryCount = 0, hasImages = false, interactive = false }) {
|
|
2079
2171
|
const unsN = (eolResults || []).filter(e => e.status === "unsupported").length;
|
|
2080
2172
|
const eolN = (eolResults?.length || 0) - unsN; // true end-of-life only
|
|
2081
2173
|
const obsN = obsoleteResults?.length || 0;
|
|
@@ -2099,15 +2191,15 @@ function renderExecutiveSummary({ projectInfo, prodStats, devStats, retireStats,
|
|
|
2099
2191
|
// Each row lists ALL of its CWEs right beside it (the weakness fingerprint
|
|
2100
2192
|
// of that specific finding) — NOT a separate report-wide CWE aggregate.
|
|
2101
2193
|
const topBlock = top.length ? `<div class="exec-top">
|
|
2102
|
-
<div class="exec-top-title">${t("Top {n} most critical · direct production dependencies", { n: top.length })}</div>
|
|
2194
|
+
<div class="exec-top-title">${hasImages ? t("Top {n} most critical · production findings", { n: top.length }) : t("Top {n} most critical · direct production dependencies", { n: top.length })}</div>
|
|
2103
2195
|
<ul class="exec-top-list">${top.map(m => {
|
|
2104
2196
|
const cwes = Array.isArray(m.cve.cwes) ? m.cve.cwes : [];
|
|
2105
2197
|
const cweChips = cwes.length ? `<span class="exec-cwes-chips">${cwes.map(c => cweChipHtml(c, cweName(c))).join("")}</span>` : "";
|
|
2106
|
-
const transitiveTag = m.dep?.scope === "transitive"
|
|
2198
|
+
const transitiveTag = !m.dep?.artifactTargetId && m.dep?.scope === "transitive"
|
|
2107
2199
|
? `<span class="exec-scope-tag" title="${esc(t("Pulled in transitively — fewer than {n} direct production findings, so the worst transitive ones fill the rest", { n: top.length }))}">${t("transitive")}</span>` : "";
|
|
2108
2200
|
return `<li>
|
|
2109
2201
|
${badge((m.cve.severity || "HIGH").toUpperCase())}
|
|
2110
|
-
<a class="exec-cve-link" href="#${m.
|
|
2202
|
+
<a class="exec-cve-link" href="#${m.dep?.artifactTargetId ? "chimages-cves" : m.applicationIds?.length ? "chapps" : "ch1"}">${esc(m.cve.id)}</a>
|
|
2111
2203
|
<code>${esc(depDisplayName(m.dep))}</code>
|
|
2112
2204
|
<span class="exec-ver">${esc(m.dep.version || "?")}</span>
|
|
2113
2205
|
${m.cve.fixVersion ? `<span class="exec-fix">${t("Advisory candidate")}: ${esc(m.cve.fixVersion)}</span>` : ""}
|
|
@@ -2119,8 +2211,8 @@ function renderExecutiveSummary({ projectInfo, prodStats, devStats, retireStats,
|
|
|
2119
2211
|
|
|
2120
2212
|
// ---- Block 2: the 2 most-overdue end-of-life frameworks ----
|
|
2121
2213
|
const eolWhen = e => e.status === "unsupported"
|
|
2122
|
-
? t("support ended {date}", { date:
|
|
2123
|
-
: (e.eol && e.eol !== "true" ? t("EOL since {date}", { date:
|
|
2214
|
+
? t("support ended {date}", { date: renderTimestamp(e.support || "?") })
|
|
2215
|
+
: (e.eol && e.eol !== "true" ? t("EOL since {date}", { date: renderTimestamp(e.eol) }) : t("end-of-life"));
|
|
2124
2216
|
const eolBlock = topEol.length ? `<div class="exec-eol">
|
|
2125
2217
|
<div class="exec-eol-title">${topEol.length === 1 ? t("Top end-of-life framework") : t("Top {n} end-of-life frameworks", { n: topEol.length })}</div>
|
|
2126
2218
|
<ul class="exec-eol-list">${topEol.map(e => `<li>
|
|
@@ -2131,7 +2223,7 @@ function renderExecutiveSummary({ projectInfo, prodStats, devStats, retireStats,
|
|
|
2131
2223
|
</li>`).join("")}</ul>
|
|
2132
2224
|
</div>` : "";
|
|
2133
2225
|
|
|
2134
|
-
// ---- Block 3:
|
|
2226
|
+
// ---- Block 3: totals, including the findings highlighted above ----
|
|
2135
2227
|
const restParts = [];
|
|
2136
2228
|
if (prodStats.total) restParts.push(`<strong>${prodStats.total}</strong> ${t("production CVE")} (critical=${prodStats.critical}, high=${prodStats.high}, medium=${prodStats.medium}, low=${prodStats.low})`);
|
|
2137
2229
|
if (devStats.total) restParts.push(`<strong>${devStats.total}</strong> ${t("dev/test CVE")}`);
|
|
@@ -2144,7 +2236,7 @@ function renderExecutiveSummary({ projectInfo, prodStats, devStats, retireStats,
|
|
|
2144
2236
|
if (outN) restParts.push(`<strong>${outN}</strong> ${t("outdated")}`);
|
|
2145
2237
|
if (nativeBinaryCount) restParts.push(`<strong>${nativeBinaryCount}</strong> ${t(nativeBinaryCount > 1 ? "unmanaged native binaries" : "unmanaged native binary")}`);
|
|
2146
2238
|
if (warnings?.length) restParts.push(`<strong>${warnings.length}</strong> ${t(warnings.length > 1 ? "scan alerts" : "scan alert")}`);
|
|
2147
|
-
const restBlock = `<div class="exec-rest"><span class="exec-rest-label">${t("
|
|
2239
|
+
const restBlock = `<div class="exec-rest"><span class="exec-rest-label">${t("Overall:")}</span> ${restParts.length ? restParts.join(" · ") : t("no findings")}</div>`;
|
|
2148
2240
|
|
|
2149
2241
|
// ---- Word-pasteable copy payload (built only for the interactive HTML) ----
|
|
2150
2242
|
let copyUi = "";
|
|
@@ -2155,7 +2247,7 @@ function renderExecutiveSummary({ projectInfo, prodStats, devStats, retireStats,
|
|
|
2155
2247
|
ver: m.dep.version || "?",
|
|
2156
2248
|
weakness: execWeakness(m),
|
|
2157
2249
|
crit: (m.cve.severity || "HIGH").toUpperCase(),
|
|
2158
|
-
transitive: m.dep?.scope === "transitive",
|
|
2250
|
+
transitive: !m.dep?.artifactTargetId && m.dep?.scope === "transitive",
|
|
2159
2251
|
}));
|
|
2160
2252
|
const eolSentence = e => {
|
|
2161
2253
|
const when = e.eol && e.eol !== "true" ? t("end-of-life since {date}", { date: e.eol }) : t("end-of-life");
|
|
@@ -2165,10 +2257,10 @@ function renderExecutiveSummary({ projectInfo, prodStats, devStats, retireStats,
|
|
|
2165
2257
|
});
|
|
2166
2258
|
return `- ${head}${e.latest ? t("; latest is {latest}", { latest: e.latest }) : ""}`;
|
|
2167
2259
|
};
|
|
2168
|
-
const restText = stripTags(restParts.join(" · ")) || t("no
|
|
2260
|
+
const restText = stripTags(restParts.join(" · ")) || t("no findings");
|
|
2169
2261
|
// NB: the loops below must not name their item `t` — it would shadow the translator.
|
|
2170
2262
|
// The count is a placeholder, not a prefix: "Top 2 les plus critiques" is not French.
|
|
2171
|
-
const critHeading = n => t("Top {n} most critical (direct production dependencies):", { n });
|
|
2263
|
+
const critHeading = n => hasImages ? t("Top {n} most critical · production findings", { n }) : t("Top {n} most critical (direct production dependencies):", { n });
|
|
2172
2264
|
const eolHeading = n => n > 1 ? t("Top {n} end-of-life frameworks:", { n }) : t("Top end-of-life framework:");
|
|
2173
2265
|
const critSentence = x => t('The library "{lib}" version "{ver}" is vulnerable to "{weakness}" ( {crit} )',
|
|
2174
2266
|
{ lib: x.lib, ver: x.ver, weakness: x.weakness, crit: x.crit });
|
|
@@ -2183,7 +2275,7 @@ function renderExecutiveSummary({ projectInfo, prodStats, devStats, retireStats,
|
|
|
2183
2275
|
plainLines.push("", eolHeading(topEol.length));
|
|
2184
2276
|
for (const e of topEol) plainLines.push(eolSentence(e));
|
|
2185
2277
|
}
|
|
2186
|
-
plainLines.push("", `${t("
|
|
2278
|
+
plainLines.push("", `${t("Overall:")} ${restText}`);
|
|
2187
2279
|
const plainText = plainLines.join("\n");
|
|
2188
2280
|
|
|
2189
2281
|
// Rich (text/html) — inline styles so Word keeps the formatting.
|
|
@@ -2204,7 +2296,7 @@ function renderExecutiveSummary({ projectInfo, prodStats, devStats, retireStats,
|
|
|
2204
2296
|
? `<p style="font-weight:bold; margin:12px 0 4px;">${esc(eolHeading(topEol.length))}</p>
|
|
2205
2297
|
<ul style="margin:0; padding-left:22px;">${topEol.map(e => `<li style="margin:3px 0;">${esc(stripTags(eolSentence(e)).replace(/^- /, ""))}</li>`).join("")}</ul>`
|
|
2206
2298
|
: "";
|
|
2207
|
-
const richRest = `<p style="margin:12px 0 0;"><b>${esc(t("
|
|
2299
|
+
const richRest = `<p style="margin:12px 0 0;"><b>${esc(t("Overall:"))}</b> ${esc(restText)}</p>`;
|
|
2208
2300
|
const richHtml = `<div style="font-family:Calibri,Arial,sans-serif; font-size:11pt; color:#1f2937;">`
|
|
2209
2301
|
+ `<p style="font-size:14pt; font-weight:bold; margin:0 0 2px;">${esc(t("Executive Summary"))} — ${esc(level)}</p>`
|
|
2210
2302
|
+ `<p style="margin:0 0 8px; color:#4b5563;">${esc(totalDeps)} ${esc(t("dependencies scanned"))}</p>`
|
|
@@ -2234,7 +2326,7 @@ function warningMessage(w) {
|
|
|
2234
2326
|
return t("{coord} {version} is not on Maven Central and is newer than the last public {product} {cycle} release ({lastPublic}): a vendor build under paid support{until}.",
|
|
2235
2327
|
{ coord: `<code>${esc(w.coord)}</code>`, version: `<code>${esc(w.version)}</code>`, product: esc(w.product), cycle: esc(w.cycle), lastPublic: esc(w.lastPublic), until });
|
|
2236
2328
|
}
|
|
2237
|
-
return w.capability
|
|
2329
|
+
return w.type === 'cms-coverage' && w.capability
|
|
2238
2330
|
? `${esc(w.applicationId || "application")} — ${esc(capabilityLabel(w.capability))}` +
|
|
2239
2331
|
`${w.sourceId ? ` (${esc(w.sourceId)})` : ""}: ${esc(executionLabel(w.execution))} — ` +
|
|
2240
2332
|
`${esc(t("{n} component(s) not evaluated", { n: w.count || 0 }))} (${esc(w.diagnostic || w.code || "CMS_INCOMPLETE")}). ` +
|
|
@@ -2242,16 +2334,7 @@ function warningMessage(w) {
|
|
|
2242
2334
|
: renderTextWithTimestamps(w.message || "");
|
|
2243
2335
|
}
|
|
2244
2336
|
|
|
2245
|
-
|
|
2246
|
-
// specific freshness diagnostics in the warnings list; summarize these dated
|
|
2247
|
-
// notices separately without changing the structured JSON or strict gates.
|
|
2248
|
-
function freshnessNotice(w, online = false) {
|
|
2249
|
-
if (w.type !== 'source-stale') return null;
|
|
2250
|
-
const match = /^([A-Za-z][\w.-]*): (?:the source could not be refreshed; )?cached data (?:from (\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z)|of unknown age) was used\./.exec(w.message || '') ||
|
|
2251
|
-
/^([A-Za-z][\w.-]*): cached data (?:from (\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z)|of unknown age) was used and may be outdated\./.exec(w.message || '');
|
|
2252
|
-
if (match) return {source: match[1], at: match[2] || null, message: w.message};
|
|
2253
|
-
return online ? {message: w.message} : null;
|
|
2254
|
-
}
|
|
2337
|
+
const freshnessNotice = require('./report-notices').legacyFreshness;
|
|
2255
2338
|
function renderFreshnessNotices(notices) {
|
|
2256
2339
|
if (!notices.length) return '';
|
|
2257
2340
|
const pills = notices.filter(n => n.source).map(n => `<span class="freshness-pill" title="${esc(n.message)}"><strong>${esc(n.source)}</strong> · ${n.at ? renderTimestamp(n.at) : esc(t('unknown date'))}</span>`).join(' ');
|
|
@@ -2265,19 +2348,13 @@ function renderWarnings(warnings) {
|
|
|
2265
2348
|
// intentionally broken CMS test fixture — are grouped into one navigable block per
|
|
2266
2349
|
// type. Every manifest stays listed with its own detail, and the JSON export keeps one
|
|
2267
2350
|
// entry per manifest, so the grouping hides noise without hiding coverage loss.
|
|
2268
|
-
const prepared =
|
|
2269
|
-
const groupable = new Set(["no-lockfile", "parse-error"]);
|
|
2270
|
-
for (const w of warnings) {
|
|
2271
|
-
if (!groupable.has(w.type)) { prepared.push(w); continue; }
|
|
2272
|
-
let group = prepared.find(x => x._grouped === w.type);
|
|
2273
|
-
if (!group) { group = { type: w.type, _grouped: w.type, count: 0, items: [] }; prepared.push(group); }
|
|
2274
|
-
group.count += 1;
|
|
2275
|
-
group.items.push({ id: makeRelative(w.manifestPath || "", RENDER_CTX.srcRoot), detail: w.message });
|
|
2276
|
-
}
|
|
2351
|
+
const prepared = require('./report-notices').groupReportWarnings(warnings);
|
|
2277
2352
|
const blocks = prepared.map(w => {
|
|
2278
2353
|
const meta = WARNING_HEADINGS[w.type] || { icon: "⚠️", title: w.type };
|
|
2279
|
-
const itemLimit = w.type === "private-libs" ? 200 : 50;
|
|
2280
|
-
const
|
|
2354
|
+
const itemLimit = w._groupedDiagnostics ? (w.items||[]).length : w.type === "private-libs" ? 200 : 50;
|
|
2355
|
+
const warningItems = [...(w.items || []), ...(w.artifactTargetId ? [{id:w.artifactTargetId,artifactTargetId:w.artifactTargetId}] : [])];
|
|
2356
|
+
const details = renderWarningItems(warningItems, itemLimit);
|
|
2357
|
+
const items = w._groupedDiagnostics && details ? `<details class="warning-details"><summary>${esc(t('Details'))} (${w.items.length})</summary>${details}</details>` : details;
|
|
2281
2358
|
const manifest = w.manifestPath ? `<div class="warn-path"><code>${esc(makeRelative(w.manifestPath, RENDER_CTX.srcRoot))}</code></div>` : "";
|
|
2282
2359
|
// Structured CMS coverage groups (one per application/capability/source/diagnostic
|
|
2283
2360
|
// cause) render their reason, their action and their component list in the
|
|
@@ -2304,7 +2381,8 @@ function renderWarningItems(items, itemLimit) {
|
|
|
2304
2381
|
const shown = items.slice(0, itemLimit);
|
|
2305
2382
|
const lis = shown.map(it => {
|
|
2306
2383
|
if (typeof it === "string") return `<li><code>${esc(it)}</code></li>`;
|
|
2307
|
-
const
|
|
2384
|
+
const artifact = it.artifactTargetId && RENDER_CTX.artifacts?.find(a=>a.id===it.artifactTargetId);
|
|
2385
|
+
const id = artifact ? require("./artifacts/report").artifactTitle(artifact, RENDER_CTX.artifacts) : it.pathItem ? makeRelative(it.id || "", RENDER_CTX.srcRoot) : it.id || "";
|
|
2308
2386
|
const detail = it.detail ? `<div class="warn-defined">${esc(it.detail)}</div>` : "";
|
|
2309
2387
|
const paths = (it.manifestPaths || []).slice(0, 6);
|
|
2310
2388
|
const pathsHtml = paths.length
|
|
@@ -2354,7 +2432,7 @@ function renderLicenseChapter(licenseResults) {
|
|
|
2354
2432
|
}
|
|
2355
2433
|
|
|
2356
2434
|
function buildBody({ cveMatches, devCveMatches, embeddedMatches, retireMatches, vendoredJsInventory, certFindings, eolResults, obsoleteResults, outdatedResults, licenseResults, excludedDirs = [], resolvedDeps, projectInfo, warnings, parsedManifests = [], diff = null, applications = [], applicationInventory = [], applicationRelations = [], coverage = [], wrapTables = true, locale = "en" }) {
|
|
2357
|
-
setRenderCtx({ srcRoot: projectInfo?.src || null, locale });
|
|
2435
|
+
setRenderCtx({ srcRoot: projectInfo?.src || null, artifacts:projectInfo?.artifacts || [], locale });
|
|
2358
2436
|
// Module names for BOTH the "most vulnerable components" chart and every cell's
|
|
2359
2437
|
// "defined in" label. Resolved here, before a single table is rendered, because
|
|
2360
2438
|
// renderDefinedIn reads them from the render context.
|
|
@@ -2365,6 +2443,14 @@ function buildBody({ cveMatches, devCveMatches, embeddedMatches, retireMatches,
|
|
|
2365
2443
|
cveMatches = mergeMatches(cveMatches || []);
|
|
2366
2444
|
devCveMatches = mergeMatches(devCveMatches || []);
|
|
2367
2445
|
embeddedMatches = mergeMatches(embeddedMatches || []);
|
|
2446
|
+
// Preserve distribution verdicts for inventory/update evidence; the CVE chapter
|
|
2447
|
+
// presents the explicitly identified CVEs, with their advisory provenance.
|
|
2448
|
+
const rawImageMatches = mergeMatches([...cveMatches, ...devCveMatches, ...embeddedMatches].filter(m => m.dep?.artifactTargetId && !m.cpeFiltered));
|
|
2449
|
+
const { projectImageCves } = require("./artifacts/cve-view");
|
|
2450
|
+
const imageView = matches => [...matches.filter(m => !m.dep?.artifactTargetId), ...projectImageCves(matches.filter(m => m.dep?.artifactTargetId))];
|
|
2451
|
+
cveMatches = imageView(cveMatches);
|
|
2452
|
+
devCveMatches = imageView(devCveMatches);
|
|
2453
|
+
embeddedMatches = imageView(embeddedMatches);
|
|
2368
2454
|
retireMatches = retireMatches || [];
|
|
2369
2455
|
attachRootUpdates(cveMatches, outdatedResults, resolvedDeps);
|
|
2370
2456
|
attachRootUpdates(devCveMatches, outdatedResults, resolvedDeps);
|
|
@@ -2385,18 +2471,24 @@ function buildBody({ cveMatches, devCveMatches, embeddedMatches, retireMatches,
|
|
|
2385
2471
|
const retireStats = computeStats(retireMatches);
|
|
2386
2472
|
|
|
2387
2473
|
// Recos are built from prod matches only (dev/test issues aren't a release blocker).
|
|
2388
|
-
const
|
|
2389
|
-
|
|
2390
|
-
const
|
|
2391
|
-
const
|
|
2392
|
-
const
|
|
2393
|
-
const
|
|
2474
|
+
const sourceMatches = prodMatchesActive.filter(m => !m.dep?.artifactTargetId);
|
|
2475
|
+
const recos = buildFixRecommendations(sourceMatches, outdatedResults, resolvedDeps);
|
|
2476
|
+
const imageMatches = [...prodMatchesActive, ...devMatchesActive, ...embMatchesActive].filter(m => m.dep?.artifactTargetId);
|
|
2477
|
+
const { renderImageCves, renderArtifactEvidence, artifactGroups, artifactAnchor, artifactTitle } = require("./artifacts/report");
|
|
2478
|
+
const hasImages = Boolean(projectInfo?.artifacts?.length || projectInfo?.imageReferences?.length || rawImageMatches.length);
|
|
2479
|
+
const chapterOffset = hasImages ? 1 : 0;
|
|
2480
|
+
const sourceDeps = new Map([...(resolvedDeps || [])].filter(([, d]) => !d.artifactTargetId));
|
|
2481
|
+
|
|
2482
|
+
const applicationMatches = prodMatchesActive.filter(m => !m.dep?.artifactTargetId && m.applicationIds?.length);
|
|
2483
|
+
const genericMatches = prodMatchesActive.filter(m => !m.dep?.artifactTargetId && !m.applicationIds?.length);
|
|
2484
|
+
const applicationDevMatches = devMatchesActive.filter(m => !m.dep?.artifactTargetId && m.applicationIds?.length);
|
|
2485
|
+
const genericDevMatches = devMatchesActive.filter(m => !m.dep?.artifactTargetId && !m.applicationIds?.length);
|
|
2394
2486
|
const knownAppIds = new Set(applications.map(app => app.id));
|
|
2395
|
-
const
|
|
2396
|
-
const
|
|
2397
|
-
const
|
|
2398
|
-
const freshnessNotices = [...(projectInfo?.provenance?.freshnessNotices || []), ...
|
|
2399
|
-
const
|
|
2487
|
+
const classified = require('./report-notices').partitionReportNotices(warnings || []);
|
|
2488
|
+
const applicationWarnings = classified.warnings.filter(w => w.type === "cms-coverage" && knownAppIds.has(w.applicationId));
|
|
2489
|
+
const generalWarnings = require('./report-notices').groupReportWarnings(classified.warnings.filter(w => !applicationWarnings.includes(w)));
|
|
2490
|
+
const freshnessNotices = [...(projectInfo?.provenance?.freshnessNotices || []), ...classified.freshness];
|
|
2491
|
+
const informationalNotices = [...(projectInfo?.provenance?.notices || []), ...classified.notices];
|
|
2400
2492
|
const prodAppIds = new Set(applicationMatches.flatMap(m => m.applicationIds || []));
|
|
2401
2493
|
const devAppIds = new Set(applicationDevMatches.flatMap(m => m.applicationIds || []));
|
|
2402
2494
|
const prodAppWarnings = applicationWarnings.filter(w => prodAppIds.has(w.applicationId));
|
|
@@ -2409,9 +2501,9 @@ function buildBody({ cveMatches, devCveMatches, embeddedMatches, retireMatches,
|
|
|
2409
2501
|
const licenseContent = renderLicenseChapter(licenseResults);
|
|
2410
2502
|
const licenseTotal = licenseResults?.assessed?.length || 0;
|
|
2411
2503
|
const licenseFlagged = licenseResults?.flagged?.length || 0;
|
|
2412
|
-
const embeddedInventory = buildEmbeddedInventory(
|
|
2413
|
-
const embeddedContent = renderEmbeddedChapter(embeddedInventory, embMatchesActive, projectInfo?.src);
|
|
2414
|
-
const unmanagedInventory = buildInventory(
|
|
2504
|
+
const embeddedInventory = buildEmbeddedInventory(sourceDeps, embMatchesActive.filter(m => !m.dep?.artifactTargetId));
|
|
2505
|
+
const embeddedContent = renderEmbeddedChapter(embeddedInventory, embMatchesActive.filter(m => !m.dep?.artifactTargetId), projectInfo?.src);
|
|
2506
|
+
const unmanagedInventory = buildInventory(sourceDeps);
|
|
2415
2507
|
const unmanagedContent = renderUnmanagedInventory(unmanagedInventory, projectInfo?.src);
|
|
2416
2508
|
const vendoredJsInv = vendoredJsInventory || [];
|
|
2417
2509
|
const vendoredJsContent = renderVendoredJsInventory(vendoredJsInv, projectInfo?.src);
|
|
@@ -2429,19 +2521,19 @@ function buildBody({ cveMatches, devCveMatches, embeddedMatches, retireMatches,
|
|
|
2429
2521
|
|
|
2430
2522
|
// Committed native binaries no package manager governs (provenance:"binary",
|
|
2431
2523
|
// no resolved version) — surfaced as a count in the exec summary's rest line.
|
|
2432
|
-
const nativeBinaryCount = [...(resolvedDeps?.values?.() || [])].filter(d => d.provenance === "binary").length;
|
|
2524
|
+
const nativeBinaryCount = [...(resolvedDeps?.values?.() || [])].filter(d => d.provenance === "binary" && !d.artifactTargetId).length;
|
|
2433
2525
|
|
|
2434
2526
|
const exec = renderExecutiveSummary({
|
|
2435
2527
|
projectInfo, prodStats, devStats, retireStats,
|
|
2436
2528
|
eolResults, obsoleteResults, outdatedResults,
|
|
2437
2529
|
warnings: generalWarnings, totalDeps: resolvedDeps?.size || 0,
|
|
2438
2530
|
topCriticalMatches: pickTopCriticalMatches(prodMatchesActive, 3),
|
|
2439
|
-
nativeBinaryCount,
|
|
2531
|
+
nativeBinaryCount, hasImages,
|
|
2440
2532
|
interactive: wrapTables, // copy button + scripts only in the HTML output
|
|
2441
2533
|
});
|
|
2442
2534
|
|
|
2443
2535
|
// ---- Chapters are grouped under "root" chapters (a two-level hierarchy) ----
|
|
2444
|
-
const scanned = buildScannedManifests(
|
|
2536
|
+
const scanned = buildScannedManifests(sourceDeps, projectInfo?.src, parsedManifests);
|
|
2445
2537
|
const fpTotal = prodMatchesFP.length + devMatchesFP.length + embMatchesFP.length;
|
|
2446
2538
|
const eolTotal = eolResults?.length || 0;
|
|
2447
2539
|
const unsTotal = (eolResults || []).filter(e => e.status === "unsupported").length;
|
|
@@ -2458,10 +2550,10 @@ function buildBody({ cveMatches, devCveMatches, embeddedMatches, retireMatches,
|
|
|
2458
2550
|
const certPrivTotal = certInv.filter(c => c.kind === "private-key").length;
|
|
2459
2551
|
const excTotal = excludedDirs?.length || 0;
|
|
2460
2552
|
// CVE root header breakdown: direct vs indirect (transitive) production vulns + the dev count.
|
|
2461
|
-
const prodDirect = prodMatchesActive.filter(m => m.dep?.scope !== "transitive").length;
|
|
2462
|
-
const prodIndirect = prodMatchesActive.filter(m => m.dep?.scope === "transitive").length;
|
|
2463
|
-
const devDirect = devMatchesActive.filter(m => m.dep?.scope !== "transitive").length;
|
|
2464
|
-
const devIndirect = devMatchesActive.filter(m => m.dep?.scope === "transitive").length;
|
|
2553
|
+
const prodDirect = prodMatchesActive.filter(m => !m.dep?.artifactTargetId && m.dep?.scope !== "transitive").length;
|
|
2554
|
+
const prodIndirect = prodMatchesActive.filter(m => !m.dep?.artifactTargetId && m.dep?.scope === "transitive").length;
|
|
2555
|
+
const devDirect = devMatchesActive.filter(m => !m.dep?.artifactTargetId && m.dep?.scope !== "transitive").length;
|
|
2556
|
+
const devIndirect = devMatchesActive.filter(m => !m.dep?.artifactTargetId && m.dep?.scope === "transitive").length;
|
|
2465
2557
|
|
|
2466
2558
|
// The application view is the first CVE section whenever an application was
|
|
2467
2559
|
// inventoried (a zero-finding instance still shows its synthesis and coverage —
|
|
@@ -2485,49 +2577,66 @@ function buildBody({ cveMatches, devCveMatches, embeddedMatches, retireMatches,
|
|
|
2485
2577
|
{ show: retireMatches.length > 0, id: "ch2", title: `${t("Vendored JS vulns")} — retire.js (${retireMatches.length})`, nav: `${t("Vendored JS")} (${retireMatches.length})`, content: vendoredContent },
|
|
2486
2578
|
{ show: genericDevMatches.length > 0, id: "ch3", title: `${t("Dev dependencies")} (${genericDevMatches.length})`, nav: `${t("Dev")} (${genericDevMatches.length})`, content: n => renderCveBySectionByEco(genericDevMatches, n, projectInfo?.src) },
|
|
2487
2579
|
{ show: fpTotal > 0, id: "ch9", title: `${t("Likely false positives — CPE-filtered")} (${fpTotal})`, nav: `${t("Likely FP")} (${fpTotal})`, content: fpContent },
|
|
2580
|
+
{ show: hasImages, id: "chimages-cves", title: `${t("Images")} (${imageMatches.length})`, nav: `${t("Images")} (${imageMatches.length})`, content: () => renderImageCves(projectInfo, imageMatches, locale, { renderCveTable, minorSection }) },
|
|
2488
2581
|
]);
|
|
2489
|
-
const
|
|
2582
|
+
const cveCounts = [
|
|
2583
|
+
prodDirect ? t("{n} direct prod", { n: prodDirect }) : "",
|
|
2584
|
+
prodIndirect ? t("{n} indirect prod", { n: prodIndirect }) : "",
|
|
2585
|
+
devDirect ? t("{n} direct dev/test", { n: devDirect }) : "",
|
|
2586
|
+
devIndirect ? t("{n} indirect dev/test", { n: devIndirect }) : "",
|
|
2587
|
+
imageMatches.length ? `${t("Images")}: ${imageMatches.length}` : "",
|
|
2588
|
+
retireMatches.length ? `${t("Vendored JS")}: ${retireMatches.length}` : "",
|
|
2589
|
+
].filter(Boolean);
|
|
2590
|
+
const hasScannable = [...(resolvedDeps?.values?.() || [])].some(d => d.version) ||
|
|
2591
|
+
(projectInfo.artifacts || []).some(a => a.components?.some(c => c.version) || (!a.components && a.componentCount > 0)) ||
|
|
2592
|
+
vendoredJsInv.length > 0 || embeddedInventory.some(d => d.version);
|
|
2593
|
+
const emptyCveLabel = hasScannable ? t("No CVEs detected") : t("No scannable components");
|
|
2594
|
+
const cveRoot = majorSection(`1. ${t("CVE")} (${cveCounts.join(", ") || emptyCveLabel})`,
|
|
2490
2595
|
cveSections.html || `<div class="empty">${t("No CVE matches.")}</div>`, { id: "chcve" });
|
|
2491
2596
|
|
|
2492
|
-
const
|
|
2597
|
+
const imageRoot = hasImages ? majorSection(`2. ${t("Images & OS")}`, renderArtifactEvidence(projectInfo, locale, rawImageMatches), { id: "chimages" }) : "";
|
|
2598
|
+
const binSections = numberedSubsections(2 + chapterOffset, [
|
|
2493
2599
|
{ show: embTotal > 0, id: "ch1e", title: `${t("Embedded binaries")} — JAR/WAR/EAR (${embTotal})`, nav: `${t("Embedded")} (${embTotal})`, content: embeddedContent },
|
|
2494
2600
|
{ show: unmTotal > 0, id: "ch1c", title: `${t("Unmanaged / vendored native binaries")} (${unmTotal})`, nav: `${t("Native")} (${unmTotal})`, content: unmanagedContent },
|
|
2495
2601
|
{ show: vjsTotal > 0, id: "ch1d", title: `${t("Unmanaged / vendored JavaScript")} (${vjsTotal})`, nav: `${t("Vendored JS")} (${vjsTotal})`, content: vendoredJsContent },
|
|
2496
2602
|
{ show: certTotal > 0, id: "ch1f", title: `${t("Certificates & key material")} (${certTotal}${certPrivTotal ? ", " + plural(certPrivTotal, "{n} private key", "{n} private keys") : ""})`, nav: `${t("Crypto")} (${certTotal})`, content: certContent },
|
|
2497
2603
|
]);
|
|
2498
|
-
const binRoot = majorSection(
|
|
2604
|
+
const binRoot = majorSection(`${2 + chapterOffset}. ${t("Unmanaged / unversioned components")} (${t("{emb} embedded, {nat} native, {vjs} vendored JS, {crypto} crypto", { emb: embTotal, nat: unmTotal, vjs: vjsTotal, crypto: certTotal })})`,
|
|
2499
2605
|
binSections.html || `<div class="empty">${t("No unmanaged binaries, vendored JavaScript or committed crypto material found.")}</div>`, { id: "chbin" });
|
|
2500
2606
|
|
|
2501
2607
|
const eolTitle = unsTotal ? `${t("End-of-Life / out-of-support frameworks")} (${eolCount})` : `${t("End-of-Life frameworks")} (${eolTotal})`;
|
|
2502
|
-
const maintSections = numberedSubsections(3, [
|
|
2608
|
+
const maintSections = numberedSubsections(3 + chapterOffset, [
|
|
2503
2609
|
{ show: eolTotal > 0, id: "ch4", title: eolTitle, nav: `${t("EOL")} (${eolTotal})`, content: () => renderEolTable(eolResults) },
|
|
2504
2610
|
{ show: obsTotal > 0, id: "ch5", title: `${t("Obsolete / deprecated")} (${obsTotal})`, nav: `${t("Obsolete")} (${obsTotal})`, content: () => renderObsoleteTable(obsoleteResults) },
|
|
2505
2611
|
{ show: outTotal > 0, id: "ch6", title: `${t("Outdated")} (${outTotal})`, nav: `${t("Outdated")} (${outTotal})`, content: () => renderOutdatedTable(outdatedResults) },
|
|
2506
2612
|
]);
|
|
2507
|
-
const maintRoot = majorSection(
|
|
2613
|
+
const maintRoot = majorSection(`${3 + chapterOffset}. ${t("Maintenance / EOL")} (${eolCount}, ${t("{n} obsolete", { n: obsTotal })}, ${t("{n} outdated", { n: outTotal })})`,
|
|
2508
2614
|
maintSections.html || `<div class="empty">${t("No end-of-life frameworks detected.")}</div>`, { id: "chmaint" });
|
|
2509
2615
|
|
|
2510
|
-
const licRoot = majorSection(
|
|
2511
|
-
const
|
|
2616
|
+
const licRoot = majorSection(`${4 + chapterOffset}. ${t("Licenses")} (${licenseTotal}${licenseFlagged ? ", " + t("{n} to review", { n: licenseFlagged }) : ""})`, licenseContent, { id: "ch7" });
|
|
2617
|
+
const imageFixLink = hasImages ? `<p><a href="#chimages">${t("Replace or rebuild the image — remediation details")}</a></p>` : "";
|
|
2618
|
+
const fixRoot = majorSection(`${5 + chapterOffset}. ${t("Fix Recommendations")}`, imageFixLink +
|
|
2619
|
+
(hasImages && !sourceMatches.length && !outdatedResults?.length ? "" : renderFixRecommendations(recos, sourceMatches, outdatedResults, 5 + chapterOffset)), { id: "ch8" });
|
|
2512
2620
|
|
|
2513
|
-
const scanSections = numberedSubsections(6, [
|
|
2621
|
+
const scanSections = numberedSubsections(6 + chapterOffset, [
|
|
2514
2622
|
{ show: scanned.length > 0, id: "chsrc", title: `${t("Scanned dependency descriptors")} (${scanned.length})`, nav: `${t("Descriptors")} (${scanned.length})`, content: () => renderScannedManifests(scanned) },
|
|
2515
2623
|
{ show: excTotal > 0, id: "chexcl", title: `${t("Ignored directories")} (${excTotal})`, nav: `${t("Ignored dirs")} (${excTotal})`, content: () => renderExcludedDirs(excludedDirs) },
|
|
2516
|
-
{ show: true, id: "chmethod", title: t("Methodology, data sources & limitations"), nav: t("Methodology"), content: () => renderMethodologyChapter(projectInfo) },
|
|
2624
|
+
{ show: true, id: "chmethod", title: t("Methodology, data sources & limitations"), nav: t("Methodology"), content: () => renderMethodologyChapter(projectInfo, {freshnessNotices, informationalNotices}) },
|
|
2517
2625
|
{ show: applications.length > 0 || applicationInventory.length > 0 || coverage.length > 0, id: "chappinv", title: t("Application inventory & coverage"), nav: t("Application inventory & coverage"), content: () => renderApplicationInventory(applications, applicationInventory, coverage, inventoryAppWarnings) },
|
|
2518
2626
|
]);
|
|
2519
|
-
const scanRoot = majorSection(
|
|
2627
|
+
const scanRoot = majorSection(`${6 + chapterOffset}. ${t("Scan context & limitations")}`, scanSections.html, { id: "chscan" });
|
|
2520
2628
|
|
|
2521
2629
|
// (C) Table of contents — sticky nav, hierarchical (roots + indented sub-chapters).
|
|
2522
2630
|
const toc = renderToc([
|
|
2523
|
-
...(generalWarnings.length
|
|
2631
|
+
...(generalWarnings.length ? [{ id: "ch0", label: `0. ${t("Warnings")}` }] : []),
|
|
2524
2632
|
...(diff && diff.summary ? [{ id: "chdiff", label: `Δ ${t("Baseline diff")}` }] : []),
|
|
2525
2633
|
{ id: "chcve", label: `1. ${t("CVE")} (${prodStats.total + devStats.total + retireStats.total})`, sub: cveSections.toc },
|
|
2526
|
-
{ id: "
|
|
2527
|
-
{ id: "
|
|
2528
|
-
{ id: "
|
|
2529
|
-
{ id: "
|
|
2530
|
-
{ id: "
|
|
2634
|
+
...(hasImages ? [{ id: "chimages", label: `2. ${t("Images & OS")}`, sub: artifactGroups(projectInfo, imageMatches).map(({ artifact }) => ({ id: artifactAnchor(artifact.id), label: artifactTitle(artifact, projectInfo.artifacts || []) })) }] : []),
|
|
2635
|
+
{ id: "chbin", label: `${2 + chapterOffset}. ${t("Unmanaged components")} (${embTotal + unmTotal + vjsTotal + certTotal})`, sub: binSections.toc },
|
|
2636
|
+
{ id: "chmaint", label: `${3 + chapterOffset}. ${t("Maintenance/EOL")} (${eolTotal + obsTotal + outTotal})`, sub: maintSections.toc },
|
|
2637
|
+
{ id: "ch7", label: `${4 + chapterOffset}. ${t("Licenses")} (${licenseTotal}${licenseFlagged ? `, ${licenseFlagged}⚠` : ""})` },
|
|
2638
|
+
{ id: "ch8", label: `${5 + chapterOffset}. ${t("Fix Recos")}` },
|
|
2639
|
+
{ id: "chscan", label: `${6 + chapterOffset}. ${t("Scan context")}`, sub: scanSections.toc },
|
|
2531
2640
|
]);
|
|
2532
2641
|
|
|
2533
2642
|
// Overview charts row, rendered right under the compact totals.
|
|
@@ -2536,7 +2645,7 @@ function buildBody({ cveMatches, devCveMatches, embeddedMatches, retireMatches,
|
|
|
2536
2645
|
// its path relative to the scan root. Single-descriptor scans keep the scope chart.
|
|
2537
2646
|
// moduleNames was resolved at the top of buildBody — every table is rendered by then.
|
|
2538
2647
|
const chartsRow = renderCharts(
|
|
2539
|
-
{ prodMatches: prodMatchesActive, moduleNames, descriptorCount: moduleNames.size,
|
|
2648
|
+
{ prodMatches: prodMatchesActive, artifacts: projectInfo.artifacts || [], moduleNames, descriptorCount: moduleNames.size,
|
|
2540
2649
|
applications, applicationInventory, coverage },
|
|
2541
2650
|
{ interactive: wrapTables, t, cweName: id => cweTitle(id).name });
|
|
2542
2651
|
|
|
@@ -2550,14 +2659,15 @@ function buildBody({ cveMatches, devCveMatches, embeddedMatches, retireMatches,
|
|
|
2550
2659
|
</div>
|
|
2551
2660
|
</header>
|
|
2552
2661
|
${exec}
|
|
2553
|
-
${summaryCards(prodStats, eolResults, obsoleteResults, outdatedResults, { warnings: generalWarnings, vendored: retireMatches.length, licenseFlagged })}
|
|
2662
|
+
${summaryCards(prodStats, eolResults, obsoleteResults, outdatedResults, { warnings: generalWarnings, vendored: retireMatches.length, licenseFlagged, hasImages, imageCount: prodMatchesActive.filter(m => m.dep?.artifactTargetId).length, sourceCount: sourceMatches.length, sourceStats: computeStats(sourceMatches) })}
|
|
2554
2663
|
${chartsRow}
|
|
2555
2664
|
${toc}
|
|
2556
2665
|
${toolbar}
|
|
2557
2666
|
|
|
2558
|
-
${generalWarnings.length
|
|
2667
|
+
${generalWarnings.length ? majorSection(`0. ${t("Warnings & scan-completeness")} (${generalWarnings.length})`, renderWarnings(generalWarnings), { open: true, id: "ch0" }) : ""}
|
|
2559
2668
|
${(diff && diff.summary) ? majorSection(`Δ ${t("Changes since baseline")} (${t("+{n} new prod CVE", { n: diff.summary.cve.addedProduction })})`, renderDiffChapter(diff), { open: true, id: "chdiff" }) : ""}
|
|
2560
2669
|
${cveRoot}
|
|
2670
|
+
${imageRoot}
|
|
2561
2671
|
${binRoot}
|
|
2562
2672
|
${maintRoot}
|
|
2563
2673
|
${licRoot}
|
|
@@ -2592,7 +2702,7 @@ function coordKeyOf(dep) {
|
|
|
2592
2702
|
* downstream). Deduped per dep coord so the list shows distinct libraries.
|
|
2593
2703
|
*/
|
|
2594
2704
|
function pickTopCriticalMatches(prodMatches, n) {
|
|
2595
|
-
const isTransitive = m => m.dep?.scope === "transitive";
|
|
2705
|
+
const isTransitive = m => !m.dep?.artifactTargetId && m.dep?.scope === "transitive";
|
|
2596
2706
|
const direct = (prodMatches || []).filter(m => !isTransitive(m)).slice().sort(byCvePriority);
|
|
2597
2707
|
const transitive = (prodMatches || []).filter(isTransitive).slice().sort(byCvePriority);
|
|
2598
2708
|
const seen = new Set();
|
|
@@ -2717,7 +2827,9 @@ function renderUnmanagedInventory(inventory, srcRoot) {
|
|
|
2717
2827
|
return keys.filter(key => Object.hasOwn(m, key) && typeof m[key] === "string" && m[key])
|
|
2718
2828
|
.map(key => `<div><strong>${esc(labels.has(key) ? t(labels.get(key)) : key)}:</strong> ${esc(m[key])}</div>`).join("");
|
|
2719
2829
|
}).filter(Boolean);
|
|
2720
|
-
const
|
|
2830
|
+
const elf = e.binaryMetadata?.format === "elf" ? e.binaryMetadata : null;
|
|
2831
|
+
const elfFields = elf ? [["Status", elf.status], ["Architecture", elf.bits ? `${elf.bits}-bit ${elf.endian}, machine ${elf.machine}` : null], ["Interpreter", elf.interpreter], ["SONAME", elf.soname], ["Needed libraries", elf.needed?.join(", ")], ["Build ID", elf.buildId], ["Go version", elf.go?.version], ["Go metadata issue", elf.go?.reason], ["Metadata issue", elf.reason]].filter(([, value]) => value).map(([label,value]) => `<div><strong>${esc(label)}:</strong> ${esc(value)}</div>`).join("") : "";
|
|
2832
|
+
const details = (metadata.length ? `<details class="binary-metadata"><summary>${t("Unverified PE metadata")}</summary>${metadata.map(group => `<div style="margin:6px 0">${group}</div>`).join("")}</details>` : "") + (elfFields ? `<details class="binary-metadata"><summary>ELF metadata</summary>${elfFields}</details>` : "");
|
|
2721
2833
|
return `<tr><td class="dep"><code class="path">${esc(rel)}</code></td><td>${id}${details}</td><td>${flags}</td><td><code class="path" style="color:#6b7280">${esc((e.hashes?.sha256 || "").slice(0, 16))}…</code></td></tr>`;
|
|
2722
2834
|
}).join("\n");
|
|
2723
2835
|
return intro + `<table><thead><tr><th>${t("File")}</th><th>${t("Identity (by checksum)")}</th><th>${t("Status")}</th><th>${t("SHA-256")}</th></tr></thead><tbody>${rows}</tbody></table>`;
|
|
@@ -2771,7 +2883,7 @@ function renderCertificatesChapter(inventory, srcRoot) {
|
|
|
2771
2883
|
const algo = `${esc(c.algorithm || "?")}${c.bits ? " " + esc(String(c.bits)) : ""}`;
|
|
2772
2884
|
let detail;
|
|
2773
2885
|
if (c.kind === "certificate") {
|
|
2774
|
-
const exp = c.notAfter ? t("exp {date}", { date:
|
|
2886
|
+
const exp = c.notAfter ? t("exp {date}", { date: renderTimestamp(c.notAfter) }) + (c.daysUntilExpiry != null ? t(" ({n}d)", { n: c.daysUntilExpiry }) : "") : "";
|
|
2775
2887
|
detail = `${esc(c.subject || "?")} <span style="color:#6b7280">← ${esc(c.issuer || "?")}</span><br><span style="color:#6b7280">${exp}</span>`;
|
|
2776
2888
|
} else {
|
|
2777
2889
|
detail = `<span style="color:#6b7280">${esc(c.format || "")}${c.encrypted === true ? t(" · encrypted") : c.encrypted === false ? t(" · UNENCRYPTED") : ""}${c.count > 1 ? t(" · {n} keys", { n: c.count }) : ""}</span>`;
|
|
@@ -2802,7 +2914,7 @@ function renderExcludedDirs(excludedDirs) {
|
|
|
2802
2914
|
const LIMITATIONS = [
|
|
2803
2915
|
"<strong>Reachability / exploitability in your app.</strong> Findings flag a vulnerable version on the dependency graph; they do <em>not</em> prove the vulnerable code path is actually called at runtime. Triage with your application context.",
|
|
2804
2916
|
"<strong>Runtime configuration & mitigations.</strong> WAFs, feature flags, network isolation, disabled features, and other compensating controls are not modelled.",
|
|
2805
|
-
"<strong>Secrets, IaC &
|
|
2917
|
+
"<strong>Secrets, IaC & unobserved image contents.</strong> No general secret or infrastructure-as-code analysis. Image findings require an inventory; Dockerfile declarations alone do not establish the contents of a final image.",
|
|
2806
2918
|
"<strong>Business-logic & first-party code flaws.</strong> No SAST of your own source; only third-party components are assessed.",
|
|
2807
2919
|
"<strong>Malware beyond the available signal.</strong> Supply-chain risk uses OSV <code>MAL-</code> advisories and the free CIRCL <code>KnownMalicious</code> flag; there is no antivirus/behavioural lane.",
|
|
2808
2920
|
"<strong>License legal advice.</strong> License classification is informational SPDX categorisation, not a legal determination.",
|
|
@@ -2825,7 +2937,7 @@ function provenanceDetail(txt) {
|
|
|
2825
2937
|
return s;
|
|
2826
2938
|
}
|
|
2827
2939
|
|
|
2828
|
-
function renderMethodologyChapter(projectInfo) {
|
|
2940
|
+
function renderMethodologyChapter(projectInfo, {freshnessNotices = [], informationalNotices = []} = {}) {
|
|
2829
2941
|
const prov = projectInfo && projectInfo.provenance;
|
|
2830
2942
|
const STATUS_PILL = { cached: ["cached", "#15803d"], disabled: ["disabled", "#6b7280"], missing: ["not warmed", "#b45309"] };
|
|
2831
2943
|
let sourcesTable = `<div class="empty">${t("No provenance manifest available for this run.")}</div>`;
|
|
@@ -2863,7 +2975,8 @@ function renderMethodologyChapter(projectInfo) {
|
|
|
2863
2975
|
? `<div class="defined-in"><span class="defined-label">${t("Source coverage limitations")}</span></div><ul class="methodology-limits">${prov.sourceLimitations.map(note=>`<li><strong>${esc(note.source)}:</strong> ${esc(sourceNoteText(note.message))}</li>`).join('')}</ul>` : '';
|
|
2864
2976
|
const depthNote = prov?.mavenDepthLimitReached ? `<p>${esc(t("The configured Maven transitive depth was reached; deeper dependencies were not explored."))}</p>` : '';
|
|
2865
2977
|
const limitations = `<div class="defined-in" style="margin-top:14px"><span class="defined-label">${t("Limitations — vigievuln does not assess:")}</span></div><ul class="methodology-limits">${LIMITATIONS.map(l => `<li>${t(l)}</li>`).join("")}</ul>`;
|
|
2866
|
-
|
|
2978
|
+
const observations = informationalNotices.length ? `<div class="defined-in"><span class="defined-label">${t("Scan context")}</span></div><ul class="methodology-limits">${informationalNotices.map(note => `<li>${renderTextWithTimestamps(typeof note === 'string' ? note : note.message || '')}</li>`).join('')}</ul>` : '';
|
|
2979
|
+
return intro + sourcesTable + cfgHtml + renderFreshnessNotices(freshnessNotices) + observations + depthNote + sourceNotes + limitations;
|
|
2867
2980
|
}
|
|
2868
2981
|
|
|
2869
2982
|
// Differential-audit chapter (vs --baseline): what changed since the prior findings JSON.
|
|
@@ -2871,7 +2984,7 @@ function renderDiffChapter(diff) {
|
|
|
2871
2984
|
if (!diff || !diff.summary) return "";
|
|
2872
2985
|
const s = diff.summary;
|
|
2873
2986
|
const sevTxt = Object.entries(s.cve.addedBySeverity || {}).filter(([, n]) => n).map(([k, n]) => `${n} ${k.toLowerCase()}`).join(", ") || t("none");
|
|
2874
|
-
const intro = `<div class="fp-intro">${t("Change since the baseline (<code>--baseline</code>). <strong>{added}</strong> new production CVE finding(s) ({bySeverity}); {removed} resolved, {unchanged} unchanged.", { added: s.cve.addedProduction, bySeverity: esc(sevTxt), removed: s.cve.removed, unchanged: s.cve.unchanged })}${s.cve.unassessed ? ` ${s.cve.unassessed} ${t("unassessed because advisory coverage is incomplete")}.` : ""}</div>`;
|
|
2987
|
+
const intro = `<div class="fp-intro">${t("Change since the baseline (<code>--baseline</code>). <strong>{added}</strong> new production CVE finding(s) ({bySeverity}); {removed} resolved, {unchanged} unchanged.", { added: s.cve.addedProduction, bySeverity: esc(sevTxt), removed: s.cve.removed, unchanged: s.cve.unchanged })}${s.cve.unassessed ? ` ${s.cve.unassessed} ${t("unassessed because advisory coverage is incomplete")}.` : ""}${s.cve.unassessedAdded ? ` ${t("{n} currently observed finding(s) cannot be classified as new because baseline advisory coverage was incomplete.", {n:s.cve.unassessedAdded})}` : ""}</div>`;
|
|
2875
2988
|
const cat = (label, c) => `<tr><td>${esc(label)}</td><td style="color:#b91c1c">+${c.added}</td><td style="color:#15803d">−${c.removed}</td><td><span style="color:#6b7280">${c.unchanged}</span></td><td>${c.unassessed || 0}</td></tr>`;
|
|
2876
2989
|
const table = `<table><thead><tr><th>${t("Category")}</th><th>${t("New")}</th><th>${t("Resolved")}</th><th>${t("Unchanged")}</th><th>${t("Unassessed")}</th></tr></thead><tbody>
|
|
2877
2990
|
${cat("CVE", s.cve)}${cat("EOL", s.eol)}${cat(t("Obsolete"), s.obsolete)}${cat(t("Outdated"), s.outdated)}${cat(t("Licenses"), s.licenses)}
|
|
@@ -2897,12 +3010,13 @@ const ECO_LABELS = Object.fromEntries(allCodecs().map(c => [c.id, ECO_LABEL_OVER
|
|
|
2897
3010
|
const ECO_MANIFEST_KIND = Object.fromEntries(allCodecs().map(c => [c.id, ECO_MANIFEST_OVERRIDE[c.id] || c.manifestNames[c.manifestNames.length - 1]]));
|
|
2898
3011
|
|
|
2899
3012
|
function renderCveBySectionByEco(matches, chapterPrefix, srcRoot) {
|
|
2900
|
-
const ecoOrder = ORDER;
|
|
3013
|
+
const ecoOrder = [...ORDER];
|
|
2901
3014
|
const byEco = {};
|
|
2902
3015
|
for (const id of ORDER) byEco[id] = [];
|
|
2903
3016
|
for (const m of matches) {
|
|
2904
|
-
const et = m.dep?.ecosystemType ||
|
|
2905
|
-
(byEco[et]
|
|
3017
|
+
const et = m.dep?.ecosystemType || m.dep?.ecosystem || "unknown";
|
|
3018
|
+
if (!byEco[et]) { byEco[et] = []; ecoOrder.push(et); }
|
|
3019
|
+
byEco[et].push(m);
|
|
2906
3020
|
}
|
|
2907
3021
|
const out = [];
|
|
2908
3022
|
let letterIdx = 0;
|
|
@@ -2911,7 +3025,7 @@ function renderCveBySectionByEco(matches, chapterPrefix, srcRoot) {
|
|
|
2911
3025
|
if (!list || !list.length) continue;
|
|
2912
3026
|
const letter = String.fromCharCode("a".charCodeAt(0) + letterIdx++);
|
|
2913
3027
|
out.push(minorSection(
|
|
2914
|
-
`${chapterPrefix}.${letter} ${ECO_LABELS[eco]} (${list.length})`,
|
|
3028
|
+
`${chapterPrefix}.${letter} ${esc(ECO_LABELS[eco] || eco)} (${list.length})`,
|
|
2915
3029
|
renderEcoSection(list, `${chapterPrefix}.${letter}`, srcRoot, eco)
|
|
2916
3030
|
));
|
|
2917
3031
|
}
|
|
@@ -3336,15 +3450,9 @@ function generateHtmlReport(payload) {
|
|
|
3336
3450
|
// <title> and the lang attribute both need it to be set already.
|
|
3337
3451
|
const body = injectColgroups(buildBody(payload));
|
|
3338
3452
|
return `<!doctype html>
|
|
3339
|
-
<html lang="${esc(RENDER_CTX.locale)}"><head><meta charset="utf-8"><title>${t("VigieVuln Report")}</title><style>${CSS}</style></head>
|
|
3453
|
+
<html lang="${esc(RENDER_CTX.locale)}"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>${t("VigieVuln Report")}</title><style>${CSS}</style></head>
|
|
3340
3454
|
<body>${body}${browserI18nScript()}${TOGGLE_SCRIPT}${COPY_SCRIPT}${CHART_COPY_SCRIPT}<script>
|
|
3341
|
-
|
|
3342
|
-
var date = new Date(el.getAttribute('datetime'));
|
|
3343
|
-
if (Number.isNaN(date.getTime())) return;
|
|
3344
|
-
el.textContent = new Intl.DateTimeFormat(document.documentElement.lang || undefined, {
|
|
3345
|
-
year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', timeZoneName: 'short'
|
|
3346
|
-
}).format(date);
|
|
3347
|
-
});
|
|
3455
|
+
(${localizeReportTimes.toString()})();
|
|
3348
3456
|
</script></body></html>`;
|
|
3349
3457
|
}
|
|
3350
3458
|
|
|
@@ -3383,7 +3491,7 @@ details.report-section, details.report-subsection { page-break-inside: auto; }
|
|
|
3383
3491
|
.toolbar, .toc { display: none !important; }
|
|
3384
3492
|
details > summary { cursor: default; list-style: none; }
|
|
3385
3493
|
details.report-section > summary h2::before,
|
|
3386
|
-
details.report-subsection > summary h3::before { content: "" !important; display: none !important; }
|
|
3494
|
+
details.report-subsection > summary :is(h3,h4)::before { content: "" !important; display: none !important; }
|
|
3387
3495
|
tr.cve-row td:first-child::before { content: "" !important; display: none !important; }
|
|
3388
3496
|
tr.cve-row, tr.cve-row.open { background: #fff !important; cursor: default; }
|
|
3389
3497
|
/* Detail rows always shown (no JS toggling in Word) */
|
|
@@ -3477,7 +3585,7 @@ function injectColgroups(html) {
|
|
|
3477
3585
|
// The CVE table has an optional "Recommended action" column; the count decides the widths.
|
|
3478
3586
|
html = html.replace(new RegExp(`(${TABLE_COLGROUPS.cve.match.source})([\\s\\S]{0,1200}?</tr></thead>)`, "g"), (m, tableTag, head) => {
|
|
3479
3587
|
const cols = (head.match(/<th\b/g) || []).length;
|
|
3480
|
-
const widths = cols >= 8 ? TABLE_COLGROUPS.cve.widths10 : TABLE_COLGROUPS.cve.widths9;
|
|
3588
|
+
const widths = tableTag.includes('data-image-cves="true"') && cols === 7 ? [11, 11, 15, 8, 25, 23, 7] : cols >= 8 ? TABLE_COLGROUPS.cve.widths10 : TABLE_COLGROUPS.cve.widths9;
|
|
3481
3589
|
return `${tableTag}${colgroupHtml(widths)}${head}`;
|
|
3482
3590
|
});
|
|
3483
3591
|
for (const key of ["eol", "obsolete", "outdated", "retire"]) {
|