cra-audit 2.4.0 → 2.4.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/CHANGELOG.md CHANGED
@@ -8,6 +8,20 @@ Releases are automated: pushing a `vX.Y.Z` tag publishes the package to npm
8
8
  (with provenance) and creates the GitHub Release from the matching section
9
9
  below, so add the section before running `npm version`.
10
10
 
11
+ ## [2.4.2] — Art. 14 notice: assess exploitability first
12
+
13
+ ### Changed
14
+
15
+ - The Art. 14 notice now reads **"applies if this known exploited (CISA KEV) vulnerability is exploitable in your product"** and leads with the assessment: not exploitable → record a `not_affected` VEX statement; exploitable → notify the coordinating CSIRT and ENISA within 24 h / 72 h / 14 days of becoming aware.
16
+ - The audit check label and the SARIF message say "CRA Art. 14 reporting applies if exploitable in your product" instead of "may apply".
17
+
18
+ ## [2.4.1] — Clearer CRA Art. 14 notice
19
+
20
+ ### Changed
21
+
22
+ - The Art. 14 notice is now headed **"dependency with a known exploited vulnerability (CISA KEV)"** instead of "actively exploited vulnerability in a dependency". A KEV match means the vulnerability has been exploited somewhere; the reporting duty applies once you are aware that it is exploitable in your product (CRA Art. 3(42) and Art. 14(1)). The 24 h / 72 h / 14 days deadlines run from that awareness, not from the KEV listing.
23
+ - README and the Spanish INCIBE-CERT guide describe KEV matches as a trigger to assess and document with VEX, not as a started reporting clock.
24
+
11
25
  ## [2.4.0] — Report to your country's CSIRT (INCIBE-CERT for Spain)
12
26
 
13
27
  ### Highlights
package/README.md CHANGED
@@ -55,21 +55,24 @@ Checks every **direct and transitive** dependency, at the exact version pinned i
55
55
  | --- | --- | --- |
