eslint-plugin-browser-security 1.2.4 → 1.2.5

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,5 +1,28 @@
1
1
  ## [1.2.3] - 2026-02-08
2
2
 
3
+ ## 1.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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
8
+ emits. The emitted machine-readable message sources its `CVSS:x` from
9
+ `CWE_MAPPING` via `formatLLMMessage` → `enrichFromCWE`, but the static
10
+ `meta.docs.cvss` documentation field had drifted on 45 rules across these 7
11
+ plugins — e.g. `no-hardcoded-credentials` documented `9.5` while emitting
12
+ `CVSS:9.8` (the value the published article and SARIF/LLM consumers already
13
+ read).
14
+
15
+ This corrects the **documentation metadata only** — no emitted finding changes.
16
+ Locked by `security-cvss-docs-consistency.lock.test.ts` (cross-plugin: every
17
+ security rule's `meta.docs.cvss` must equal the CVSS it emits), the
18
+ `no-hardcoded-credentials` rule lock (real ESLint `Linter` emission), and a
19
+ devkit `enrichFromCWE` contract test pinning `CWE-798 → 9.8`.
20
+
21
+ Follow-up (not in scope): 50 security rules document a CVSS that never appears
22
+ in any emitted message (their messages carry no CWE), and several rules emit the
23
+ generic CWE score where a rule-specific score may be warranted — both change
24
+ emitted output and are separate decisions.
25
+
3
26
  ## 1.2.4
4
27
 
5
28
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-browser-security",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Security-focused ESLint plugin for browser applications. Detects XSS vulnerabilities, postMessage abuse, localStorage/sessionStorage/IndexedDB token exposure, cookie security issues, WebSocket security, Blob URL leaks, Service Worker risks, and CSP misconfigurations.",
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.js",
package/src/index.js CHANGED
@@ -127,7 +127,7 @@ exports.rules = {
127
127
  exports.plugin = {
128
128
  meta: {
129
129
  name: 'eslint-plugin-browser-security',
130
- version: '1.2.4',
130
+ version: '1.2.5',
131
131
  },
132
132
  rules: exports.rules,
133
133
  };
@@ -20,7 +20,7 @@ exports.detectMixedContent = (0, eslint_devkit_1.createRule)({
20
20
  url: 'https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-browser-security/docs/rules/detect-mixed-content.md',
21
21
  description: 'Detect HTTP resources in HTTPS pages',
22
22
  cwe: 'CWE-311',
23
- cvss: 5,
23
+ cvss: 7.5,
24
24
  },
25
25
  messages: {
26
26
  violationDetected: (0, eslint_devkit_1.formatLLMMessage)({
@@ -18,7 +18,7 @@ exports.noClientSideAuthLogic = (0, eslint_devkit_1.createRule)({
18
18
  url: 'https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-browser-security/docs/rules/no-client-side-auth-logic.md',
19
19
  description: 'Prevent authentication logic in client code',
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)({
@@ -20,7 +20,7 @@ exports.noCredentialsInQueryParams = (0, eslint_devkit_1.createRule)({
20
20
  url: 'https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-browser-security/docs/rules/no-credentials-in-query-params.md',
21
21
  description: 'Disallow credentials in URL query parameters',
22
22
  cwe: 'CWE-798',
23
- cvss: 9.5,
23
+ cvss: 9.8,
24
24
  },
25
25
  messages: {
26
26
  violationDetected: (0, eslint_devkit_1.formatLLMMessage)({
@@ -24,7 +24,7 @@ exports.noEval = (0, eslint_devkit_1.createRule)({
24
24
  url: 'https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-browser-security/docs/rules/no-eval.md',
25
25
  description: 'Disallow eval(), Function(), and other code execution patterns',
26
26
  cwe: 'CWE-95',
27
- cvss: 9.5,
27
+ cvss: 9.8,
28
28
  },
29
29
  hasSuggestions: true,
30
30
  messages: {
@@ -41,7 +41,7 @@ exports.noInnerhtml = (0, eslint_devkit_1.createRule)({
41
41
  url: 'https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-browser-security/docs/rules/no-innerhtml.md',
42
42
  description: 'Disallow dangerous innerHTML/outerHTML assignments that can lead to XSS',
43
43
  cwe: 'CWE-79',
44
- cvss: 9.5,
44
+ cvss: 6.1,
45
45
  confidence: 'medium',
46
46
  },
47
47
  hasSuggestions: true,
@@ -49,7 +49,7 @@ exports.noMissingCsrfProtection = (0, eslint_devkit_2.createRule)({
49
49
  url: 'https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-browser-security/docs/rules/no-missing-csrf-protection.md',
50
50
  description: 'Detects missing CSRF token validation in POST/PUT/DELETE requests',
51
51
  cwe: 'CWE-352',
52
- cvss: 7.5,
52
+ cvss: 8.8,
53
53
  },
54
54
  hasSuggestions: true,
55
55
  messages: {
@@ -20,7 +20,7 @@ exports.noPasswordInUrl = (0, eslint_devkit_1.createRule)({
20
20
  url: 'https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-browser-security/docs/rules/no-password-in-url.md',
21
21
  description: 'Prevent passwords in URLs',
22
22
  cwe: 'CWE-521',
23
- cvss: 9.5,
23
+ cvss: 5.3,
24
24
  },
25
25
  messages: {
26
26
  violationDetected: (0, eslint_devkit_1.formatLLMMessage)({
@@ -88,7 +88,7 @@ exports.noUnescapedUrlParameter = (0, eslint_devkit_2.createRule)({
88
88
  url: 'https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-browser-security/docs/rules/no-unescaped-url-parameter.md',
89
89
  description: 'Detects unescaped URL parameters',
90
90
  cwe: 'CWE-79',
91
- cvss: 7.5,
91
+ cvss: 6.1,
92
92
  },
93
93
  hasSuggestions: true,
94
94
  messages: {