cve-lite-cli 1.36.1 → 1.38.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 +25 -3
- package/dist/advisory/local-db.js +22 -3
- package/dist/audit-log/events.js +14 -0
- package/dist/cli/args.js +125 -102
- package/dist/cli/flags.js +39 -0
- package/dist/cli/help.js +8 -3
- package/dist/cli/overrides.js +25 -19
- package/dist/cli/validate.js +34 -9
- package/dist/index.js +6 -1
- package/dist/output/compact-truncation.js +35 -0
- package/dist/output/cyclonedx.js +6 -3
- package/dist/output/formatters.js +10 -2
- package/dist/output/html-reporter.js +31 -15
- package/dist/output/multi-folder-html-reporter.js +26 -7
- package/dist/output/output-dir.js +20 -0
- package/dist/output/override-findings-html.js +24 -3
- package/dist/output/override-findings-json.js +5 -2
- package/dist/output/override-findings-sarif.js +1 -0
- package/dist/output/override-findings-terminal.js +21 -1
- package/dist/output/printers.js +52 -25
- package/dist/output/sarif.js +63 -6
- package/dist/output/sbom-file.js +6 -4
- package/dist/output/scan-json.js +74 -0
- package/dist/output/skipped-override-rules.js +41 -0
- package/dist/output/spdx.js +2 -2
- package/dist/output/write-outputs.js +22 -32
- package/dist/overrides/admitted-scan.js +12 -1
- package/dist/overrides/api.js +75 -21
- package/dist/overrides/context-builder.js +17 -2
- package/dist/overrides/detectors/index.js +2 -0
- package/dist/overrides/detectors/oa008-materialized.js +74 -14
- package/dist/overrides/detectors/oa009-stale-floor.js +12 -15
- package/dist/overrides/detectors/oa010-vulnerable-floor.js +5 -1
- package/dist/overrides/detectors/oa011-exceeds-range.js +128 -0
- package/dist/overrides/detectors/pd001-override-only-phantom.js +5 -4
- package/dist/overrides/detectors/pd002-transitive-only-phantom.js +5 -4
- package/dist/overrides/detectors/phantom-utils.js +29 -0
- package/dist/overrides/parsing/registry.js +79 -10
- package/dist/remediation/fix-commands.js +89 -31
- package/dist/remediation/npm-registry.js +9 -1
- package/dist/remediation/parent-update-child-note.js +11 -0
- package/dist/scan/multi-folder-scan.js +68 -53
- package/dist/scan/override-audit.js +49 -0
- package/dist/scan/single-scan.js +115 -44
- package/dist/scanner.js +35 -11
- package/dist/skills/content.js +4 -2
- package/dist/usage/scanner.js +219 -28
- package/dist/utils/contextual-signals.js +193 -0
- package/dist/utils/create-pr.js +21 -2
- package/dist/utils/finding.js +5 -0
- package/dist/utils/fix-runner.js +15 -2
- package/dist/utils/package-json.js +66 -14
- package/dist/utils/severity.js +22 -0
- package/dist/utils/update-check.js +2 -1
- package/dist/utils/version.js +81 -86
- package/package.json +3 -1
- package/scripts/pr-scan-delta.mjs +7 -4
|
@@ -26,6 +26,25 @@ export function readDirectDependencyNames(projectPath, prodOnly) {
|
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
+
// Every workspace member declared by the root manifest's `workspaces` field or
|
|
30
|
+
// by pnpm-workspace.yaml, with its parsed package.json. Empty for a
|
|
31
|
+
// single-package project. Best-effort: unreadable members are skipped.
|
|
32
|
+
export function readWorkspaceMemberManifests(projectPath) {
|
|
33
|
+
const rootManifest = readPackageJsonObject(path.join(projectPath, "package.json"));
|
|
34
|
+
if (!rootManifest)
|
|
35
|
+
return [];
|
|
36
|
+
const members = [];
|
|
37
|
+
for (const packageJsonPath of resolveWorkspacePackageJsonPaths(projectPath, readWorkspacePatterns(rootManifest, projectPath))) {
|
|
38
|
+
const manifest = readPackageJsonObject(packageJsonPath);
|
|
39
|
+
if (!manifest)
|
|
40
|
+
continue;
|
|
41
|
+
const dir = path.relative(projectPath, path.dirname(packageJsonPath)).split(path.sep).join("/");
|
|
42
|
+
if (!dir || dir === ".")
|
|
43
|
+
continue;
|
|
44
|
+
members.push({ dir, manifest });
|
|
45
|
+
}
|
|
46
|
+
return members;
|
|
47
|
+
}
|
|
29
48
|
function readPackageJsonObject(filePath) {
|
|
30
49
|
try {
|
|
31
50
|
const raw = JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
@@ -89,26 +108,59 @@ function resolveWorkspacePackageJsonPaths(projectPath, patterns) {
|
|
|
89
108
|
}
|
|
90
109
|
return [...matches];
|
|
91
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Directory names directly under `relativePath`, skipping `node_modules` and dot-directories.
|
|
113
|
+
* A workspace member never lives inside `node_modules`, and descending into it during a `**`
|
|
114
|
+
* walk is both wrong and ruinously slow on a real monorepo.
|
|
115
|
+
*/
|
|
116
|
+
function childDirectoryNames(projectPath, relativePath) {
|
|
117
|
+
const baseDir = relativePath ? path.join(projectPath, relativePath) : projectPath;
|
|
118
|
+
try {
|
|
119
|
+
return fs
|
|
120
|
+
.readdirSync(baseDir, { withFileTypes: true })
|
|
121
|
+
// isDirectory() is false for a symlink, so a link pointing back up cannot loop the walk.
|
|
122
|
+
.filter(entry => entry.isDirectory())
|
|
123
|
+
.map(entry => entry.name)
|
|
124
|
+
.filter(name => name !== "node_modules" && !name.startsWith("."));
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Compiles one path segment containing `*` into an anchored matcher. `*` matches any run of
|
|
132
|
+
* characters within a single segment, so `pkg-*` and `*-app` both work. Everything else is
|
|
133
|
+
* escaped, so a literal dot in a directory name is not treated as a regex wildcard.
|
|
134
|
+
*/
|
|
135
|
+
function segmentMatcher(segment) {
|
|
136
|
+
const escaped = segment.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^/]*");
|
|
137
|
+
return new RegExp(`^${escaped}$`);
|
|
138
|
+
}
|
|
92
139
|
function expandWorkspacePattern(projectPath, segments, currentRelativePath) {
|
|
93
140
|
if (segments.length === 0) {
|
|
94
141
|
return currentRelativePath ? [currentRelativePath] : [];
|
|
95
142
|
}
|
|
96
143
|
const [segment, ...rest] = segments;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
144
|
+
// `**` matches zero or more directory levels, so it expands both to "the rest of the
|
|
145
|
+
// pattern applied here" and to the same pattern applied one level deeper.
|
|
146
|
+
if (segment === "**") {
|
|
147
|
+
const results = new Set(expandWorkspacePattern(projectPath, rest, currentRelativePath));
|
|
148
|
+
for (const name of childDirectoryNames(projectPath, currentRelativePath)) {
|
|
149
|
+
const next = currentRelativePath ? path.join(currentRelativePath, name) : name;
|
|
150
|
+
for (const found of expandWorkspacePattern(projectPath, segments, next)) {
|
|
151
|
+
results.add(found);
|
|
152
|
+
}
|
|
105
153
|
}
|
|
106
|
-
return
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
154
|
+
return [...results];
|
|
155
|
+
}
|
|
156
|
+
// Any segment containing `*` is matched against the directory entries. A whole-segment `*`
|
|
157
|
+
// is the degenerate case of this and needs no separate branch.
|
|
158
|
+
if (segment.includes("*")) {
|
|
159
|
+
const matcher = segmentMatcher(segment);
|
|
160
|
+
return childDirectoryNames(projectPath, currentRelativePath)
|
|
161
|
+
.filter(name => matcher.test(name))
|
|
162
|
+
.flatMap(name => {
|
|
163
|
+
const nextRelativePath = currentRelativePath ? path.join(currentRelativePath, name) : name;
|
|
112
164
|
return expandWorkspacePattern(projectPath, rest, nextRelativePath);
|
|
113
165
|
});
|
|
114
166
|
}
|
package/dist/utils/severity.js
CHANGED
|
@@ -8,6 +8,28 @@ export function reachesFailOn(findings, failOn) {
|
|
|
8
8
|
const failLevel = normalizeSeverity(failOn);
|
|
9
9
|
return findings.some((f) => severityOrder[f.severity] >= severityOrder[failLevel]);
|
|
10
10
|
}
|
|
11
|
+
// One line that names what tripped the --fail-on gate, so a red CI job says why
|
|
12
|
+
// it is red. The gate ORs three finding classes (CVE, override hygiene,
|
|
13
|
+
// maintenance risk) and none of the rendered output mentioned the gate before,
|
|
14
|
+
// which read as a broken exit code. Returns null when the gate would not fire,
|
|
15
|
+
// so callers derive the exit decision from it (gateLine !== null) and the two
|
|
16
|
+
// cannot disagree. The parenthetical echoes the raw flag value: --fail-on is not
|
|
17
|
+
// validated and normalizeSeverity falls back to critical, so echoing the
|
|
18
|
+
// normalized level would show the user a value they never typed.
|
|
19
|
+
export function failingGateSummary(classes, failOn) {
|
|
20
|
+
if (!failOn)
|
|
21
|
+
return null;
|
|
22
|
+
const failLevel = normalizeSeverity(failOn);
|
|
23
|
+
const parts = [];
|
|
24
|
+
for (const { label, findings } of classes) {
|
|
25
|
+
const count = findings.filter((f) => severityOrder[f.severity] >= severityOrder[failLevel]).length;
|
|
26
|
+
if (count > 0)
|
|
27
|
+
parts.push(`${count} ${label} ${count === 1 ? "finding" : "findings"}`);
|
|
28
|
+
}
|
|
29
|
+
if (parts.length === 0)
|
|
30
|
+
return null;
|
|
31
|
+
return `Failing: ${parts.join(", ")} at or above ${failLevel} (--fail-on ${failOn}).`;
|
|
32
|
+
}
|
|
11
33
|
export function formatSeverityLabel(severity) {
|
|
12
34
|
const lower = severity.toLowerCase();
|
|
13
35
|
if (lower === "critical")
|
|
@@ -4,6 +4,7 @@ import os from "node:os";
|
|
|
4
4
|
import { chalk, stripAnsi } from "./chalk.js";
|
|
5
5
|
import { getCliVersion } from "./version-info.js";
|
|
6
6
|
const NPM_REGISTRY_URL = "https://registry.npmjs.org/cve-lite-cli/latest";
|
|
7
|
+
const NPM_INSTALL_COMMAND = "npm install -g cve-lite-cli";
|
|
7
8
|
const CACHE_TTL_MS = 24 * 60 * 60 * 1000;
|
|
8
9
|
const BOX_INNER_WIDTH = 50;
|
|
9
10
|
export function isNewer(latest, current) {
|
|
@@ -75,7 +76,7 @@ function renderBox(current, latest) {
|
|
|
75
76
|
const empty = chalk.yellow("│") + " ".repeat(BOX_INNER_WIDTH) + chalk.yellow("│");
|
|
76
77
|
const bottom = chalk.yellow("╰" + "─".repeat(BOX_INNER_WIDTH) + "╯");
|
|
77
78
|
const line1 = ` ${chalk.bold.yellow("Update available!")} ${chalk.gray(current)} ${chalk.yellow("→")} ${chalk.green(latest)}`;
|
|
78
|
-
const line2 = ` ${chalk.white("Run:
|
|
79
|
+
const line2 = ` ${chalk.white("Run: " + NPM_INSTALL_COMMAND)}`;
|
|
79
80
|
const padLine = (content) => {
|
|
80
81
|
const visual = stripAnsi(content).length;
|
|
81
82
|
return chalk.yellow("│") + content + " ".repeat(Math.max(0, BOX_INNER_WIDTH - visual)) + chalk.yellow("│");
|
package/dist/utils/version.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import semver from "semver";
|
|
1
2
|
export function looksLikeVersion(value) {
|
|
2
3
|
return /^[0-9]+\.[0-9]+\.[0-9]+(?:[-+][^/]+)?$/.test(value);
|
|
3
4
|
}
|
|
@@ -172,101 +173,95 @@ export function coerceVersion(input) {
|
|
|
172
173
|
return `${major}.${minor}.${patch}`;
|
|
173
174
|
}
|
|
174
175
|
/**
|
|
175
|
-
* Does the string parse as a version range
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
176
|
+
* Does the string parse as a version range?
|
|
177
|
+
*
|
|
178
|
+
* Delegates to semver so the full grammar is accepted: comparators, compound
|
|
179
|
+
* (`>=1.2.3 <2`), unions (`^1 || ^2`), wildcards (`1.x`), hyphen ranges and
|
|
180
|
+
* partials. The previous hand-rolled regex accepted a single comparator only,
|
|
181
|
+
* so every bounded range read as invalid. OA002 treats "not a valid range" as
|
|
182
|
+
* a floating tag, which made correct bounded overrides look like `latest`
|
|
183
|
+
* (#1216).
|
|
184
|
+
*
|
|
185
|
+
* Empty input stays `false`: callers treat the empty string as a floating tag,
|
|
186
|
+
* whereas semver reads it as `*`.
|
|
179
187
|
*/
|
|
188
|
+
/**
|
|
189
|
+
* Normalize a version as it appears in an OSV advisory event to `X.Y.Z`.
|
|
190
|
+
*
|
|
191
|
+
* Advisories declare fix and introduced boundaries as exact versions, and those
|
|
192
|
+
* are routinely written with fewer than three components: `fixed: "1.22"` means
|
|
193
|
+
* 1.22.0. `looksLikeVersion` demands a strict `X.Y.Z`, so `collectAdvisoryFixes`
|
|
194
|
+
* discarded such an event and the finding then reported "no fix available",
|
|
195
|
+
* which is an instruction to stop looking (#1192).
|
|
196
|
+
*
|
|
197
|
+
* Deliberately a strict whole-string match rather than `semver.coerce`. Coercion
|
|
198
|
+
* reads leading digits out of anything, so a GIT range's commit hash becomes a
|
|
199
|
+
* plausible version:
|
|
200
|
+
*
|
|
201
|
+
* semver.coerce("74ea7cf4d1b1...") -> "74.0.0"
|
|
202
|
+
*
|
|
203
|
+
* which is the defect in #1191 rather than a fix for it. Anything this cannot
|
|
204
|
+
* read in full is rejected, so a non-version boundary never reaches a
|
|
205
|
+
* comparison.
|
|
206
|
+
*
|
|
207
|
+
* Note this is for ADVISORY versions only. It must not be used on manifest or
|
|
208
|
+
* override specs, where a bare `1.22` is the range `1.22.x` rather than 1.22.0.
|
|
209
|
+
*/
|
|
210
|
+
const ADVISORY_VERSION = /^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$/;
|
|
211
|
+
export function normalizeAdvisoryVersion(value) {
|
|
212
|
+
if (!value)
|
|
213
|
+
return null;
|
|
214
|
+
const match = ADVISORY_VERSION.exec(value.trim());
|
|
215
|
+
if (!match)
|
|
216
|
+
return null;
|
|
217
|
+
const [, major, minor = "0", patch = "0", prerelease = "", build = ""] = match;
|
|
218
|
+
return `${major}.${minor}.${patch}${prerelease}${build}`;
|
|
219
|
+
}
|
|
180
220
|
export function isValidRange(input) {
|
|
181
|
-
if (!input)
|
|
182
|
-
return false;
|
|
183
|
-
const trimmed = input.trim();
|
|
184
|
-
if (!/^(?:\^|~|>=|<=|>|<|=)?\s*\d+(?:\.\d+)?(?:\.\d+)?(?:[-+][^\s]+)?$/.test(trimmed)) {
|
|
221
|
+
if (!input || !input.trim())
|
|
185
222
|
return false;
|
|
186
|
-
}
|
|
187
|
-
return coerceVersion(trimmed) !== null;
|
|
223
|
+
return semver.validRange(input.trim(), { loose: true }) !== null;
|
|
188
224
|
}
|
|
189
225
|
/**
|
|
190
|
-
* Does `version` satisfy `range`?
|
|
191
|
-
* what the OA detectors need: exact, `^`, `~`, `>=`, `<=`, `>`, `<`, `=`.
|
|
226
|
+
* Does `version` satisfy `range`?
|
|
192
227
|
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
228
|
+
* Delegates normalization and comparison to `positionAgainstRange` so
|
|
229
|
+
* prerelease handling and coercion stay on one path. Uninterpretable input
|
|
230
|
+
* returns false because `positionAgainstRange` returns null.
|
|
196
231
|
*/
|
|
197
232
|
export function satisfiesRange(version, range) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
233
|
+
return positionAgainstRange(version, range) === "satisfies";
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Classify a concrete version relative to the complete set represented by a
|
|
237
|
+
* semver range. "outside" covers gaps in compound/union ranges: for example,
|
|
238
|
+
* 2.0.0 is neither globally below nor globally above `1.x || 3.x`.
|
|
239
|
+
*
|
|
240
|
+
* Returns null when either input cannot be interpreted as semver. Callers that
|
|
241
|
+
* already validate their inputs can treat null conservatively as "outside".
|
|
242
|
+
*/
|
|
243
|
+
export function positionAgainstRange(version, range) {
|
|
244
|
+
if (!version || !range)
|
|
245
|
+
return null;
|
|
246
|
+
const parsed = semver.parse(version.trim(), { loose: true });
|
|
247
|
+
const normalizedVersion = parsed ? parsed.version : coerceVersion(version);
|
|
201
248
|
const trimmedRange = range.trim();
|
|
202
|
-
//
|
|
203
|
-
//
|
|
204
|
-
//
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
// `=` operator
|
|
217
|
-
if (trimmedRange.startsWith("=")) {
|
|
218
|
-
const target = coerceVersion(trimmedRange.slice(1));
|
|
219
|
-
return target !== null && compareVersions(v, target) === 0;
|
|
220
|
-
}
|
|
221
|
-
// `^` caret: >= floor, ceiling at the leftmost non-zero component of the
|
|
222
|
-
// target (npm: ^1.2.0 -> <2.0.0; ^0.2.3 -> <0.3.0; ^0.0.3 -> <0.0.4).
|
|
223
|
-
// Partial ranges keep their component count: ^0 admits all 0.x, ^0.0 admits 0.0.x.
|
|
224
|
-
if (trimmedRange.startsWith("^")) {
|
|
225
|
-
const target = coerceVersion(trimmedRange.slice(1));
|
|
226
|
-
if (!target)
|
|
227
|
-
return false;
|
|
228
|
-
if (compareVersions(v, target) < 0)
|
|
229
|
-
return false;
|
|
230
|
-
const [vMaj, vMin, vPatch] = v.split(".").map(Number);
|
|
231
|
-
const [tMaj, tMin, tPatch] = target.split(".").map(Number);
|
|
232
|
-
const parts = trimmedRange.slice(1).split("-")[0].split(".");
|
|
233
|
-
if (tMaj > 0)
|
|
234
|
-
return vMaj === tMaj; // ^1, ^1.2, ^1.2.3
|
|
235
|
-
if (tMin > 0)
|
|
236
|
-
return vMaj === tMaj && vMin === tMin; // ^0.1, ^0.1.x
|
|
237
|
-
if (parts.length >= 3)
|
|
238
|
-
return vMaj === tMaj && vMin === tMin && vPatch === tPatch; // ^0.0.3 exact
|
|
239
|
-
if (parts.length === 2)
|
|
240
|
-
return vMaj === tMaj && vMin === tMin; // ^0.0 -> 0.0.x
|
|
241
|
-
return vMaj === tMaj; // ^0 -> all 0.x
|
|
242
|
-
}
|
|
243
|
-
// `~` tilde: same major.minor, >= specified
|
|
244
|
-
if (trimmedRange.startsWith("~")) {
|
|
245
|
-
const target = coerceVersion(trimmedRange.slice(1));
|
|
246
|
-
if (!target)
|
|
247
|
-
return false;
|
|
248
|
-
if (compareVersions(v, target) < 0)
|
|
249
|
-
return false;
|
|
250
|
-
const [vMaj, vMin] = v.split(".").map(Number);
|
|
251
|
-
const [tMaj, tMin] = target.split(".").map(Number);
|
|
252
|
-
return vMaj === tMaj && vMin === tMin;
|
|
249
|
+
// validRange only GUARDS here. Its normalized output is computed without
|
|
250
|
+
// includePrerelease, which rewrites prerelease bounds and would silently
|
|
251
|
+
// change the classification below, so the comparisons take the raw range.
|
|
252
|
+
if (!normalizedVersion || !semver.validRange(trimmedRange, { loose: true }))
|
|
253
|
+
return null;
|
|
254
|
+
const options = { loose: true, includePrerelease: true };
|
|
255
|
+
try {
|
|
256
|
+
if (semver.satisfies(normalizedVersion, trimmedRange, options))
|
|
257
|
+
return "satisfies";
|
|
258
|
+
if (semver.ltr(normalizedVersion, trimmedRange, options))
|
|
259
|
+
return "below";
|
|
260
|
+
if (semver.gtr(normalizedVersion, trimmedRange, options))
|
|
261
|
+
return "above";
|
|
262
|
+
return "outside";
|
|
253
263
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
if (trimmedRange.startsWith(op)) {
|
|
257
|
-
const target = coerceVersion(trimmedRange.slice(op.length));
|
|
258
|
-
if (!target)
|
|
259
|
-
return false;
|
|
260
|
-
const cmp = compareVersions(v, target);
|
|
261
|
-
if (op === ">=")
|
|
262
|
-
return cmp >= 0;
|
|
263
|
-
if (op === "<=")
|
|
264
|
-
return cmp <= 0;
|
|
265
|
-
if (op === ">")
|
|
266
|
-
return cmp > 0;
|
|
267
|
-
if (op === "<")
|
|
268
|
-
return cmp < 0;
|
|
269
|
-
}
|
|
264
|
+
catch {
|
|
265
|
+
return null;
|
|
270
266
|
}
|
|
271
|
-
return false;
|
|
272
267
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cve-lite-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.38.0",
|
|
4
4
|
"description": "Developer-friendly CLI for scanning JS/TS projects for dependency vulnerabilities using local lockfiles and OSV",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"better-sqlite3": "^12.8.0",
|
|
23
23
|
"fflate": "^0.8.3",
|
|
24
|
+
"semver": "^7.8.5",
|
|
24
25
|
"yaml": "^2.7.1",
|
|
25
26
|
"yarn-lockfile": "^1.1.0"
|
|
26
27
|
},
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
"@types/better-sqlite3": "^7.6.13",
|
|
29
30
|
"@types/jest": "^30.0.0",
|
|
30
31
|
"@types/node": "^24.0.0",
|
|
32
|
+
"@types/semver": "^7.8.0",
|
|
31
33
|
"jest": "^30.4.2",
|
|
32
34
|
"ts-jest": "^29.4.9",
|
|
33
35
|
"tsx": "^4.22.0",
|
|
@@ -208,10 +208,13 @@ function countPhrase(rows, { adjective } = {}) {
|
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
/**
|
|
211
|
-
* "
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
211
|
+
* "CVE-2026-84375", or the GHSA id when the finding carries no CVE alias.
|
|
212
|
+
*
|
|
213
|
+
* Capped, because a single package can carry dozens of advisories (tar@6.1.0
|
|
214
|
+
* has 36) and listing them all produces a line nobody can read. CVEs are shown
|
|
215
|
+
* in preference to GHSA ids, not alongside them, because they are what a
|
|
216
|
+
* reviewer recognises. That does mean this comment and the CLI's own findings
|
|
217
|
+
* table can name the same advisory differently.
|
|
215
218
|
*/
|
|
216
219
|
const MAX_IDS = 3;
|
|
217
220
|
|