oxlint-plugin-browser-security 2.1.11 → 2.2.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/README.md +272 -11
- package/index.d.ts +3 -0
- package/index.js +1 -1
- package/package.json +22 -11
package/README.md
CHANGED
|
@@ -1,22 +1,283 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://eslint.interlace.tools/docs/security/plugin-browser-security?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security" target="blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://eslint.interlace.tools/logos/interlace-dark.svg"><img src="https://eslint.interlace.tools/logos/interlace-light.svg" alt="Interlace" height="90" /></picture></a>
|
|
3
|
+
|
|
4
|
+
<a href="https://www.chromium.org" target="_blank"><img src="https://eslint.interlace.tools/logos/chromium.svg" alt="Chromium" height="90" /></a>
|
|
5
|
+
|
|
6
|
+
<a href="https://oxc.rs" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://eslint.interlace.tools/logos/oxlint-dark.svg"><img src="https://eslint.interlace.tools/logos/oxlint-light.svg" alt="oxlint" height="90" /></picture></a>
|
|
7
|
+
</p>
|
|
2
8
|
|
|
3
|
-
|
|
4
|
-
|
|
9
|
+
<p align="center">
|
|
10
|
+
Browser-specific security rules to prevent XSS and other client-side attacks.
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="https://www.npmjs.com/package/oxlint-plugin-browser-security" target="_blank"><img src="https://img.shields.io/npm/v/oxlint-plugin-browser-security.svg" alt="NPM Version" /></a>
|
|
15
|
+
<a href="https://www.npmjs.com/package/oxlint-plugin-browser-security" target="_blank"><img src="https://img.shields.io/npm/dm/oxlint-plugin-browser-security.svg" alt="NPM Downloads" /></a>
|
|
16
|
+
<a href="https://packagephobia.com/result?p=oxlint-plugin-browser-security" target="_blank"><img src="https://badgen.net/packagephobia/install/oxlint-plugin-browser-security" alt="Install Size" /></a>
|
|
17
|
+
<a href="https://opensource.org/licenses/MIT" target="_blank"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="Package License" /></a>
|
|
18
|
+
<a href="https://app.codecov.io/gh/ofri-peretz/eslint/components?components%5B0%5D=eslint-plugin-browser-security" target="_blank"><img src="https://codecov.io/gh/ofri-peretz/eslint/graph/badge.svg?component=eslint-plugin-browser-security" alt="Codecov" /></a>
|
|
19
|
+
<a href="https://github.com/ofri-peretz/eslint" target="_blank"><img src="https://img.shields.io/badge/Since-Dec_2025-blue?logo=rocket&logoColor=white" alt="Since Dec 2025" /></a>
|
|
20
|
+
<a href="https://scorecard.dev/viewer/?uri=github.com/ofri-peretz/eslint" target="_blank"><img src="https://api.securityscorecards.dev/projects/github.com/ofri-peretz/eslint/badge" alt="OpenSSF Scorecard" /></a>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
> ⭐ If this plugin caught a real bug for you, [**star the repo**](https://github.com/ofri-peretz/eslint) — it's the signal that keeps these rules maintained.
|
|
24
|
+
|
|
25
|
+
## Description
|
|
26
|
+
|
|
27
|
+
`oxlint-plugin-browser-security` is the [oxlint](https://oxc.rs/docs/guide/usage/linter/js-plugins) and [Vite+](https://viteplus.dev/guide/lint) name for [`eslint-plugin-browser-security`](https://www.npmjs.com/package/eslint-plugin-browser-security). It carries the same rules under the same IDs (`browser-security/<rule>`), always at the same version, because it re-exports that package rather than copying it. Installing it does not install ESLint.
|
|
28
|
+
|
|
29
|
+
## Covered natively by oxlint
|
|
30
|
+
|
|
31
|
+
None of these 46 rules has an oxlint built-in equivalent. Every rule here is new to oxlint.
|
|
32
|
+
|
|
33
|
+
- **Why** — a linter nobody reads protects nothing. We would rather miss a finding
|
|
34
|
+
than spend your attention on one that was never real.
|
|
35
|
+
- **How** — evidence, not names. A rule fires on what the code _does_, resolved
|
|
36
|
+
through the AST and ESLint's own scope analysis.
|
|
37
|
+
- **What** — every finding carries its fix, in prose for a human and as structured
|
|
38
|
+
JSON for an agent. Security rules add a CWE mapping and, where assigned, a CVSS score.
|
|
39
|
+
|
|
40
|
+
That trade costs recall, and we measure it:
|
|
41
|
+
[methodology](https://github.com/ofri-peretz/eslint/blob/main/BENCHMARK-METHODOLOGY.md)
|
|
42
|
+
· [results](https://github.com/ofri-peretz/eslint/blob/main/BENCHMARK-RESULTS.md)
|
|
43
|
+
· [a false positive is a bug](https://github.com/ofri-peretz/eslint/issues).
|
|
44
|
+
|
|
45
|
+
## Getting Started
|
|
5
46
|
|
|
6
47
|
```bash
|
|
7
|
-
npm
|
|
48
|
+
npm install oxlint-plugin-browser-security --save-dev
|
|
8
49
|
```
|
|
9
50
|
|
|
10
|
-
|
|
51
|
+
### Vite+
|
|
11
52
|
|
|
12
|
-
```
|
|
13
|
-
|
|
53
|
+
```ts
|
|
54
|
+
// vite.config.ts
|
|
55
|
+
import { defineConfig } from 'vite-plus';
|
|
56
|
+
|
|
57
|
+
export default defineConfig({
|
|
58
|
+
lint: {
|
|
59
|
+
jsPlugins: ['oxlint-plugin-browser-security'],
|
|
60
|
+
rules: {
|
|
61
|
+
'browser-security/detect-mixed-content': 'error',
|
|
62
|
+
'browser-security/no-allow-arbitrary-loads': 'error',
|
|
63
|
+
'browser-security/no-client-side-auth-logic': 'error',
|
|
64
|
+
'browser-security/no-cookie-auth-tokens': 'error',
|
|
65
|
+
'browser-security/no-credentials-in-query-params': 'error',
|
|
66
|
+
'browser-security/no-disabled-certificate-validation': 'error',
|
|
67
|
+
'browser-security/no-dynamic-service-worker-url': 'error',
|
|
68
|
+
'browser-security/no-eval': 'error',
|
|
69
|
+
'browser-security/no-filereader-innerhtml': 'error',
|
|
70
|
+
'browser-security/no-http-urls': 'error',
|
|
71
|
+
'browser-security/no-incomplete-url-sanitization': 'error',
|
|
72
|
+
'browser-security/no-innerhtml': 'error',
|
|
73
|
+
'browser-security/no-insecure-redirects': 'error',
|
|
74
|
+
'browser-security/no-insecure-websocket': 'error',
|
|
75
|
+
'browser-security/no-jwt-in-storage': 'error',
|
|
76
|
+
'browser-security/no-postmessage-innerhtml': 'error',
|
|
77
|
+
'browser-security/no-postmessage-wildcard-origin': 'error',
|
|
78
|
+
'browser-security/no-sensitive-cookie-js': 'error',
|
|
79
|
+
'browser-security/no-sensitive-indexeddb': 'error',
|
|
80
|
+
'browser-security/no-sensitive-localstorage': 'error',
|
|
81
|
+
'browser-security/no-sensitive-sessionstorage': 'error',
|
|
82
|
+
'browser-security/no-unencrypted-transmission': 'error',
|
|
83
|
+
'browser-security/no-unsafe-eval-csp': 'error',
|
|
84
|
+
'browser-security/no-unsafe-inline-csp': 'error',
|
|
85
|
+
'browser-security/no-unvalidated-deeplinks': 'error',
|
|
86
|
+
'browser-security/no-websocket-eval': 'error',
|
|
87
|
+
'browser-security/no-websocket-innerhtml': 'error',
|
|
88
|
+
'browser-security/no-worker-message-innerhtml': 'error',
|
|
89
|
+
'browser-security/require-cookie-secure-attrs': 'error',
|
|
90
|
+
'browser-security/require-https-only': 'error',
|
|
91
|
+
'browser-security/require-postmessage-origin-check': 'error',
|
|
92
|
+
'browser-security/require-websocket-wss': 'error',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
});
|
|
14
96
|
```
|
|
15
97
|
|
|
16
|
-
|
|
98
|
+
### oxlint
|
|
17
99
|
|
|
18
|
-
```
|
|
19
|
-
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"jsPlugins": ["oxlint-plugin-browser-security"],
|
|
103
|
+
"rules": {
|
|
104
|
+
"browser-security/detect-mixed-content": "error",
|
|
105
|
+
"browser-security/no-allow-arbitrary-loads": "error",
|
|
106
|
+
"browser-security/no-client-side-auth-logic": "error",
|
|
107
|
+
"browser-security/no-cookie-auth-tokens": "error",
|
|
108
|
+
"browser-security/no-credentials-in-query-params": "error",
|
|
109
|
+
"browser-security/no-disabled-certificate-validation": "error",
|
|
110
|
+
"browser-security/no-dynamic-service-worker-url": "error",
|
|
111
|
+
"browser-security/no-eval": "error",
|
|
112
|
+
"browser-security/no-filereader-innerhtml": "error",
|
|
113
|
+
"browser-security/no-http-urls": "error",
|
|
114
|
+
"browser-security/no-incomplete-url-sanitization": "error",
|
|
115
|
+
"browser-security/no-innerhtml": "error",
|
|
116
|
+
"browser-security/no-insecure-redirects": "error",
|
|
117
|
+
"browser-security/no-insecure-websocket": "error",
|
|
118
|
+
"browser-security/no-jwt-in-storage": "error",
|
|
119
|
+
"browser-security/no-postmessage-innerhtml": "error",
|
|
120
|
+
"browser-security/no-postmessage-wildcard-origin": "error",
|
|
121
|
+
"browser-security/no-sensitive-cookie-js": "error",
|
|
122
|
+
"browser-security/no-sensitive-indexeddb": "error",
|
|
123
|
+
"browser-security/no-sensitive-localstorage": "error",
|
|
124
|
+
"browser-security/no-sensitive-sessionstorage": "error",
|
|
125
|
+
"browser-security/no-unencrypted-transmission": "error",
|
|
126
|
+
"browser-security/no-unsafe-eval-csp": "error",
|
|
127
|
+
"browser-security/no-unsafe-inline-csp": "error",
|
|
128
|
+
"browser-security/no-unvalidated-deeplinks": "error",
|
|
129
|
+
"browser-security/no-websocket-eval": "error",
|
|
130
|
+
"browser-security/no-websocket-innerhtml": "error",
|
|
131
|
+
"browser-security/no-worker-message-innerhtml": "error",
|
|
132
|
+
"browser-security/require-cookie-secure-attrs": "error",
|
|
133
|
+
"browser-security/require-https-only": "error",
|
|
134
|
+
"browser-security/require-postmessage-origin-check": "error",
|
|
135
|
+
"browser-security/require-websocket-wss": "error"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
20
138
|
```
|
|
21
139
|
|
|
22
|
-
|
|
140
|
+
These are the rules the plugin recommends (💼 in the table below).
|
|
141
|
+
|
|
142
|
+
### ESLint
|
|
143
|
+
|
|
144
|
+
Install [`eslint-plugin-browser-security`](https://www.npmjs.com/package/eslint-plugin-browser-security) instead. It has the same rules, plus presets for ESLint's flat config.
|
|
145
|
+
|
|
146
|
+
## 📦 Compatibility
|
|
147
|
+
|
|
148
|
+
| Package | Version |
|
|
149
|
+
| :------ | :--------------------------------------------------------------- |
|
|
150
|
+
| oxlint | verified on `1.90.0`: CI loads every rule ID through `jsPlugins` |
|
|
151
|
+
| Vite+ | `lint.jsPlugins` in `vite.config.ts` |
|
|
152
|
+
| Node.js | `>=18.0.0` |
|
|
153
|
+
|
|
154
|
+
## Rules
|
|
155
|
+
|
|
156
|
+
**Legend**
|
|
157
|
+
|
|
158
|
+
| Icon | Description |
|
|
159
|
+
| :--: | :------------------------------------------------------------------------ |
|
|
160
|
+
| 💼 | **Recommended**: Included in the recommended preset. |
|
|
161
|
+
| ⚠️ | **Warns**: Set to warn in recommended preset. |
|
|
162
|
+
| 🔧 | **Auto-fixable**: Automatically fixable by the `--fix` CLI option. |
|
|
163
|
+
| 💡 | **Suggestions**: Providing code suggestions in IDE. |
|
|
164
|
+
| 🚫 | **Deprecated**: This rule is deprecated. |
|
|
165
|
+
| 🟢 | **Type-unaware**: AST-only, runs in oxlint JS-plugin tier. |
|
|
166
|
+
| 🟡 | **Type-aware (refining)**: pure-AST primary path; types refine precision. |
|
|
167
|
+
| 🟠 | **Type-aware (graceful)**: requires TS program; silent without it. |
|
|
168
|
+
|
|
169
|
+
| Rule | CWE | OWASP | CVSS | Description | 🧠 | 💼 | ⚠️ | 🔧 | 💡 | 🚫 |
|
|
170
|
+
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------: | :------: | :--: | :------------------------------------------------------------------------------------------------------------ | :-: | :-: | :-: | :-: | :-: | :-: |
|
|
171
|
+
| [detect-mixed-content](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/detect-mixed-content?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-311 | | | Detects HTTP URLs in code that should use HTTPS, preventing mixed content vulnerabilities. | 🟢 | 💼 | | | | |
|
|
172
|
+
| [no-allow-arbitrary-loads](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-allow-arbitrary-loads?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-295 | | | Prevents disabling App Transport Security (ATS) by detecting NSAllowsArbitraryLoads: true in an Expo/React… | 🟢 | 💼 | | | | |
|
|
173
|
+
| [no-clickjacking](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-clickjacking?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-1021 | | | Detects clickjacking vulnerabilities and missing frame protections | 🟢 | | | | | |
|
|
174
|
+
| [no-client-side-auth-logic](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-client-side-auth-logic?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | | | | Prevent client-side authentication logic that can be bypassed. This rule is part of eslint-plugin-browser-s… | 🟢 | 💼 | | | | |
|
|
175
|
+
| [no-cookie-auth-tokens](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-cookie-auth-tokens?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-1004 | A02:2021 | | Prevent storing authentication tokens in JavaScript-accessible cookies. | 🟢 | 💼 | | | | |
|
|
176
|
+
| [no-credentials-in-query-params](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-credentials-in-query-params?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-598 | | | CWE: [CWE-598](https://cwe.mitre.org/data/definitions/598.html) | 🟢 | 💼 | | | | |
|
|
177
|
+
| [no-disabled-certificate-validation](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-disabled-certificate-validation?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-295 | | | CWE: [CWE-295](https://cwe.mitre.org/data/definitions/295.html) | 🟢 | 💼 | | | | |
|
|
178
|
+
| [no-dynamic-service-worker-url](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-dynamic-service-worker-url?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-829 | A08:2021 | | Prevent dynamic URLs in service worker registration. | 🟢 | 💼 | | | | |
|
|
179
|
+
| [no-eval](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-eval?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-94 | | | Detects dangerous eval() and similar code execution patterns | 🟢 | 💼 | | | | |
|
|
180
|
+
| [no-filereader-innerhtml](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-filereader-innerhtml?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-693 | A03:2021 | | The rule provides LLM-optimized error messages (Compact 2-line format) with actionable security guidance: | 🟢 | 💼 | | | | |
|
|
181
|
+
| [no-http-urls](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-http-urls?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-319 | | | CWE: [CWE-319](https://cwe.mitre.org/data/definitions/319.html) | 🟢 | 💼 | | | | |
|
|
182
|
+
| [no-incomplete-url-sanitization](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-incomplete-url-sanitization?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-020 | A01:2021 | | Disallow URL substring tests and partial scheme denylists as security decisions | 🟢 | 💼 | | | | |
|
|
183
|
+
| [no-innerhtml](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-innerhtml?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-79 | | | Detects dangerous innerHTML/outerHTML assignments that can lead to Cross-Site Scripting (XSS) | 🟢 | 💼 | | | | |
|
|
184
|
+
| [no-insecure-redirects](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-insecure-redirects?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-601 | | | ESLint Rule: no-insecure-redirects | 🟢 | 💼 | | | | |
|
|
185
|
+
| [no-insecure-websocket](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-insecure-websocket?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-319 | | | CWE: [CWE-319](https://cwe.mitre.org/data/definitions/319.html) | 🟢 | 💼 | | | | |
|
|
186
|
+
| [no-jwt-in-storage](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-jwt-in-storage?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-311 | A02:2021 | | This rule prevents storing JWT tokens in browser storage (localStorage/sessionStorage) | 🟢 | 💼 | | | | |
|
|
187
|
+
| [no-missing-cors-check](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-missing-cors-check?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-346 | | | Detects missing CORS validation (wildcard CORS, missing origin check) that can allow unauthorized cross-ori… | 🟢 | | | | | |
|
|
188
|
+
| [no-missing-csrf-protection](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-missing-csrf-protection?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-352 | | | Detects missing CSRF token validation in POST/PUT/DELETE requests | 🟢 | | | | | |
|
|
189
|
+
| [no-missing-security-headers](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-missing-security-headers?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-693 | | | ESLint Rule: no-missing-security-headers | 🟢 | | | | | |
|
|
190
|
+
| [no-password-in-url](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-password-in-url?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-521 | | | This rule detects when URLs contain password-related query parameters or URL fragments | 🟢 | | | | | |
|
|
191
|
+
| [no-permissive-cors](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-permissive-cors?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-942 | | | CWE: [CWE-942](https://cwe.mitre.org/data/definitions/942.html) | 🟢 | | | | | |
|
|
192
|
+
| [no-postmessage-innerhtml](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-postmessage-innerhtml?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-693 | A03:2021 | | The rule provides LLM-optimized error messages (Compact 2-line format) with actionable security guidance: | 🟢 | 💼 | | | | |
|
|
193
|
+
| [no-postmessage-wildcard-origin](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-postmessage-wildcard-origin?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-693 | A01:2021 | | This rule prevents using \\"\\" as the targetOrigin parameter in postMessage() calls | 🟢 | 💼 | | | | |
|
|
194
|
+
| [no-sensitive-cookie-js](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-sensitive-cookie-js?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-359 | A02:2021 | | The rule provides LLM-optimized error messages (Compact 2-line format) with actionable security guidance: | 🟢 | 💼 | | | | |
|
|
195
|
+
| [no-sensitive-data-in-analytics](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-sensitive-data-in-analytics?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-359 | | | This rule detects when sensitive user data (email, SSN, credit card, password, phone, address) is passed to… | 🟢 | | | | | |
|
|
196
|
+
| [no-sensitive-data-in-cache](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-sensitive-data-in-cache?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-200 | | | CWE: [CWE-200](https://cwe.mitre.org/data/definitions/200.html) | 🟢 | | | | | |
|
|
197
|
+
| [no-sensitive-indexeddb](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-sensitive-indexeddb?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-922 | A02:2021 | | Prevent storing sensitive data in IndexedDB. | 🟢 | 💼 | | | | |
|
|
198
|
+
| [no-sensitive-localstorage](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-sensitive-localstorage?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-922 | | | Detects storage of sensitive data (tokens, passwords, PII) in localStorage | 🟢 | 💼 | | | | |
|
|
199
|
+
| [no-sensitive-sessionstorage](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-sensitive-sessionstorage?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-922 | A02:2021 | | Prevent storing sensitive data in sessionStorage. | 🟢 | 💼 | | | | |
|
|
200
|
+
| [no-tracking-without-consent](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-tracking-without-consent?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-359 | | | CWE: [CWE-359](https://cwe.mitre.org/data/definitions/359.html) | 🟢 | | | | | |
|
|
201
|
+
| [no-unencrypted-transmission](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-unencrypted-transmission?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-319 | | | Detects unencrypted data transmission (HTTP vs HTTPS, plain text protocols) | 🟢 | 💼 | | | | |
|
|
202
|
+
| [no-unescaped-url-parameter](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-unescaped-url-parameter?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-79 | | | Detects unescaped URL parameters that can lead to Cross-Site Scripting (XSS) or open redirect vulnerabilities | 🟢 | | | | | |
|
|
203
|
+
| [no-unsafe-eval-csp](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-unsafe-eval-csp?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-95 | A03:2021 | | Disallow 'unsafe-eval' in Content Security Policy directives. | 🟢 | 💼 | | | | |
|
|
204
|
+
| [no-unsafe-inline-csp](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-unsafe-inline-csp?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-79 | A03:2021 | | Disallow 'unsafe-inline' in Content Security Policy directives. | 🟢 | 💼 | | | | |
|
|
205
|
+
| [no-unvalidated-deeplinks](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-unvalidated-deeplinks?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-939 | | | This rule detects when deep link URLs are opened without validation in React Native or mobile web apps | 🟢 | 💼 | | | | |
|
|
206
|
+
| [no-websocket-eval](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-websocket-eval?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-319 | A03:2021 | | The rule provides LLM-optimized error messages (Compact 2-line format) with actionable security guidance: | 🟢 | 💼 | | | | |
|
|
207
|
+
| [no-websocket-innerhtml](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-websocket-innerhtml?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-319 | A03:2021 | | The rule provides LLM-optimized error messages (Compact 2-line format) with actionable security guidance: | 🟢 | 💼 | | | | |
|
|
208
|
+
| [no-worker-message-innerhtml](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/no-worker-message-innerhtml?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-79 | A03:2021 | | Disallow using innerHTML with Web Worker message data. | 🟢 | 💼 | | | | |
|
|
209
|
+
| [require-blob-url-revocation](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/require-blob-url-revocation?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-401 | A04:2021 | | Require revoking Blob URLs after use to prevent memory leaks. | 🟢 | | ⚠️ | | | |
|
|
210
|
+
| [require-cookie-secure-attrs](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/require-cookie-secure-attrs?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-614 | A05:2021 | | Require Secure and SameSite attributes on cookies. | 🟢 | 💼 | | | | |
|
|
211
|
+
| [require-csp-headers](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/require-csp-headers?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-1021 | | | CWE: [CWE-1021](https://cwe.mitre.org/data/definitions/1021.html) | 🟢 | | | | | |
|
|
212
|
+
| [require-https-only](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/require-https-only?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-319 | | | This rule detects HTTP (unencrypted) URLs in fetch() and axios requests | 🟢 | 💼 | | | | |
|
|
213
|
+
| [require-mime-type-validation](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/require-mime-type-validation?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-434 | | | CWE: [CWE-434](https://cwe.mitre.org/data/definitions/434.html) | 🟢 | | | | | |
|
|
214
|
+
| [require-postmessage-origin-check](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/require-postmessage-origin-check?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-346 | | | Detects postMessage event handlers without origin validation | 🟢 | 💼 | | | | |
|
|
215
|
+
| [require-url-validation](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/require-url-validation?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-601 | | | CWE: [CWE-601](https://cwe.mitre.org/data/definitions/601.html) | 🟢 | | | | | |
|
|
216
|
+
| [require-websocket-wss](https://eslint.interlace.tools/docs/security/plugin-browser-security/rules/require-websocket-wss?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security) | CWE-319 | A02:2021 | | This rule enforces the use of wss:// (WebSocket Secure) protocol instead of ws:// (unencrypted WebSocket) | 🟢 | 💼 | | | | |
|
|
217
|
+
|
|
218
|
+
<!-- AUTO-GENERATED:ECOSYSTEM_TABLE:START - Do not edit manually -->
|
|
219
|
+
|
|
220
|
+
## 🔗 Related ESLint Plugins
|
|
221
|
+
|
|
222
|
+
Part of the **Interlace ESLint ecosystem** — AI-native rules with LLM-optimized error messages:
|
|
223
|
+
|
|
224
|
+
**Security**
|
|
225
|
+
|
|
226
|
+
| Plugin | Downloads | Description |
|
|
227
|
+
| :----------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------- |
|
|
228
|
+
| [`eslint-plugin-anthropic-security`](https://www.npmjs.com/package/eslint-plugin-anthropic-security) | [](https://www.npmjs.com/package/eslint-plugin-anthropic-security) | Anthropic SDK security. |
|
|
229
|
+
| [`eslint-plugin-browser-security`](https://www.npmjs.com/package/eslint-plugin-browser-security) | [](https://www.npmjs.com/package/eslint-plugin-browser-security) | XSS, DOM security. |
|
|
230
|
+
| [`eslint-plugin-drizzle-security`](https://www.npmjs.com/package/eslint-plugin-drizzle-security) | [](https://www.npmjs.com/package/eslint-plugin-drizzle-security) | Drizzle security. |
|
|
231
|
+
| [`eslint-plugin-express-security`](https://www.npmjs.com/package/eslint-plugin-express-security) | [](https://www.npmjs.com/package/eslint-plugin-express-security) | Express middleware hardening. |
|
|
232
|
+
| [`eslint-plugin-gemini-security`](https://www.npmjs.com/package/eslint-plugin-gemini-security) | [](https://www.npmjs.com/package/eslint-plugin-gemini-security) | Google Gemini SDK security. |
|
|
233
|
+
| [`eslint-plugin-jwt-security`](https://www.npmjs.com/package/eslint-plugin-jwt-security) | [](https://www.npmjs.com/package/eslint-plugin-jwt-security) | Token security. |
|
|
234
|
+
| [`eslint-plugin-knex-security`](https://www.npmjs.com/package/eslint-plugin-knex-security) | [](https://www.npmjs.com/package/eslint-plugin-knex-security) | Knex security. |
|
|
235
|
+
| [`eslint-plugin-lambda-security`](https://www.npmjs.com/package/eslint-plugin-lambda-security) | [](https://www.npmjs.com/package/eslint-plugin-lambda-security) | AWS Lambda hardening. |
|
|
236
|
+
| [`eslint-plugin-mcp-sdk-security`](https://www.npmjs.com/package/eslint-plugin-mcp-sdk-security) | [](https://www.npmjs.com/package/eslint-plugin-mcp-sdk-security) | MCP SDK security. |
|
|
237
|
+
| [`eslint-plugin-mongodb-security`](https://www.npmjs.com/package/eslint-plugin-mongodb-security) | [](https://www.npmjs.com/package/eslint-plugin-mongodb-security) | MongoDB injection. |
|
|
238
|
+
| [`eslint-plugin-mysql-security`](https://www.npmjs.com/package/eslint-plugin-mysql-security) | [](https://www.npmjs.com/package/eslint-plugin-mysql-security) | MySQL security. |
|
|
239
|
+
| [`eslint-plugin-nestjs-security`](https://www.npmjs.com/package/eslint-plugin-nestjs-security) | [](https://www.npmjs.com/package/eslint-plugin-nestjs-security) | NestJS framework hardening. |
|
|
240
|
+
| [`eslint-plugin-node-security`](https://www.npmjs.com/package/eslint-plugin-node-security) | [](https://www.npmjs.com/package/eslint-plugin-node-security) | Server-side patterns. |
|
|
241
|
+
| [`eslint-plugin-openai-security`](https://www.npmjs.com/package/eslint-plugin-openai-security) | [](https://www.npmjs.com/package/eslint-plugin-openai-security) | OpenAI SDK security. |
|
|
242
|
+
| [`eslint-plugin-postgresql-security`](https://www.npmjs.com/package/eslint-plugin-postgresql-security) | [](https://www.npmjs.com/package/eslint-plugin-postgresql-security) | PostgreSQL security. |
|
|
243
|
+
| [`eslint-plugin-prisma-security`](https://www.npmjs.com/package/eslint-plugin-prisma-security) | [](https://www.npmjs.com/package/eslint-plugin-prisma-security) | Prisma security. |
|
|
244
|
+
| [`eslint-plugin-secure-coding`](https://www.npmjs.com/package/eslint-plugin-secure-coding) | [](https://www.npmjs.com/package/eslint-plugin-secure-coding) | Injection prevention. |
|
|
245
|
+
| [`eslint-plugin-sequelize-security`](https://www.npmjs.com/package/eslint-plugin-sequelize-security) | [](https://www.npmjs.com/package/eslint-plugin-sequelize-security) | Sequelize ORM security. |
|
|
246
|
+
| [`eslint-plugin-sqlite-security`](https://www.npmjs.com/package/eslint-plugin-sqlite-security) | [](https://www.npmjs.com/package/eslint-plugin-sqlite-security) | SQLite security. |
|
|
247
|
+
| [`eslint-plugin-supabase-security`](https://www.npmjs.com/package/eslint-plugin-supabase-security) | [](https://www.npmjs.com/package/eslint-plugin-supabase-security) | Supabase security. |
|
|
248
|
+
| [`eslint-plugin-typeorm-security`](https://www.npmjs.com/package/eslint-plugin-typeorm-security) | [](https://www.npmjs.com/package/eslint-plugin-typeorm-security) | TypeORM security. |
|
|
249
|
+
| [`eslint-plugin-vercel-ai-security`](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) | [](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) | AI SDK security. |
|
|
250
|
+
|
|
251
|
+
**Code quality**
|
|
252
|
+
|
|
253
|
+
| Plugin | Downloads | Description |
|
|
254
|
+
| :--------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------- |
|
|
255
|
+
| [`eslint-plugin-conventions`](https://www.npmjs.com/package/eslint-plugin-conventions) | [](https://www.npmjs.com/package/eslint-plugin-conventions) | Team-specific habits and styles. |
|
|
256
|
+
| [`eslint-plugin-import-next`](https://www.npmjs.com/package/eslint-plugin-import-next) | [](https://www.npmjs.com/package/eslint-plugin-import-next) | Fast cycle + import-graph analysis. |
|
|
257
|
+
| [`eslint-plugin-maintainability`](https://www.npmjs.com/package/eslint-plugin-maintainability) | [](https://www.npmjs.com/package/eslint-plugin-maintainability) | Cognitive load and clean-code patterns. |
|
|
258
|
+
| [`eslint-plugin-modernization`](https://www.npmjs.com/package/eslint-plugin-modernization) | [](https://www.npmjs.com/package/eslint-plugin-modernization) | ESNext migration + syntax evolution. |
|
|
259
|
+
| [`eslint-plugin-modularity`](https://www.npmjs.com/package/eslint-plugin-modularity) | [](https://www.npmjs.com/package/eslint-plugin-modularity) | Structural integrity and DDD patterns. |
|
|
260
|
+
| [`eslint-plugin-operability`](https://www.npmjs.com/package/eslint-plugin-operability) | [](https://www.npmjs.com/package/eslint-plugin-operability) | Production readiness and resource health. |
|
|
261
|
+
| [`eslint-plugin-react-a11y`](https://www.npmjs.com/package/eslint-plugin-react-a11y) | [](https://www.npmjs.com/package/eslint-plugin-react-a11y) | React accessibility / WCAG. |
|
|
262
|
+
| [`eslint-plugin-react-features`](https://www.npmjs.com/package/eslint-plugin-react-features) | [](https://www.npmjs.com/package/eslint-plugin-react-features) | React best practices and optimization. |
|
|
263
|
+
| [`eslint-plugin-reliability`](https://www.npmjs.com/package/eslint-plugin-reliability) | [](https://www.npmjs.com/package/eslint-plugin-reliability) | Runtime stability and error safety. |
|
|
264
|
+
|
|
265
|
+
<!-- AUTO-GENERATED:ECOSYSTEM_TABLE:END -->
|
|
266
|
+
|
|
267
|
+
## ⭐ Support & follow
|
|
268
|
+
|
|
269
|
+
If this plugin caught a real bug for you, **[star the repo](https://github.com/ofri-peretz/eslint)** — stars are the signal that keeps the Interlace ESLint ecosystem maintained — and **[follow the writeups on Dev.to](https://dev.to/ofri-peretz)** for the benchmarks and security research behind these rules.
|
|
270
|
+
|
|
271
|
+
[](https://github.com/ofri-peretz/eslint)
|
|
272
|
+
|
|
273
|
+
## 📄 License
|
|
274
|
+
|
|
275
|
+
MIT © [Ofri Peretz](https://github.com/ofri-peretz)
|
|
276
|
+
|
|
277
|
+
<p align="center">
|
|
278
|
+
<a href="https://eslint.interlace.tools/docs/security/plugin-browser-security?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security"><img src="https://eslint.interlace.tools/images/og-browser-security.png" alt="ESLint Interlace Plugin" width="100%" /></a>
|
|
279
|
+
</p>
|
|
280
|
+
|
|
281
|
+
<p align="center">
|
|
282
|
+
<a href="https://eslint.interlace.tools/docs/security/plugin-browser-security?utm_source=github&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security" target="blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://eslint.interlace.tools/logos/interlace-dark.svg"><img src="https://eslint.interlace.tools/logos/interlace-light.svg" alt="Interlace" height="70" /></picture></a>
|
|
283
|
+
</p>
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports
|
|
1
|
+
module.exports=require("eslint-plugin-browser-security/oxlint");
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxlint-plugin-browser-security",
|
|
3
|
-
"version": "2.1
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
3
|
+
"version": "2.2.1",
|
|
4
|
+
"description": "The browser-security rules for oxlint and Vite+. Same rules and rule IDs as eslint-plugin-browser-security.",
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"main": "./index.js",
|
|
7
|
+
"types": "./index.d.ts",
|
|
7
8
|
"files": [
|
|
8
9
|
"index.js",
|
|
9
10
|
"index.d.ts",
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
"oxlint",
|
|
15
16
|
"oxlint-plugin",
|
|
16
17
|
"vite-plus",
|
|
17
|
-
"
|
|
18
|
+
"eslint",
|
|
18
19
|
"static-analysis",
|
|
19
20
|
"linting",
|
|
20
21
|
"code-quality",
|
|
@@ -46,18 +47,28 @@
|
|
|
46
47
|
"ai-assistant",
|
|
47
48
|
"typescript"
|
|
48
49
|
],
|
|
49
|
-
"
|
|
50
|
-
"eslint-plugin-browser-security": "2.1.11"
|
|
51
|
-
},
|
|
52
|
-
"license": "MIT",
|
|
50
|
+
"homepage": "https://eslint.interlace.tools/docs/security/plugin-browser-security?utm_source=npm&utm_medium=referral&utm_campaign=oxlint-plugin-browser-security",
|
|
53
51
|
"repository": {
|
|
54
52
|
"type": "git",
|
|
55
53
|
"url": "git+https://github.com/ofri-peretz/eslint.git",
|
|
56
54
|
"directory": "packages/oxlint-plugin-browser-security"
|
|
57
55
|
},
|
|
58
|
-
"homepage": "https://eslint.interlace.tools/docs/security/plugin-browser-security?utm_source=npm&utm_medium=referral&utm_campaign=eslint-plugin-browser-security",
|
|
59
56
|
"bugs": {
|
|
60
57
|
"url": "https://github.com/ofri-peretz/eslint/issues"
|
|
61
58
|
},
|
|
62
|
-
"author": "Ofri Peretz <ofriperetzdev@gmail.com>"
|
|
59
|
+
"author": "Ofri Peretz <ofriperetzdev@gmail.com>",
|
|
60
|
+
"license": "MIT",
|
|
61
|
+
"engines": {
|
|
62
|
+
"node": ">=18.0.0"
|
|
63
|
+
},
|
|
64
|
+
"funding": {
|
|
65
|
+
"type": "github",
|
|
66
|
+
"url": "git+https://github.com/ofri-peretz/eslint.git"
|
|
67
|
+
},
|
|
68
|
+
"publishConfig": {
|
|
69
|
+
"access": "public"
|
|
70
|
+
},
|
|
71
|
+
"dependencies": {
|
|
72
|
+
"eslint-plugin-browser-security": "2.2.1"
|
|
73
|
+
}
|
|
63
74
|
}
|