cve-lite-cli 1.26.0 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +131 -399
- package/dist/cli/args.js +6 -0
- package/dist/cli/help.js +3 -3
- package/dist/cli/overrides.js +20 -16
- package/dist/index.js +16 -38
- package/dist/output/debug.js +2 -1
- package/dist/output/formatters.js +9 -0
- package/dist/output/html-reporter.js +113 -95
- package/dist/output/logos.js +1 -1
- package/dist/output/override-findings-html.js +9 -3
- package/dist/output/override-findings-sarif.js +34 -24
- package/dist/output/override-findings-terminal.js +19 -2
- package/dist/output/sarif.js +14 -6
- package/dist/overrides/context-builder.js +29 -0
- package/dist/overrides/detectors/index.js +6 -0
- package/dist/overrides/detectors/oa009-stale-floor.js +80 -0
- package/dist/overrides/detectors/pd001-override-only-phantom.js +32 -0
- package/dist/overrides/detectors/pd002-transitive-only-phantom.js +34 -0
- package/dist/overrides/detectors/phantom-utils.js +21 -0
- package/dist/overrides/fixer.js +21 -1
- package/dist/scan/multi-folder-scan.js +6 -8
- package/dist/usage/scanner.js +60 -1
- package/dist/utils/network.js +11 -0
- package/dist/utils/sarif.js +4 -0
- package/dist/utils/severity.js +6 -0
- package/package.json +2 -1
package/dist/cli/args.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { ConfigAction, ConfigKey } from "./config.js";
|
|
2
2
|
export function parseArgs(argv) {
|
|
3
|
+
// Normalize "cve-lite <path> overrides [flags]" to "cve-lite overrides <path> [flags]"
|
|
4
|
+
// so both orderings work. Only reorder when "overrides" is a bare positional (not argv[0]).
|
|
5
|
+
const overridesIdx = argv.indexOf("overrides");
|
|
6
|
+
if (overridesIdx > 0 && !argv[overridesIdx - 1].startsWith("-")) {
|
|
7
|
+
argv = ["overrides", ...argv.slice(0, overridesIdx), ...argv.slice(overridesIdx + 1)];
|
|
8
|
+
}
|
|
3
9
|
const options = {
|
|
4
10
|
failOn: "critical",
|
|
5
11
|
batchSize: "100",
|
package/dist/cli/help.js
CHANGED
|
@@ -44,7 +44,7 @@ export function printHelp() {
|
|
|
44
44
|
" --debug Write verbose runtime/network diagnostics to a timestamped log file",
|
|
45
45
|
" --verbose Show detailed output with fix plan, paths, and full table",
|
|
46
46
|
" --prod-only Exclude dev dependencies where available",
|
|
47
|
-
" --check-overrides Also audit package.json overrides (OA001-
|
|
47
|
+
" --check-overrides Also audit package.json overrides (OA001-OA009, PD001-PD002); findings",
|
|
48
48
|
" print, thread to JSON/SARIF/HTML, and count toward --fail-on",
|
|
49
49
|
" --fail-on <severity> Exit non-zero at or above severity (default: critical)",
|
|
50
50
|
" --batch-size <number> OSV batch size (default: 100)",
|
|
@@ -89,12 +89,12 @@ export function printOverridesHelp() {
|
|
|
89
89
|
const lines = [
|
|
90
90
|
"cve-lite overrides [path] [flags]",
|
|
91
91
|
"",
|
|
92
|
-
"Audit package.json overrides
|
|
92
|
+
"Audit package.json overrides and phantom dependency imports (OA001-OA009, PD001-PD002).",
|
|
93
93
|
"",
|
|
94
94
|
"Flags:",
|
|
95
95
|
" --json Emit findings as JSON",
|
|
96
96
|
" --fix Apply RFC 6902 patches for findings with auto-fix",
|
|
97
|
-
" --rule <id> Only run a specific rule (OA001-
|
|
97
|
+
" --rule <id> Only run a specific rule (OA001-OA009, PD001-PD002)",
|
|
98
98
|
" --check-network Enable OA007 registry drift check (opt-in network)",
|
|
99
99
|
" --audit-log <path> Stream NDJSON change-control to <path>",
|
|
100
100
|
" --fail-on <severity> Exit non-zero at or above this severity (default: critical)",
|
package/dist/cli/overrides.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path, { resolve } from "node:path";
|
|
2
3
|
import { buildOverrideContext, audit, applyFix } from "../overrides/index.js";
|
|
3
4
|
import { createAuditLog } from "../audit-log/index.js";
|
|
4
5
|
import { EXIT_OK, EXIT_FINDINGS, EXIT_ERROR } from "../types.js";
|
|
5
6
|
import { renderOverrideFindings } from "../output/override-findings-terminal.js";
|
|
7
|
+
import { reachesFailOn } from "../utils/severity.js";
|
|
8
|
+
import { chalk } from "../utils/chalk.js";
|
|
6
9
|
export async function runOverrides({ projectArg, options, logger, auditLog: injectedAuditLog }) {
|
|
7
10
|
const projectPath = resolve(projectArg ?? ".");
|
|
8
11
|
const ownsAuditLog = !injectedAuditLog;
|
|
@@ -29,27 +32,33 @@ export async function runOverrides({ projectArg, options, logger, auditLog: inje
|
|
|
29
32
|
auditLog,
|
|
30
33
|
dryRun: false,
|
|
31
34
|
});
|
|
35
|
+
const appliedKeys = new Set(report.appliedPatches.map((p) => `${p.ruleId}:${p.package}`));
|
|
36
|
+
const remaining = findings.filter((f) => !appliedKeys.has(`${f.ruleId}:${f.package.name}`));
|
|
32
37
|
if (options.json) {
|
|
33
|
-
|
|
38
|
+
const ts = new Date().toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
39
|
+
const jsonFilename = `cve-lite-overrides-${ts}.json`;
|
|
40
|
+
fs.writeFileSync(path.join(process.cwd(), jsonFilename), JSON.stringify({ findings: remaining, fixReport: report }, null, 2));
|
|
41
|
+
console.log(`${chalk.gray("JSON saved to")} ${chalk.cyan(jsonFilename)}`);
|
|
34
42
|
}
|
|
35
43
|
else {
|
|
36
44
|
logger.info(`Applied ${report.appliedPatches.length} fix${report.appliedPatches.length === 1 ? "" : "es"}; skipped ${report.skipped.length}.`);
|
|
37
|
-
|
|
45
|
+
if (remaining.length > 0) {
|
|
46
|
+
process.stdout.write(renderOverrideFindings(remaining, { projectPath }) + "\n");
|
|
47
|
+
}
|
|
38
48
|
}
|
|
39
|
-
return
|
|
40
|
-
? EXIT_FINDINGS
|
|
41
|
-
: EXIT_OK;
|
|
49
|
+
return reachesFailOn(remaining, options.failOn) ? EXIT_FINDINGS : EXIT_OK;
|
|
42
50
|
}
|
|
43
51
|
}
|
|
44
52
|
if (options.json) {
|
|
45
|
-
|
|
53
|
+
const ts = new Date().toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
54
|
+
const jsonFilename = `cve-lite-overrides-${ts}.json`;
|
|
55
|
+
fs.writeFileSync(path.join(process.cwd(), jsonFilename), JSON.stringify({ findings }, null, 2));
|
|
56
|
+
console.log(`${chalk.gray("JSON saved to")} ${chalk.cyan(jsonFilename)}`);
|
|
46
57
|
}
|
|
47
58
|
else {
|
|
48
|
-
process.stdout.write(renderOverrideFindings(findings) + "\n");
|
|
59
|
+
process.stdout.write(renderOverrideFindings(findings, { projectPath }) + "\n");
|
|
49
60
|
}
|
|
50
|
-
return
|
|
51
|
-
? EXIT_FINDINGS
|
|
52
|
-
: EXIT_OK;
|
|
61
|
+
return reachesFailOn(findings, options.failOn) ? EXIT_FINDINGS : EXIT_OK;
|
|
53
62
|
}
|
|
54
63
|
catch (err) {
|
|
55
64
|
logger.error(`overrides: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -60,8 +69,3 @@ export async function runOverrides({ projectArg, options, logger, auditLog: inje
|
|
|
60
69
|
auditLog.close();
|
|
61
70
|
}
|
|
62
71
|
}
|
|
63
|
-
function reachedFailOn(findings, failOn) {
|
|
64
|
-
const rank = { info: 0, low: 1, medium: 2, high: 3, critical: 4 };
|
|
65
|
-
const threshold = rank[failOn] ?? rank.critical;
|
|
66
|
-
return findings.some((f) => (rank[f.severity] ?? 0) >= threshold);
|
|
67
|
-
}
|
package/dist/index.js
CHANGED
|
@@ -9,19 +9,19 @@ import { loadPackages, buildNoPackagesMessage } from "./parsers/index.js";
|
|
|
9
9
|
import { scanPackages, buildCoverageNotes, createAdvisorySource } from "./scanner.js";
|
|
10
10
|
import { syncOsvAdvisories } from "./advisory/osv-sync.js";
|
|
11
11
|
import { normalizeSeverity } from "./osv/severity.js";
|
|
12
|
-
import { DEFAULT_BATCH_SIZE, DEFAULT_SEARCH_DEPTH
|
|
12
|
+
import { DEFAULT_BATCH_SIZE, DEFAULT_SEARCH_DEPTH } from "./constants.js";
|
|
13
13
|
import { chalk } from "./utils/chalk.js";
|
|
14
14
|
import { createSpinner } from "./output/spinner.js";
|
|
15
15
|
import { createDebugLogger } from "./output/debug.js";
|
|
16
16
|
import { buildSuggestedFixCommandPlan } from "./remediation/fix-commands.js";
|
|
17
17
|
import { scanProjectForPackageUsage } from "./usage/scanner.js";
|
|
18
18
|
import { getCliVersion } from "./utils/version-info.js";
|
|
19
|
-
import {
|
|
19
|
+
import { getNetworkErrorHint, offlineDbSyncHint } from "./utils/network.js";
|
|
20
20
|
import { formatAdvisoryDbFreshness } from "./utils/time.js";
|
|
21
21
|
import { pluralize, nearestCommand } from "./utils/string.js";
|
|
22
22
|
import { EXIT_ERROR } from "./types.js";
|
|
23
|
-
import { formatAdvisorySourceLine, logInfo, logWarn, printCacheSummary, sortFindingsForOutput } from "./output/formatters.js";
|
|
24
|
-
import { countBySeverity } from "./utils/severity.js";
|
|
23
|
+
import { formatAdvisorySourceLine, formatHintLines, logInfo, logWarn, printCacheSummary, sortFindingsForOutput } from "./output/formatters.js";
|
|
24
|
+
import { countBySeverity, reachesFailOn } from "./utils/severity.js";
|
|
25
25
|
import { buildReportData, writeHtmlReport } from "./output/html-reporter.js";
|
|
26
26
|
import { writeOutputs } from "./output/write-outputs.js";
|
|
27
27
|
import { selectFindingsForTable } from "./output/finding-display.js";
|
|
@@ -184,8 +184,9 @@ if (parsedArgs) {
|
|
|
184
184
|
// route to dedicated multi-folder handler instead of single-lockfile scan
|
|
185
185
|
const nestedLockfiles = findNestedLockfiles(projectPath, searchDepth);
|
|
186
186
|
if (!hasRootLockfile(projectPath) && nestedLockfiles.length >= 2) {
|
|
187
|
-
await handleMultiFolderScan({ projectRoot: projectPath, batchSize, options });
|
|
188
|
-
|
|
187
|
+
const exitCode = await handleMultiFolderScan({ projectRoot: projectPath, batchSize, options });
|
|
188
|
+
auditLogHandle.close();
|
|
189
|
+
process.exit(exitCode);
|
|
189
190
|
}
|
|
190
191
|
let advisorySourceLine = "";
|
|
191
192
|
let advisoryDbFreshnessLine = null;
|
|
@@ -582,7 +583,7 @@ if (parsedArgs) {
|
|
|
582
583
|
}
|
|
583
584
|
}
|
|
584
585
|
if (options.checkOverrides && overrideFindings.length > 0) {
|
|
585
|
-
console.log(renderOverrideFindings(overrideFindings, { verbose: true }));
|
|
586
|
+
console.log("\n" + renderOverrideFindings(overrideFindings, { verbose: true, projectPath }));
|
|
586
587
|
}
|
|
587
588
|
printCoverage([...scanInput.notes, ...scanState.coverage]);
|
|
588
589
|
printFinalStatus(scanState.sorted, overrideCount);
|
|
@@ -595,7 +596,7 @@ if (parsedArgs) {
|
|
|
595
596
|
: undefined;
|
|
596
597
|
printCompactOutput(scanState.sorted, scanInput, { offline, all: !!options.all, packageManager: compactPmLabel });
|
|
597
598
|
if (options.checkOverrides) {
|
|
598
|
-
console.log(renderOverrideFindings(overrideFindings, { verbose: false }));
|
|
599
|
+
console.log("\n" + renderOverrideFindings(overrideFindings, { verbose: false, projectPath }));
|
|
599
600
|
}
|
|
600
601
|
if (showOverrideHint)
|
|
601
602
|
printOverrideHint();
|
|
@@ -638,14 +639,14 @@ if (parsedArgs) {
|
|
|
638
639
|
console.log(chalk.yellow(`${scanState.sorted.length} new ${scanState.sorted.length === 1 ? "finding" : "findings"} above baseline - ${suppressedCount} existing ${suppressedCount === 1 ? "finding" : "findings"} suppressed`));
|
|
639
640
|
}
|
|
640
641
|
}
|
|
641
|
-
|
|
642
|
-
//
|
|
643
|
-
// `overrides` command
|
|
642
|
+
// Override hygiene findings count toward --fail-on too, using the shared
|
|
643
|
+
// reachesFailOn helper from src/utils/severity.ts, the same logic used by
|
|
644
|
+
// the standalone `overrides` command. Without this, a CI run
|
|
644
645
|
// of `cve-lite . --check-overrides --fail-on high` would exit 0 despite high-severity
|
|
645
646
|
// override findings, giving a false sense of protection. overrideFindings is empty
|
|
646
647
|
// unless --check-overrides (and non-ratchet), so this is a no-op otherwise.
|
|
647
|
-
const
|
|
648
|
-
|
|
648
|
+
const shouldFail = reachesFailOn(scanState.sorted, options.failOn) ||
|
|
649
|
+
reachesFailOn(overrideFindings, options.failOn);
|
|
649
650
|
// In fix mode, remaining transitive findings cannot be auto-fixed.
|
|
650
651
|
// Exiting non-zero would prevent the Action PR step from running.
|
|
651
652
|
const exitCode = shouldFail && !options.fix ? 1 : 0;
|
|
@@ -678,31 +679,8 @@ if (parsedArgs) {
|
|
|
678
679
|
stack: error instanceof Error ? error.stack : undefined,
|
|
679
680
|
});
|
|
680
681
|
auditLogHandle.close();
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
console.error(chalk.yellow(hint));
|
|
684
|
-
rest.forEach(line => console.error(chalk.gray(line)));
|
|
685
|
-
}
|
|
686
|
-
else if (isRateLimitError(errorMessage)) {
|
|
687
|
-
const [hint, ...rest] = rateLimitAdvisoryRequestHint();
|
|
688
|
-
console.error(chalk.yellow(hint));
|
|
689
|
-
rest.forEach(line => console.error(chalk.gray(line)));
|
|
690
|
-
}
|
|
691
|
-
else if (isServerError(errorMessage)) {
|
|
692
|
-
const [hint, ...rest] = serverAdvisoryRequestHint();
|
|
693
|
-
console.error(chalk.yellow(hint));
|
|
694
|
-
rest.forEach(line => console.error(chalk.gray(line)));
|
|
695
|
-
}
|
|
696
|
-
else if (isLikelyBlockedAdvisoryRequestError(errorMessage)) {
|
|
697
|
-
const [hint, ...rest] = blockedAdvisoryRequestHint();
|
|
698
|
-
console.error(chalk.yellow(hint));
|
|
699
|
-
rest.forEach(line => console.error(chalk.gray(line)));
|
|
700
|
-
}
|
|
701
|
-
else {
|
|
702
|
-
const [hint, ...rest] = fetchErrorCaCertHint();
|
|
703
|
-
console.error(chalk.yellow(hint));
|
|
704
|
-
rest.forEach(line => console.error(chalk.gray(line)));
|
|
705
|
-
}
|
|
682
|
+
formatHintLines(getNetworkErrorHint(error, errorMessage))
|
|
683
|
+
.forEach(line => console.error(line));
|
|
706
684
|
process.exit(1);
|
|
707
685
|
});
|
|
708
686
|
}
|
package/dist/output/debug.js
CHANGED
|
@@ -5,6 +5,7 @@ export function createDebugLogger(enabled) {
|
|
|
5
5
|
return {
|
|
6
6
|
log: () => { },
|
|
7
7
|
announcePath: () => { },
|
|
8
|
+
close: () => { },
|
|
8
9
|
};
|
|
9
10
|
}
|
|
10
11
|
const ts = new Date().toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
@@ -24,7 +25,7 @@ export function createDebugLogger(enabled) {
|
|
|
24
25
|
announced = true;
|
|
25
26
|
console.error(`[debug] Writing debug log to ./${filename}`);
|
|
26
27
|
};
|
|
27
|
-
return { log, announcePath };
|
|
28
|
+
return { log, announcePath, close: () => { } };
|
|
28
29
|
}
|
|
29
30
|
function formatJson(details) {
|
|
30
31
|
if (typeof details === "string")
|
|
@@ -24,6 +24,15 @@ export function formatAdvisorySourceLine(sourceLabel) {
|
|
|
24
24
|
}
|
|
25
25
|
return `${match[1]} (${chalk.cyan(match[2])})`;
|
|
26
26
|
}
|
|
27
|
+
export function formatHintLines(lines) {
|
|
28
|
+
if (lines.length === 0)
|
|
29
|
+
return [];
|
|
30
|
+
const [first, ...rest] = lines;
|
|
31
|
+
return [
|
|
32
|
+
chalk.yellow(first),
|
|
33
|
+
...rest.map(line => chalk.gray(line)),
|
|
34
|
+
];
|
|
35
|
+
}
|
|
27
36
|
// MAL-* is the OSV prefix for malicious code advisories
|
|
28
37
|
function isMaliciousAdvisory(finding) {
|
|
29
38
|
return finding.vulnerabilities.some(v => v.id.startsWith("MAL-"));
|
|
@@ -29,77 +29,81 @@ export function buildReportData(params) {
|
|
|
29
29
|
overrideFindings: params.overrideFindings,
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
export const REPORT_STYLES =
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
export const REPORT_STYLES = `:root{--bg:#0d1117;--surface:#161b22;--surface-hi:#1c2128;--input:#21262d;--border:#30363d;--border-sub:#21262d;--text:#e6edf3;--text-2:#8b949e;--text-3:#6b7280;--link:#58a6ff;--link-h:#79c0ff;--green:#3fb950;--logo-bg:#fff}
|
|
33
|
+
[data-theme="light"]{--bg:#ffffff;--surface:#f6f8fa;--surface-hi:#eaeef2;--input:#e8ebef;--border:#d0d7de;--border-sub:#d8dee4;--text:#1f2328;--text-2:#57606a;--text-3:#6e7781;--link:#0969da;--link-h:#0550ae;--green:#1a7f37;--logo-bg:#f0f2f5}
|
|
34
|
+
@media(prefers-color-scheme:light){:root:not([data-theme]){--bg:#ffffff;--surface:#f6f8fa;--surface-hi:#eaeef2;--input:#e8ebef;--border:#d0d7de;--border-sub:#d8dee4;--text:#1f2328;--text-2:#57606a;--text-3:#6e7781;--link:#0969da;--link-h:#0550ae;--green:#1a7f37;--logo-bg:#f0f2f5}}
|
|
35
|
+
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
|
|
36
|
+
body{background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',system-ui,sans-serif;font-size:14px;line-height:1.5}
|
|
37
|
+
.report-header{background:var(--surface);border-bottom:1px solid var(--border);padding:14px 32px;display:flex;align-items:center;justify-content:space-between;gap:24px}
|
|
35
38
|
.header-left{display:flex;align-items:center;gap:20px}
|
|
36
|
-
.header-logo-pair{display:flex;align-items:center;gap:8px;background
|
|
39
|
+
.header-logo-pair{display:flex;align-items:center;gap:8px;background:var(--logo-bg);border-radius:7px;padding:6px 12px}
|
|
37
40
|
.header-logo{height:26px;width:auto;display:block}
|
|
38
|
-
.header-logo-plus{font-size:15px;font-weight:700;color
|
|
39
|
-
.header-divider{width:1px;height:28px;background
|
|
40
|
-
.header-project .project-name{font-size:14px;font-weight:600;color
|
|
41
|
-
.header-project .project-meta{font-size:11px;color
|
|
41
|
+
.header-logo-plus{font-size:15px;font-weight:700;color:var(--text-2);line-height:1;user-select:none}
|
|
42
|
+
.header-divider{width:1px;height:28px;background:var(--border)}
|
|
43
|
+
.header-project .project-name{font-size:14px;font-weight:600;color:var(--text)}
|
|
44
|
+
.header-project .project-meta{font-size:11px;color:var(--text-2)}
|
|
42
45
|
.header-right{display:flex;align-items:center;gap:20px}
|
|
43
|
-
.header-stats{display:flex;gap:16px;font-size:12px;color
|
|
44
|
-
.header-stats span strong{color
|
|
46
|
+
.header-stats{display:flex;gap:16px;font-size:12px;color:var(--text-2)}
|
|
47
|
+
.header-stats span strong{color:var(--text)}
|
|
45
48
|
.header-links{display:flex;gap:8px}
|
|
46
|
-
.header-link{display:flex;align-items:center;gap:5px;font-size:12px;color
|
|
47
|
-
.header-link:hover{color
|
|
48
|
-
button.header-link{cursor:pointer;border:1px solid
|
|
49
|
-
button.header-link:hover{color
|
|
49
|
+
.header-link{display:flex;align-items:center;gap:5px;font-size:12px;color:var(--text-2);text-decoration:none;background:var(--input);border:1px solid var(--border);border-radius:6px;padding:5px 10px}
|
|
50
|
+
.header-link:hover{color:var(--link);border-color:var(--link)}
|
|
51
|
+
button.header-link{cursor:pointer;border:1px solid var(--border);font:inherit;background:var(--input);color:var(--text-2)}
|
|
52
|
+
button.header-link:hover{color:var(--link);border-color:var(--link)}
|
|
50
53
|
.header-link.owasp-link{color:#F68B1F;border-color:#F68B1F44}.header-link.owasp-link:hover{color:#F68B1F;border-color:#F68B1F;background:#F68B1F11}
|
|
51
|
-
.
|
|
52
|
-
.
|
|
54
|
+
.theme-toggle .theme-icon{display:none}.theme-toggle .theme-icon.sun{display:block}[data-theme="light"] .theme-toggle .theme-icon.sun{display:none}[data-theme="light"] .theme-toggle .theme-icon.moon{display:block}@media(prefers-color-scheme:light){:root:not([data-theme]) .theme-toggle .theme-icon.sun{display:none}:root:not([data-theme]) .theme-toggle .theme-icon.moon{display:block}}
|
|
55
|
+
.summary-bar{padding:20px 32px;display:flex;gap:12px;border-bottom:1px solid var(--border-sub)}
|
|
56
|
+
.sev-card{flex:1;background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:14px 16px;display:flex;flex-direction:column;gap:4px}
|
|
53
57
|
.sev-card .count{font-size:28px;font-weight:700;line-height:1}
|
|
54
|
-
.sev-card .label{font-size:11px;text-transform:uppercase;letter-spacing:.5px;color
|
|
58
|
+
.sev-card .label{font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--text-2)}
|
|
55
59
|
.sev-card.critical{border-top:3px solid #f85149}.sev-card.critical .count{color:#f85149}
|
|
56
60
|
.sev-card.high{border-top:3px solid #fb8500}.sev-card.high .count{color:#fb8500}
|
|
57
61
|
.sev-card.medium{border-top:3px solid #e3b341}.sev-card.medium .count{color:#e3b341}
|
|
58
62
|
.sev-card.low{border-top:3px solid #388bfd}.sev-card.low .count{color:#388bfd}
|
|
59
|
-
.sev-card.total{border-top:3px solid
|
|
60
|
-
.fix-plan{margin:24px 32px;background
|
|
61
|
-
.fix-plan-header{padding:14px 18px;background
|
|
62
|
-
.fix-plan-header h2{font-size:13px;font-weight:600;color
|
|
63
|
-
.fix-plan-header h2 .icon{color
|
|
64
|
-
.fix-plan-header .badge{font-size:11px;background:#1f6feb33;color
|
|
63
|
+
.sev-card.total{border-top:3px solid var(--border)}.sev-card.total .count{color:var(--text)}
|
|
64
|
+
.fix-plan{margin:24px 32px;background:var(--surface);border:1px solid var(--border);border-radius:8px;overflow:hidden}
|
|
65
|
+
.fix-plan-header{padding:14px 18px;background:var(--surface-hi);border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between}
|
|
66
|
+
.fix-plan-header h2{font-size:13px;font-weight:600;color:var(--text);display:flex;align-items:center;gap:8px}
|
|
67
|
+
.fix-plan-header h2 .icon{color:var(--green)}
|
|
68
|
+
.fix-plan-header .badge{font-size:11px;background:#1f6feb33;color:var(--link);border:1px solid #1f6feb66;border-radius:12px;padding:2px 8px}
|
|
65
69
|
.fix-commands{padding:16px 18px;display:flex;flex-direction:column;gap:10px}
|
|
66
|
-
.skipped-toggle{font-size:11px;background:none;border:none;color
|
|
67
|
-
.skipped-toggle:hover{color
|
|
68
|
-
.skipped-section{display:none;border-top:1px solid
|
|
70
|
+
.skipped-toggle{font-size:11px;background:none;border:none;color:var(--link);cursor:pointer;padding:0;text-decoration:underline;text-underline-offset:2px}
|
|
71
|
+
.skipped-toggle:hover{color:var(--link-h)}
|
|
72
|
+
.skipped-section{display:none;border-top:1px solid var(--border-sub);padding:12px 18px;flex-direction:column;gap:6px}
|
|
69
73
|
.skipped-section.open{display:flex}
|
|
70
|
-
.skipped-row{display:grid;grid-template-columns:180px 80px 1fr;gap:8px;font-size:11px;padding:5px 8px;border-radius:4px;background
|
|
71
|
-
.skipped-pkg{font-family:'SF Mono','Cascadia Code','Fira Code',monospace;color
|
|
72
|
-
.skipped-rel{color
|
|
74
|
+
.skipped-row{display:grid;grid-template-columns:180px 80px 1fr;gap:8px;font-size:11px;padding:5px 8px;border-radius:4px;background:var(--bg);border:1px solid var(--border-sub)}
|
|
75
|
+
.skipped-pkg{font-family:'SF Mono','Cascadia Code','Fira Code',monospace;color:var(--text-2)}
|
|
76
|
+
.skipped-rel{color:var(--text-2)}
|
|
73
77
|
.skipped-rel.direct{color:#3fb950}
|
|
74
78
|
.skipped-rel.transitive{color:#e3b341}
|
|
75
|
-
.skipped-reason{color
|
|
76
|
-
.fix-cmd{display:flex;align-items:center;gap:12px;background
|
|
77
|
-
.fix-cmd .cmd-text{flex:1;font-family:'SF Mono','Cascadia Code','Fira Code',monospace;font-size:12px;color
|
|
78
|
-
.fix-cmd .cmd-meta{font-size:11px;color
|
|
79
|
-
.fix-cmd .copy-btn{font-size:11px;color
|
|
80
|
-
.fix-cmd .copy-btn:hover{color
|
|
79
|
+
.skipped-reason{color:var(--text-3)}
|
|
80
|
+
.fix-cmd{display:flex;align-items:center;gap:12px;background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:10px 14px}
|
|
81
|
+
.fix-cmd .cmd-text{flex:1;font-family:'SF Mono','Cascadia Code','Fira Code',monospace;font-size:12px;color:var(--green)}
|
|
82
|
+
.fix-cmd .cmd-meta{font-size:11px;color:var(--text-2);white-space:nowrap}
|
|
83
|
+
.fix-cmd .copy-btn{font-size:11px;color:var(--text-2);background:var(--input);border:1px solid var(--border);border-radius:4px;padding:3px 8px;cursor:pointer}
|
|
84
|
+
.fix-cmd .copy-btn:hover{color:var(--text);background:var(--border)}
|
|
81
85
|
.findings-section{margin:24px 32px 32px}
|
|
82
86
|
.findings-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
|
|
83
|
-
.findings-header h2{font-size:13px;font-weight:600;color
|
|
87
|
+
.findings-header h2{font-size:13px;font-weight:600;color:var(--text)}
|
|
84
88
|
.filter-bar{display:flex;gap:6px}
|
|
85
|
-
.filter-btn{font-size:11px;border-radius:20px;padding:4px 12px;border:1px solid
|
|
86
|
-
.filter-btn:hover{border-color
|
|
87
|
-
.filter-btn.active{background:#1f6feb22;border-color
|
|
88
|
-
.search-input{font-size:12px;background
|
|
89
|
-
.search-input::placeholder{color
|
|
90
|
-
.search-input:focus{border-color
|
|
91
|
-
.no-results{text-align:center;padding:32px;color
|
|
89
|
+
.filter-btn{font-size:11px;border-radius:20px;padding:4px 12px;border:1px solid var(--border);background:transparent;color:var(--text-2);cursor:pointer}
|
|
90
|
+
.filter-btn:hover{border-color:var(--link);color:var(--link)}
|
|
91
|
+
.filter-btn.active{background:#1f6feb22;border-color:var(--link);color:var(--link)}
|
|
92
|
+
.search-input{font-size:12px;background:var(--bg);border:1px solid var(--border);border-radius:6px;color:var(--text);padding:4px 10px;width:200px;outline:none}
|
|
93
|
+
.search-input::placeholder{color:var(--text-3)}
|
|
94
|
+
.search-input:focus{border-color:var(--link)}
|
|
95
|
+
.no-results{text-align:center;padding:32px;color:var(--text-2);font-size:13px;display:none}
|
|
92
96
|
.findings-table{width:100%;border-collapse:collapse}
|
|
93
|
-
.findings-table thead th{text-align:left;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.4px;color
|
|
94
|
-
.findings-table thead th:hover{color
|
|
95
|
-
.findings-table thead th.sorted .sort-arrow{color
|
|
96
|
-
.findings-table thead th .sort-arrow{color
|
|
97
|
-
.findings-table tbody tr{border-bottom:1px solid
|
|
98
|
-
.findings-table tbody tr:hover{background
|
|
99
|
-
.findings-table tbody tr.is-expanded{background
|
|
97
|
+
.findings-table thead th{text-align:left;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.4px;color:var(--text-2);padding:10px 14px;border-bottom:1px solid var(--border-sub);background:var(--surface);cursor:pointer;white-space:nowrap;user-select:none}
|
|
98
|
+
.findings-table thead th:hover{color:var(--text)}
|
|
99
|
+
.findings-table thead th.sorted .sort-arrow{color:var(--link)}
|
|
100
|
+
.findings-table thead th .sort-arrow{color:var(--border);margin-left:4px}
|
|
101
|
+
.findings-table tbody tr{border-bottom:1px solid var(--border-sub);cursor:pointer}
|
|
102
|
+
.findings-table tbody tr:hover{background:var(--surface)}
|
|
103
|
+
.findings-table tbody tr.is-expanded{background:var(--surface)}
|
|
100
104
|
.findings-table tbody td{padding:11px 14px;vertical-align:middle}
|
|
101
|
-
.pkg-name{font-weight:500;color
|
|
102
|
-
.pkg-version{font-size:11px;color
|
|
105
|
+
.pkg-name{font-weight:500;color:var(--link);font-size:13px}
|
|
106
|
+
.pkg-version{font-size:11px;color:var(--text-2)}
|
|
103
107
|
.sev-badge{display:inline-block;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.4px;padding:2px 7px;border-radius:4px}
|
|
104
108
|
.sev-badge.critical{background:#f8514922;color:#f85149;border:1px solid #f8514966}
|
|
105
109
|
.sev-badge.high{background:#fb850022;color:#fb8500;border:1px solid #fb850066}
|
|
@@ -113,62 +117,62 @@ button.header-link:hover{color:#58a6ff;border-color:#58a6ff}
|
|
|
113
117
|
.rel-badge.transitive{color:#e3b341;background:#e3b34122}
|
|
114
118
|
.rel-badge.unknown{color:#8b949e;background:#8b949e22}
|
|
115
119
|
.rel-badge.dev{color:#a371f7;background:#6e40c922;border:1px solid #6e40c955}
|
|
116
|
-
.cve-link{font-size:11px;color
|
|
117
|
-
.cve-link:hover{color
|
|
118
|
-
.fix-hint{font-size:11px;color
|
|
120
|
+
.cve-link{font-size:11px;color:var(--link);font-family:monospace;text-decoration:none;border-bottom:1px dotted var(--link)}
|
|
121
|
+
.cve-link:hover{color:var(--link-h)}
|
|
122
|
+
.fix-hint{font-size:11px;color:var(--green);font-family:monospace}
|
|
119
123
|
.fix-hint.none{color:#e3b341}
|
|
120
|
-
.fix-hint.hint-only{color
|
|
121
|
-
.expand-icon{color
|
|
122
|
-
.detail-row{background
|
|
124
|
+
.fix-hint.hint-only{color:var(--text-2)}
|
|
125
|
+
.expand-icon{color:var(--text-2);font-size:10px}
|
|
126
|
+
.detail-row{background:var(--bg);border-top:1px solid var(--border-sub);display:none}
|
|
123
127
|
.detail-row.visible{display:table-row}
|
|
124
128
|
.detail-row td{padding:0!important}
|
|
125
129
|
.expanded-inner{padding:16px 20px 20px 48px;display:flex;gap:32px}
|
|
126
130
|
.detail-col{flex:1}
|
|
127
|
-
.detail-col h4{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.4px;color
|
|
131
|
+
.detail-col h4{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.4px;color:var(--text-2);margin-bottom:8px}
|
|
128
132
|
.detail-col h4.detail-subheading{margin-top:14px}
|
|
129
|
-
.detail-col p{font-size:12px;color
|
|
133
|
+
.detail-col p{font-size:12px;color:var(--text-2);line-height:1.6}
|
|
130
134
|
.dep-path{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
|
|
131
|
-
.dep-node{font-size:11px;font-family:monospace;background
|
|
135
|
+
.dep-node{font-size:11px;font-family:monospace;background:var(--surface);border:1px solid var(--border);border-radius:4px;padding:2px 8px;color:var(--text)}
|
|
132
136
|
.dep-node.vulnerable{border-color:#f85149;color:#f85149}
|
|
133
|
-
.dep-arrow{color
|
|
134
|
-
.fix-cmd-inline{display:flex;align-items:center;gap:8px;background
|
|
135
|
-
.fix-cmd-inline code{flex:1;font-family:monospace;font-size:12px;color
|
|
136
|
-
.fix-cmd-inline .copy-btn{font-size:11px;color
|
|
137
|
-
.fix-cmd-note{margin:4px 0 0;font-size:12px;color
|
|
138
|
-
.report-footer{margin:0 32px 32px;padding:12px 0;border-top:1px solid
|
|
137
|
+
.dep-arrow{color:var(--text-2);font-size:11px}
|
|
138
|
+
.fix-cmd-inline{display:flex;align-items:center;gap:8px;background:var(--surface);border:1px solid var(--border);border-radius:6px;padding:8px 12px;margin-top:4px}
|
|
139
|
+
.fix-cmd-inline code{flex:1;font-family:monospace;font-size:12px;color:var(--green)}
|
|
140
|
+
.fix-cmd-inline .copy-btn{font-size:11px;color:var(--text-2);background:var(--input);border:1px solid var(--border);border-radius:4px;padding:3px 8px;cursor:pointer}
|
|
141
|
+
.fix-cmd-note{margin:4px 0 0;font-size:12px;color:var(--text-2);font-style:italic;line-height:1.5}
|
|
142
|
+
.report-footer{margin:0 32px 32px;padding:12px 0;border-top:1px solid var(--border-sub);display:flex;justify-content:space-between;font-size:11px;color:var(--text-2)}
|
|
139
143
|
.scan-notes{margin:24px 32px 16px}
|
|
140
|
-
.scan-notes-toggle{display:flex;align-items:center;gap:6px;font-size:11px;color
|
|
141
|
-
.scan-notes-toggle:hover{color
|
|
144
|
+
.scan-notes-toggle{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--text-2);background:none;border:none;cursor:pointer;padding:0}
|
|
145
|
+
.scan-notes-toggle:hover{color:var(--text)}
|
|
142
146
|
.scan-notes-toggle .arrow{font-size:9px;transition:transform .15s}
|
|
143
147
|
.scan-notes-toggle.open .arrow{transform:rotate(90deg)}
|
|
144
|
-
.scan-notes-body{display:none;margin-top:6px;padding:10px 14px;background
|
|
148
|
+
.scan-notes-body{display:none;margin-top:6px;padding:10px 14px;background:var(--surface);border:1px solid var(--border-sub);border-radius:6px}
|
|
145
149
|
.scan-notes-body.open{display:block}
|
|
146
150
|
.scan-notes-body ul{margin:0;padding:0 0 0 16px;display:flex;flex-direction:column;gap:3px}
|
|
147
|
-
.scan-notes-body li{font-size:11px;color
|
|
151
|
+
.scan-notes-body li{font-size:11px;color:var(--text-2);line-height:1.5}
|
|
148
152
|
.scan-notes-body li.warning{color:#e6b84a}
|
|
149
|
-
.fix-targets-list{display:flex;flex-direction:column;gap:4px;margin-top:6px;padding:8px 10px;background
|
|
153
|
+
.fix-targets-list{display:flex;flex-direction:column;gap:4px;margin-top:6px;padding:8px 10px;background:var(--surface);border:1px solid var(--border-sub);border-radius:5px}
|
|
150
154
|
.fix-target-row{display:flex;align-items:center;gap:8px;font-size:11px;flex-wrap:wrap}
|
|
151
|
-
.fix-target-pkg{font-family:'SF Mono','Cascadia Code','Fira Code',monospace;color
|
|
152
|
-
.fix-target-arrow{color
|
|
153
|
-
.fix-target-to{font-family:'SF Mono','Cascadia Code','Fira Code',monospace;color
|
|
154
|
-
.fix-target-stats{color
|
|
155
|
-
.fix-target-note{color
|
|
156
|
-
.fix-target-coverage{flex-basis:100%;color
|
|
157
|
-
.chain-proof{font-size:0.78rem;color
|
|
155
|
+
.fix-target-pkg{font-family:'SF Mono','Cascadia Code','Fira Code',monospace;color:var(--text-2)}
|
|
156
|
+
.fix-target-arrow{color:var(--text-2)}
|
|
157
|
+
.fix-target-to{font-family:'SF Mono','Cascadia Code','Fira Code',monospace;color:var(--green)}
|
|
158
|
+
.fix-target-stats{color:var(--text-3);font-size:10px}
|
|
159
|
+
.fix-target-note{color:var(--text-3);font-style:italic;font-size:10px}
|
|
160
|
+
.fix-target-coverage{flex-basis:100%;color:var(--text-3);font-size:10px;line-height:1.45}
|
|
161
|
+
.chain-proof{font-size:0.78rem;color:var(--text-2);margin-left:6px;font-family:monospace}
|
|
158
162
|
.break-badge{font-size:10px;font-weight:700;background:#fb850022;color:#fb8500;border:1px solid #fb850066;border-radius:4px;padding:1px 5px}
|
|
159
163
|
.tier-ok{display:inline-flex;align-items:center;gap:4px;font-size:10px;padding:2px 8px;border-radius:4px;background:#3fb95022;color:#3fb950;border:1px solid #3fb95033;margin-bottom:6px}
|
|
160
164
|
.tier-warn{display:inline-flex;align-items:center;gap:4px;font-size:10px;padding:2px 8px;border-radius:4px;background:#e3b34122;color:#e3b341;border:1px solid #e3b34133;margin-bottom:6px}
|
|
161
165
|
.tier-err{display:inline-flex;align-items:center;gap:4px;font-size:10px;padding:2px 8px;border-radius:4px;background:#ff000011;color:#ff7b72;border:1px solid #ff7b7222;margin-bottom:6px}
|
|
162
166
|
.override-hygiene{margin:0 32px 32px}
|
|
163
|
-
.override-hygiene h2{font-size:13px;font-weight:600;color
|
|
164
|
-
.override-hygiene p{font-size:13px;color
|
|
165
|
-
.override-hygiene table{width:100%;border-collapse:collapse;background
|
|
166
|
-
.override-hygiene table thead th{text-align:left;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.4px;color
|
|
167
|
-
.override-hygiene table tbody tr{border-bottom:1px solid
|
|
167
|
+
.override-hygiene h2{font-size:13px;font-weight:600;color:var(--text);margin-bottom:12px}
|
|
168
|
+
.override-hygiene p{font-size:13px;color:var(--text-2)}
|
|
169
|
+
.override-hygiene table{width:100%;border-collapse:collapse;background:var(--surface);border:1px solid var(--border);border-radius:8px;overflow:hidden}
|
|
170
|
+
.override-hygiene table thead th{text-align:left;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.4px;color:var(--text-2);padding:10px 14px;border-bottom:1px solid var(--border-sub);background:var(--surface-hi)}
|
|
171
|
+
.override-hygiene table tbody tr{border-bottom:1px solid var(--border-sub)}
|
|
168
172
|
.override-hygiene table tbody tr:last-child{border-bottom:none}
|
|
169
|
-
.override-hygiene table tbody tr.severity-group{background
|
|
170
|
-
.override-hygiene table tbody tr.severity-group th{font-weight:600;color
|
|
171
|
-
.override-hygiene table tbody tr.finding td{padding:11px 14px;font-size:12px;color
|
|
173
|
+
.override-hygiene table tbody tr.severity-group{background:var(--surface-hi)}
|
|
174
|
+
.override-hygiene table tbody tr.severity-group th{font-weight:600;color:var(--text);padding:10px 14px;text-align:left}
|
|
175
|
+
.override-hygiene table tbody tr.finding td{padding:11px 14px;font-size:12px;color:var(--text);vertical-align:middle}
|
|
172
176
|
.override-hygiene table tbody tr.critical{border-left:3px solid #f85149}
|
|
173
177
|
.override-hygiene table tbody tr.high{border-left:3px solid #fb8500}
|
|
174
178
|
.override-hygiene table tbody tr.medium{border-left:3px solid #e3b341}
|
|
@@ -204,6 +208,7 @@ export function renderHtmlReport(data) {
|
|
|
204
208
|
<style>
|
|
205
209
|
${REPORT_STYLES}
|
|
206
210
|
</style>
|
|
211
|
+
<script>(function(){var t=localStorage.getItem('cve-lite-theme');if(t)document.documentElement.setAttribute('data-theme',t)})()</script>
|
|
207
212
|
</head>
|
|
208
213
|
<body>
|
|
209
214
|
|
|
@@ -237,6 +242,10 @@ ${REPORT_STYLES}
|
|
|
237
242
|
<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg>
|
|
238
243
|
GitHub
|
|
239
244
|
</a>
|
|
245
|
+
<button class="header-link theme-toggle" type="button" onclick="toggleTheme()" aria-label="Toggle light/dark mode" title="Toggle light/dark mode">
|
|
246
|
+
<svg class="theme-icon sun" width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><path d="M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.75.75 0 0 1 .75.75v1.5a.75.75 0 0 1-1.5 0V.75A.75.75 0 0 1 8 0zm0 13a.75.75 0 0 1 .75.75v1.5a.75.75 0 0 1-1.5 0v-1.5A.75.75 0 0 1 8 13zM2.343 2.343a.75.75 0 0 1 1.061 0l1.06 1.061a.75.75 0 0 1-1.06 1.06l-1.061-1.06a.75.75 0 0 1 0-1.061zm9.193 9.193a.75.75 0 0 1 1.06 0l1.061 1.06a.75.75 0 0 1-1.06 1.061l-1.061-1.06a.75.75 0 0 1 0-1.061zM0 8a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 0 1.5H.75A.75.75 0 0 1 0 8zm13 0a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 0 1.5h-1.5A.75.75 0 0 1 13 8zM2.343 13.657a.75.75 0 0 1 0-1.06l1.061-1.061a.75.75 0 0 1 1.06 1.06l-1.06 1.061a.75.75 0 0 1-1.061 0zm9.193-9.193a.75.75 0 0 1 0-1.06l1.06-1.061a.75.75 0 0 1 1.061 1.06l-1.06 1.061a.75.75 0 0 1-1.061 0z"/></svg>
|
|
247
|
+
<svg class="theme-icon moon" width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><path d="M9.598 1.591a.749.749 0 0 1 .785-.175 7 7 0 1 1-8.967 8.967.75.75 0 0 1 .961-.96 5.5 5.5 0 0 0 7.046-7.046.75.75 0 0 1 .175-.786z"/></svg>
|
|
248
|
+
</button>
|
|
240
249
|
</div>
|
|
241
250
|
</div>
|
|
242
251
|
</div>
|
|
@@ -273,7 +282,7 @@ ${fixPlanHtml}
|
|
|
273
282
|
<th style="width:32px"></th>
|
|
274
283
|
<th onclick="sortBy('package')">Package <span class="sort-arrow">↕</span></th>
|
|
275
284
|
<th>Fix available</th>
|
|
276
|
-
<th onclick="sortBy('severity')" class="sorted">Severity <span class="sort-arrow" style="color
|
|
285
|
+
<th onclick="sortBy('severity')" class="sorted">Severity <span class="sort-arrow" style="color:var(--link)">↓</span></th>
|
|
277
286
|
<th onclick="sortBy('relationship')">Type <span class="sort-arrow">↕</span></th>
|
|
278
287
|
<th>CVE / Advisory</th>
|
|
279
288
|
</tr>
|
|
@@ -284,7 +293,7 @@ ${findingRowsHtml}
|
|
|
284
293
|
</tbody>
|
|
285
294
|
</table>
|
|
286
295
|
</div>
|
|
287
|
-
${renderOverrideFindingsHtml(data.overrideFindings)}
|
|
296
|
+
${renderOverrideFindingsHtml(data.overrideFindings, data.projectPath)}
|
|
288
297
|
|
|
289
298
|
${noticesHtml}
|
|
290
299
|
|
|
@@ -382,6 +391,15 @@ function sortBy(col) {
|
|
|
382
391
|
});
|
|
383
392
|
}
|
|
384
393
|
|
|
394
|
+
function toggleTheme() {
|
|
395
|
+
var el = document.documentElement;
|
|
396
|
+
var cur = el.getAttribute('data-theme');
|
|
397
|
+
if (!cur) cur = window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';
|
|
398
|
+
var next = cur === 'dark' ? 'light' : 'dark';
|
|
399
|
+
el.setAttribute('data-theme', next);
|
|
400
|
+
localStorage.setItem('cve-lite-theme', next);
|
|
401
|
+
}
|
|
402
|
+
|
|
385
403
|
function copyText(text) {
|
|
386
404
|
navigator.clipboard.writeText(text).catch(() => {});
|
|
387
405
|
}
|
|
@@ -505,7 +523,7 @@ function renderTransitiveContextCol(finding) {
|
|
|
505
523
|
finding.recommendedParentUpgrade != null;
|
|
506
524
|
if (hasFixAvailable) {
|
|
507
525
|
const parentLine = finding.primaryParent
|
|
508
|
-
? `<p style="font-size:12px;color
|
|
526
|
+
? `<p style="font-size:12px;color:var(--text-2);margin-top:4px">Parent: ${escapeHtml(finding.primaryParent)}</p>`
|
|
509
527
|
: "";
|
|
510
528
|
return `<div class="detail-col" style="max-width:200px">
|
|
511
529
|
<h4>Context</h4>
|
|
@@ -517,13 +535,13 @@ function renderTransitiveContextCol(finding) {
|
|
|
517
535
|
return `<div class="detail-col" style="max-width:200px">
|
|
518
536
|
<h4>Context</h4>
|
|
519
537
|
<span class="tier-warn">⚠ No safe version identified</span>
|
|
520
|
-
<p style="font-size:12px;color
|
|
538
|
+
<p style="font-size:12px;color:var(--text-2);margin-top:4px">Parent: ${escapeHtml(finding.primaryParent)}</p>
|
|
521
539
|
</div>`;
|
|
522
540
|
}
|
|
523
541
|
return `<div class="detail-col" style="max-width:200px">
|
|
524
542
|
<h4>Context</h4>
|
|
525
543
|
<span class="tier-err">✕ No parent identified</span>
|
|
526
|
-
<p style="font-size:12px;color
|
|
544
|
+
<p style="font-size:12px;color:var(--text-2);margin-top:4px">Run <code>npm ls ${escapeHtml(finding.package)}</code> to find which package pulls it in.</p>
|
|
527
545
|
</div>`;
|
|
528
546
|
}
|
|
529
547
|
function renderNotices(notes, warnings) {
|
|
@@ -554,7 +572,7 @@ export function renderSkippedSection(plan) {
|
|
|
554
572
|
<button class="skipped-toggle" onclick="toggleSkipped()">↑ collapse</button>
|
|
555
573
|
</div>
|
|
556
574
|
<div class="skipped-section open" id="skipped-section">
|
|
557
|
-
<div style="font-size:11px;font-weight:600;color
|
|
575
|
+
<div style="font-size:11px;font-weight:600;color:var(--text-2);text-transform:uppercase;letter-spacing:.4px;margin-bottom:4px">Why were these skipped?</div>
|
|
558
576
|
${skippedRows}
|
|
559
577
|
</div>
|
|
560
578
|
</div>`;
|
|
@@ -604,7 +622,7 @@ export function renderFixPlan(plan) {
|
|
|
604
622
|
</div>${targetsHtml}`;
|
|
605
623
|
}).join("\n");
|
|
606
624
|
const skippedBadgePart = skippedCount > 0
|
|
607
|
-
? ` · <span style="color
|
|
625
|
+
? ` · <span style="color:var(--text-2)">${skippedCount} skipped ⊘</span>`
|
|
608
626
|
: "";
|
|
609
627
|
const coverageText = plan.coveredFindingCount === plan.totalFindingCount
|
|
610
628
|
? `Running all commands should fix all ${plan.totalFindingCount} findings.`
|
|
@@ -616,7 +634,7 @@ export function renderFixPlan(plan) {
|
|
|
616
634
|
</div>
|
|
617
635
|
<div class="fix-commands">${commandRows}
|
|
618
636
|
</div>
|
|
619
|
-
<div style="padding:10px 18px;border-top:1px solid
|
|
637
|
+
<div style="padding:10px 18px;border-top:1px solid var(--border-sub);font-size:11px;color:var(--text-2)">${coverageText}</div>
|
|
620
638
|
</div>`;
|
|
621
639
|
}
|
|
622
640
|
export async function writeHtmlReport(params) {
|
package/dist/output/logos.js
CHANGED
|
@@ -5,7 +5,7 @@ const FILES = {
|
|
|
5
5
|
"cve-lite": "logo-with-title-removebg-preview.png",
|
|
6
6
|
"owasp": "OWASP_Logo_Black_TM.png",
|
|
7
7
|
};
|
|
8
|
-
const ASSET_DIR =
|
|
8
|
+
const ASSET_DIR = fileURLToPath(new URL("../../assets/", import.meta.url));
|
|
9
9
|
const cache = new Map();
|
|
10
10
|
export function loadLogoDataUri(name) {
|
|
11
11
|
const cached = cache.get(name);
|