cve-lite-cli 1.17.1 → 1.17.2

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/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import { createSpinner } from "./output/spinner.js";
15
15
  import { buildSuggestedFixCommandPlan } from "./remediation/fix-commands.js";
16
16
  import { scanProjectForPackageUsage } from "./usage/scanner.js";
17
17
  import { getCliVersion } from "./utils/version-info.js";
18
- import { isLikelyBlockedAdvisoryRequestError } from "./utils/network.js";
18
+ import { isLikelyBlockedAdvisoryRequestError, isSslCertificateError, sslCertificateErrorHint, blockedAdvisoryRequestHint } from "./utils/network.js";
19
19
  import { logInfo, logWarn, printCacheSummary, sortFindingsForOutput } from "./output/formatters.js";
20
20
  import { buildReportData, writeHtmlReport } from "./output/html-reporter.js";
21
21
  import { writeOutputs } from "./output/write-outputs.js";
@@ -255,10 +255,15 @@ if (parsedArgs) {
255
255
  main().catch((error) => {
256
256
  const errorMessage = error instanceof Error ? error.message : String(error);
257
257
  console.error(chalk.red(`Error: ${errorMessage}`));
258
- if (isLikelyBlockedAdvisoryRequestError(errorMessage)) {
259
- console.error(chalk.yellow("Hint: Outbound access to the OSV API may be blocked or restricted in this environment."));
260
- console.error(chalk.gray("If that is expected, build the advisory DB on a machine with OSV access, then scan here with `--offline` or `--offline-db /path/to/advisories.db`."));
261
- console.error(chalk.gray("Command to build the DB on a network-allowed machine: `cve-lite advisories sync --output /path/to/advisories.db`"));
258
+ if (isSslCertificateError(errorMessage)) {
259
+ const [hint, ...rest] = sslCertificateErrorHint();
260
+ console.error(chalk.yellow(hint));
261
+ rest.forEach(line => console.error(chalk.gray(line)));
262
+ }
263
+ else if (isLikelyBlockedAdvisoryRequestError(errorMessage)) {
264
+ const [hint, ...rest] = blockedAdvisoryRequestHint();
265
+ console.error(chalk.yellow(hint));
266
+ rest.forEach(line => console.error(chalk.gray(line)));
262
267
  }
263
268
  process.exit(1);
264
269
  });
@@ -238,10 +238,10 @@ ${noticesHtml}
238
238
  <tr>
239
239
  <th style="width:32px"></th>
240
240
  <th onclick="sortBy('package')">Package <span class="sort-arrow">↕</span></th>
241
+ <th>Fix available</th>
241
242
  <th onclick="sortBy('severity')" class="sorted">Severity <span class="sort-arrow" style="color:#58a6ff">↓</span></th>
242
243
  <th onclick="sortBy('relationship')">Type <span class="sort-arrow">↕</span></th>
243
244
  <th>CVE / Advisory</th>
244
- <th>Fix available</th>
245
245
  </tr>
246
246
  </thead>
247
247
  <tbody id="findings-tbody">
@@ -324,7 +324,7 @@ function applyFilters() {
324
324
  function sortBy(col) {
325
325
  if (sortCol === col) { sortAsc = !sortAsc; } else { sortCol = col; sortAsc = col === 'package'; }
326
326
  document.querySelectorAll('.findings-table thead th').forEach(th => th.classList.remove('sorted'));
327
- const colIndex = ['', 'package', 'severity', 'relationship'].indexOf(col);
327
+ const colIndex = ['', 'package', '', 'severity', 'relationship'].indexOf(col);
328
328
  if (colIndex > 0) document.querySelectorAll('.findings-table thead th')[colIndex].classList.add('sorted');
329
329
 
330
330
  const tbody = document.getElementById('findings-tbody');
@@ -418,10 +418,10 @@ function renderFindingRow(finding, idx) {
418
418
  return ` <tr id="row-${idx}" onclick="toggleRow(${idx})">
419
419
  <td><span class="expand-icon" id="icon-${idx}">▶</span></td>
420
420
  <td><div class="pkg-name">${escapeHtml(finding.package)}</div><div class="pkg-version">${escapeHtml(finding.version)}</div></td>
421
+ <td>${fixHtml}</td>
421
422
  <td><span class="sev-badge ${escapeHtml(finding.severity)}">${escapeHtml(finding.severity)}</span></td>
422
423
  <td><span class="rel-badge ${escapeHtml(finding.relationship)}">${escapeHtml(finding.relationship)}</span></td>
423
424
  <td>${cveLinks}</td>
424
- <td>${fixHtml}</td>
425
425
  </tr>
426
426
  <tr id="detail-${idx}" class="detail-row">
427
427
  <td colspan="6">
@@ -1,3 +1,33 @@
1
+ export function sslCertificateErrorHint() {
2
+ return [
3
+ "Hint: SSL certificate error — your network may be using a corporate proxy that intercepts HTTPS traffic.",
4
+ "Fix 1 (recommended): trust your corporate CA certificate:",
5
+ " NODE_EXTRA_CA_CERTS=/path/to/corporate-ca.crt cve-lite .",
6
+ "Fix 2 (quick workaround, not recommended for production): disable TLS verification:",
7
+ " NODE_TLS_REJECT_UNAUTHORIZED=0 cve-lite .",
8
+ ];
9
+ }
10
+ export function blockedAdvisoryRequestHint() {
11
+ return [
12
+ "Hint: Outbound access to the OSV API may be blocked or restricted in this environment.",
13
+ "If that is expected, build the advisory DB on a machine with OSV access, then scan here with `--offline` or `--offline-db /path/to/advisories.db`.",
14
+ "Command to build the DB on a network-allowed machine: `cve-lite advisories sync --output /path/to/advisories.db`",
15
+ ];
16
+ }
17
+ export function isSslCertificateError(message) {
18
+ const normalized = message.toLowerCase();
19
+ return [
20
+ "self-signed certificate",
21
+ "self_signed_cert_in_chain",
22
+ "cert_untrusted",
23
+ "unable_to_verify_leaf_signature",
24
+ "depth_zero_self_signed_cert",
25
+ "certificate has expired",
26
+ "cert_has_expired",
27
+ "unable to verify the first certificate",
28
+ "certificate chain",
29
+ ].some(indicator => normalized.includes(indicator));
30
+ }
1
31
  export function isLikelyBlockedAdvisoryRequestError(message) {
2
32
  if (!message.includes("OSV")) {
3
33
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cve-lite-cli",
3
- "version": "1.17.1",
3
+ "version": "1.17.2",
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": {