eslint-plugin-secure-coding 3.3.0 → 3.3.1

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
@@ -1,3 +1,26 @@
1
+ ## 3.3.1
2
+
3
+ ### Patch Changes
4
+
5
+ - [#213](https://github.com/ofri-peretz/eslint/pull/213) [`391dbe6`](https://github.com/ofri-peretz/eslint/commit/391dbe6b39f78d549379218567cb959649f8c614) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Align every security rule's `meta.docs.cvss` to the CVSS its finding actually
6
+ emits. The emitted machine-readable message sources its `CVSS:x` from
7
+ `CWE_MAPPING` via `formatLLMMessage` → `enrichFromCWE`, but the static
8
+ `meta.docs.cvss` documentation field had drifted on 45 rules across these 7
9
+ plugins — e.g. `no-hardcoded-credentials` documented `9.5` while emitting
10
+ `CVSS:9.8` (the value the published article and SARIF/LLM consumers already
11
+ read).
12
+
13
+ This corrects the **documentation metadata only** — no emitted finding changes.
14
+ Locked by `security-cvss-docs-consistency.lock.test.ts` (cross-plugin: every
15
+ security rule's `meta.docs.cvss` must equal the CVSS it emits), the
16
+ `no-hardcoded-credentials` rule lock (real ESLint `Linter` emission), and a
17
+ devkit `enrichFromCWE` contract test pinning `CWE-798 → 9.8`.
18
+
19
+ Follow-up (not in scope): 50 security rules document a CVSS that never appears
20
+ in any emitted message (their messages carry no CWE), and several rules emit the
21
+ generic CWE score where a rule-specific score may be warranted — both change
22
+ emitted output and are separate decisions.
23
+
1
24
  ## 3.3.0
2
25
 
3
26
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-secure-coding",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "Security-focused ESLint plugin with 89 AI-parseable rules for detecting and preventing vulnerabilities. OWASP Top 10 2021 + Mobile Top 10 2024 coverage, CWE references, and AI-assisted fix guidance.",
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.js",
package/src/index.js CHANGED
@@ -103,7 +103,7 @@ exports.rules = {
103
103
  exports.plugin = {
104
104
  meta: {
105
105
  name: 'eslint-plugin-secure-coding',
106
- version: '3.3.0',
106
+ version: '3.3.1',
107
107
  },
108
108
  rules: exports.rules,
109
109
  };
@@ -18,7 +18,7 @@ exports.detectWeakPasswordValidation = (0, eslint_devkit_1.createRule)({
18
18
  url: 'https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-secure-coding/docs/rules/detect-weak-password-validation.md',
19
19
  description: 'Identify weak password requirements',
20
20
  cwe: 'CWE-521',
21
- cvss: 9.5,
21
+ cvss: 5.3,
22
22
  },
23
23
  messages: {
24
24
  violationDetected: (0, eslint_devkit_1.formatLLMMessage)({
@@ -130,7 +130,7 @@ exports.noHardcodedCredentials = (0, eslint_devkit_2.createRule)({
130
130
  url: 'https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-secure-coding/docs/rules/no-hardcoded-credentials.md',
131
131
  description: 'Detects hardcoded passwords, API keys, tokens, and other sensitive credentials',
132
132
  cwe: 'CWE-798',
133
- cvss: 9.5,
133
+ cvss: 9.8,
134
134
  confidence: 'medium',
135
135
  },
136
136
  fixable: 'code',
@@ -18,7 +18,7 @@ exports.noHardcodedSessionTokens = (0, eslint_devkit_1.createRule)({
18
18
  url: 'https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-secure-coding/docs/rules/no-hardcoded-session-tokens.md',
19
19
  description: 'Detect hardcoded session/JWT tokens',
20
20
  cwe: 'CWE-798',
21
- cvss: 9.5,
21
+ cvss: 9.8,
22
22
  },
23
23
  messages: {
24
24
  violationDetected: (0, eslint_devkit_1.formatLLMMessage)({
@@ -18,7 +18,7 @@ exports.noInsecureComparison = (0, eslint_devkit_2.createRule)({
18
18
  url: 'https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-secure-coding/docs/rules/no-insecure-comparison.md',
19
19
  description: 'Detects insecure comparison operators (==, !=) that can lead to type coercion vulnerabilities',
20
20
  cwe: 'CWE-697',
21
- cvss: 7.5,
21
+ cvss: 5.3,
22
22
  },
23
23
  fixable: 'code',
24
24
  hasSuggestions: true,
@@ -111,7 +111,7 @@ exports.noMissingAuthentication = (0, eslint_devkit_2.createRule)({
111
111
  url: 'https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-secure-coding/docs/rules/no-missing-authentication.md',
112
112
  description: 'Detects missing authentication checks in route handlers',
113
113
  cwe: 'CWE-287',
114
- cvss: 9.5,
114
+ cvss: 9.8,
115
115
  },
116
116
  hasSuggestions: true,
117
117
  messages: {
@@ -111,7 +111,7 @@ exports.noPrivilegeEscalation = (0, eslint_devkit_2.createRule)({
111
111
  url: 'https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-secure-coding/docs/rules/no-privilege-escalation.md',
112
112
  description: 'Detects potential privilege escalation vulnerabilities',
113
113
  cwe: 'CWE-269',
114
- cvss: 7.5,
114
+ cvss: 8.8,
115
115
  },
116
116
  hasSuggestions: true,
117
117
  messages: {
@@ -35,7 +35,7 @@ exports.noSensitiveDataExposure = (0, eslint_devkit_2.createRule)({
35
35
  url: 'https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-secure-coding/docs/rules/no-sensitive-data-exposure.md',
36
36
  description: 'Detects PII/credentials in logs, responses, or error messages',
37
37
  cwe: 'CWE-532',
38
- cvss: 7.5,
38
+ cvss: 5.3,
39
39
  },
40
40
  hasSuggestions: true,
41
41
  messages: {
@@ -35,7 +35,7 @@ exports.noTemplateInjection = (0, eslint_devkit_1.createRule)({
35
35
  url: 'https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-secure-coding/docs/rules/no-template-injection.md',
36
36
  description: 'Disallow dynamic strings as template arguments to server-side template engines (CWE-94)',
37
37
  cwe: 'CWE-94',
38
- cvss: 9.1,
38
+ cvss: 9.8,
39
39
  },
40
40
  messages: {
41
41
  templateInjection: (0, eslint_devkit_1.formatLLMMessage)({
@@ -61,7 +61,7 @@ exports.noXxeInjection = (0, eslint_devkit_1.createRule)({
61
61
  description: 'Detect XML External Entity (XXE) injection vulnerabilities',
62
62
  url: 'https://cwe.mitre.org/data/definitions/611.html',
63
63
  cwe: 'CWE-611',
64
- cvss: 9.5,
64
+ cvss: 9.1,
65
65
  },
66
66
  messages: {
67
67
  xxeInjection: (0, eslint_devkit_2.formatLLMMessage)({
@@ -18,7 +18,7 @@ exports.requireBackendAuthorization = (0, eslint_devkit_1.createRule)({
18
18
  url: 'https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-secure-coding/docs/rules/require-backend-authorization.md',
19
19
  description: 'Require server-side authorization checks',
20
20
  cwe: 'CWE-602',
21
- cvss: 9.5,
21
+ cvss: 6.5,
22
22
  },
23
23
  messages: {
24
24
  violationDetected: (0, eslint_devkit_1.formatLLMMessage)({