56
56
  | [OSV.dev](https://osv.dev) — GitHub Advisory Database | Known vulnerabilities, with severity, CVE aliases and the version that fixes them | Fails at or above `--fail-on` (default `high`) |
57
57
  | OSV.dev — [OpenSSF malicious packages](https://github.com/ossf/malicious-packages) | Compromised releases (`MAL-*`), e.g. the Shai-Hulud worm versions | **Always fails**; cannot be allowlisted |
58
- | [CISA KEV](https://www.cisa.gov/known-exploited-vulnerabilities-catalog) | Vulnerabilities with evidence of **active exploitation** | Fails by default (`--no-fail-on-kev` to only warn) and prints the CRA Art. 14 reporting clock |
58
+ | [CISA KEV](https://www.cisa.gov/known-exploited-vulnerabilities-catalog) | Vulnerabilities with evidence of **active exploitation** | Fails by default (`--no-fail-on-kev` to only warn) and shows the CRA Art. 14 deadlines that apply if it is exploitable in your product |
59
59
 
60
60
  ```text
61
61
  HIGH [KEV] vite@6.2.3 (fix: vite@6.4.3)
62
62
  GHSA-4r4m-qw57-chr8 / CVE-2025-31125 Vite has a `server.fs.deny` bypassed … [KEV since 2026-01-22]
63
63
 
64
- ⚠ CRA Art. 14 — actively exploited vulnerability in a dependency
65
- • Early warning ........ within 24 hours of becoming aware
66
- • Notification ......... within 72 hours
67
- • Final report ......... within 14 days after a corrective measure is available
64
+ ⚠ CRA Art. 14 — applies if this known exploited (CISA KEV) vulnerability is exploitable in your product
65
+ Assess first: is the vulnerable code shipped and exploitable in your product?
66
+ • Not exploitable ...... record it as not_affected with VEX (cra-audit vex)
67
+ • Exploitable .......... notify the coordinating CSIRT and ENISA through the Single Reporting Platform (SRP):
68
+ Early warning ...... within 24 hours of becoming aware
69
+ Notification ....... within 72 hours
70
+ Final report ....... within 14 days after a corrective measure is available
68
71
  ```
69
72
 
70
73
  Only package names and versions are sent to `api.osv.dev`; the KEV catalogue is downloaded from cisa.gov (or CISA's GitHub mirror). If KEV cannot be reached the report says so instead of silently passing, and if OSV.dev is unreachable the audit falls back to `npm audit`. `--vuln-source npm` uses `npm audit` directly.
71
74
 
72
- > CRA Annex I Part I (2)(a) — *placed on the market without known exploitable vulnerabilities*. Art. 14 — *actively exploited vulnerabilities must be reported within 24 hours*.
75
+ > CRA Annex I Part I (2)(a) — *placed on the market without known exploitable vulnerabilities*. Art. 14 — *any actively exploited vulnerability contained in the product* must be notified, with an early warning within 24 hours of becoming aware. A KEV match means the vulnerability has been exploited somewhere: assess whether it is exploitable in your product and record the decision with VEX.
73
76
 
74
77
  ### 3. Third-party component check
75
78
 
@@ -171,7 +174,7 @@ Findings point at the exact line of the manifest (in the console and in SARIF).
171
174
 
172
175
  **Input SBOM (`-i`), any language:**
173
176
 
174
- `audit`, `vuln`, `licenses` and `vex` accept an existing **CycloneDX JSON**, **SPDX 2.x JSON** or **SPDX 3.0 JSON-LD** SBOM instead of the npm lockfile. Every component is looked up in OSV.dev by its **Package URL**, so you get the same checks — known vulnerabilities, **malicious packages**, **CISA KEV** with the Art. 14 clock, licenses, VEX and SARIF — for any ecosystem OSV covers (Maven, PyPI, Go, crates.io, NuGet, Packagist, RubyGems, Hex, Pub, npm…).
177
+ `audit`, `vuln`, `licenses` and `vex` accept an existing **CycloneDX JSON**, **SPDX 2.x JSON** or **SPDX 3.0 JSON-LD** SBOM instead of the npm lockfile. Every component is looked up in OSV.dev by its **Package URL**, so you get the same checks — known vulnerabilities, **malicious packages**, **CISA KEV** with the Art. 14 deadlines, licenses, VEX and SARIF — for any ecosystem OSV covers (Maven, PyPI, Go, crates.io, NuGet, Packagist, RubyGems, Hex, Pub, npm…).
175
178
 
176
179
  ```bash
177
180
  # Generate the SBOM with the tool of your ecosystem…
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cra-audit",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
4
4
  "description": "Audits npm, yarn, and pnpm projects for compliance with the European Cyber Resilience Act (CRA, EU Regulation 2024/2847) and BSI TR-03183: SBOM (CycloneDX/SPDX), known vulnerabilities, third-party components, and licenses.",
5
5
  "homepage": "https://github.com/migohe14/cra-audit#readme",
6
6
  "repository": {
@@ -189,7 +189,7 @@ function exploitationReasons(vulns, policy) {
189
189
  reasons.push({
190
190
  label: exploited.length === 0
191
191
  ? 'No actively exploited vulnerabilities (CISA KEV)'
192
- : `${exploited.length} component(s) with actively exploited vulnerabilities (CISA KEV) — CRA Art. 14 reporting may apply`,
192
+ : `${exploited.length} component(s) with actively exploited vulnerabilities (CISA KEV) — CRA Art. 14 reporting applies if exploitable in your product`,
193
193
  passed: exploited.length === 0 || policy.failOnKev === false,
194
194
  warning: exploited.length > 0 && policy.failOnKev === false,
195
195
  });
package/src/core/kev.js CHANGED
@@ -6,7 +6,9 @@ const { fetchJson } = require('../utils/http');
6
6
  * CISA Known Exploited Vulnerabilities catalogue: the most complete public
7
7
  * list of vulnerabilities with evidence of active exploitation. Under CRA
8
8
  * Art. 14 (applicable since 11 September 2026) manufacturers must report
9
- * actively exploited vulnerabilities in their products within 24 hours.
9
+ * actively exploited vulnerabilities contained in their products within 24
10
+ * hours of becoming aware. A KEV match is a signal to assess, not a report
11
+ * by itself: the vulnerability must be exploitable in the product.
10
12
  *
11
13
  * The GitHub mirror maintained by CISA is used when the primary feed fails.
12
14
  */
@@ -20,8 +20,8 @@ const DEFAULT_POLICY = {
20
20
  sbomCreator: null,
21
21
  // Vulnerability source: `osv` (OSV.dev + CISA KEV) or `npm` (npm audit).
22
22
  vulnerabilitySource: 'osv',
23
- // Fail when a dependency has an actively exploited vulnerability (CISA KEV),
24
- // the trigger of the CRA Art. 14 reporting obligation.
23
+ // Fail when a dependency has an actively exploited vulnerability (CISA KEV):
24
+ // if it is exploitable in the product, CRA Art. 14 reporting applies.
25
25
  failOnKev: true,
26
26
  // ISO 3166-1 alpha-2 country of the manufacturer's main establishment: it
27
27
  // decides the CSIRT that receives CRA Art. 14 notifications (e.g. "ES").
@@ -100,13 +100,13 @@ function describeSources(section) {
100
100
  function renderArticle14Notice(reporting) {
101
101
  const local = reporting && reporting.local;
102
102
  logger.log('');
103
- logger.warn(color.bold('CRA Art. 14 — actively exploited vulnerability in a dependency'));
104
- logger.detail('If it affects a product with digital elements you place on the EU market, notify');
105
- logger.detail(`${local ? `${local.csirt} and ENISA` : 'the coordinating CSIRT and ENISA'} through the Single Reporting Platform (SRP):`);
106
- logger.detail(' • Early warning ........ within 24 hours of becoming aware');
107
- logger.detail(' • Notification ......... within 72 hours');
108
- logger.detail(' • Final report ......... within 14 days after a corrective measure is available');
109
- logger.detail('Assess exploitability in your product first; document the decision either way.');
103
+ logger.warn(color.bold('CRA Art. 14 — applies if this known exploited (CISA KEV) vulnerability is exploitable in your product'));
104
+ logger.detail('Assess first: is the vulnerable code shipped and exploitable in your product?');
105
+ logger.detail(' • Not exploitable ...... record it as not_affected with VEX (cra-audit vex)');
106
+ logger.detail(` • Exploitable .......... notify ${local ? `${local.csirt} and ENISA` : 'the coordinating CSIRT and ENISA'} through the Single Reporting Platform (SRP):`);
107
+ logger.detail(' Early warning ...... within 24 hours of becoming aware');
108
+ logger.detail(' Notification ....... within 72 hours');
109
+ logger.detail(' Final report ....... within 14 days after a corrective measure is available');
110
110
  if (local) {
111
111
  logger.log('');
112
112
  logger.detail(color.bold(`${local.csirt} (${local.country}) — access to the SRP:`));
@@ -142,7 +142,7 @@ function vulnerabilityMessage(finding, source) {
142
142
  return `[MALICIOUS] ${pkg} is a known compromised release (${source.id}). Remove it and rotate exposed credentials.`;
143
143
  }
144
144
  const parts = [];
145
- if (source.kev) parts.push(`[ACTIVELY EXPLOITED — CISA KEV since ${source.kev.dateAdded}; CRA Art. 14 reporting may apply]`);
145
+ if (source.kev) parts.push(`[ACTIVELY EXPLOITED — CISA KEV since ${source.kev.dateAdded}; CRA Art. 14 reporting applies if exploitable in your product]`);
146
146
  parts.push(`${pkg}: ${source.title || source.id}`);
147
147
  const cves = (source.aliases || []).filter((a) => /^CVE-/i.test(a));
148
148
  if (cves.length) parts.push(`(${cves.join(', ')})`);