eslint-plugin-browser-security 1.0.1 → 1.0.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/README.md +39 -37
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -67,63 +67,65 @@ import browserSecurity from 'eslint-plugin-browser-security';
|
|
|
67
67
|
export default [browserSecurity.configs.recommended];
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
##
|
|
70
|
+
## 🔐 Rules (21 total)
|
|
71
|
+
|
|
72
|
+
💼 = Set in `recommended` | 🔧 = Auto-fixable | 💡 = Has suggestions
|
|
71
73
|
|
|
72
74
|
### XSS Prevention
|
|
73
75
|
|
|
74
|
-
| Rule
|
|
75
|
-
|
|
|
76
|
-
| [
|
|
77
|
-
| [
|
|
76
|
+
| Rule | CWE | OWASP | Description | 💼 | 🔧 | 💡 |
|
|
77
|
+
| -------------------------------------------- | ------ | -------- | ----------------------------------------------------- | --- | --- | --- |
|
|
78
|
+
| [no-eval](./docs/rules/no-eval.md) | CWE-95 | A03:2021 | Prevent code injection via `eval()`, `new Function()` | 💼 | | 💡 |
|
|
79
|
+
| [no-innerhtml](./docs/rules/no-innerhtml.md) | CWE-79 | A03:2021 | Prevent XSS via `innerHTML`, `outerHTML` | 💼 | | 💡 |
|
|
78
80
|
|
|
79
81
|
### postMessage Security
|
|
80
82
|
|
|
81
|
-
| Rule
|
|
82
|
-
|
|
|
83
|
-
| [
|
|
84
|
-
| [
|
|
85
|
-
| [
|
|
83
|
+
| Rule | CWE | OWASP | Description | 💼 | 🔧 | 💡 |
|
|
84
|
+
| ------------------------------------------------------------------------------------ | ------- | -------- | ------------------------------------------------- | --- | --- | --- |
|
|
85
|
+
| [require-postmessage-origin-check](./docs/rules/require-postmessage-origin-check.md) | CWE-346 | A01:2021 | Require origin validation in postMessage handlers | 💼 | | 💡 |
|
|
86
|
+
| [no-postmessage-wildcard-origin](./docs/rules/no-postmessage-wildcard-origin.md) | CWE-346 | A01:2021 | Prevent wildcard targetOrigin in postMessage | 💼 | | 💡 |
|
|
87
|
+
| [no-postmessage-innerhtml](./docs/rules/no-postmessage-innerhtml.md) | CWE-79 | A03:2021 | Prevent XSS via innerHTML in postMessage handlers | 💼 | | 💡 |
|
|
86
88
|
|
|
87
89
|
### Storage Security
|
|
88
90
|
|
|
89
|
-
| Rule
|
|
90
|
-
|
|
|
91
|
-
| [
|
|
92
|
-
| [
|
|
93
|
-
| [
|
|
94
|
-
| [
|
|
91
|
+
| Rule | CWE | OWASP | Description | 💼 | 🔧 | 💡 |
|
|
92
|
+
| -------------------------------------------------------------------------- | ------- | -------- | ---------------------------------------- | --- | --- | --- |
|
|
93
|
+
| [no-sensitive-localstorage](./docs/rules/no-sensitive-localstorage.md) | CWE-922 | A02:2021 | Prevent sensitive data in localStorage | 💼 | | 💡 |
|
|
94
|
+
| [no-sensitive-sessionstorage](./docs/rules/no-sensitive-sessionstorage.md) | CWE-922 | A02:2021 | Prevent sensitive data in sessionStorage | 💼 | | 💡 |
|
|
95
|
+
| [no-sensitive-indexeddb](./docs/rules/no-sensitive-indexeddb.md) | CWE-922 | A02:2021 | Prevent sensitive data in IndexedDB | 💼 | | 💡 |
|
|
96
|
+
| [no-jwt-in-storage](./docs/rules/no-jwt-in-storage.md) | CWE-922 | A02:2021 | Prevent JWT tokens in browser storage | 💼 | | 💡 |
|
|
95
97
|
|
|
96
98
|
### Cookie Security
|
|
97
99
|
|
|
98
|
-
| Rule
|
|
99
|
-
|
|
|
100
|
-
| [
|
|
101
|
-
| [
|
|
102
|
-
| [
|
|
100
|
+
| Rule | CWE | OWASP | Description | 💼 | 🔧 | 💡 |
|
|
101
|
+
| -------------------------------------------------------------------------- | -------- | -------- | -------------------------------------------- | --- | --- | --- |
|
|
102
|
+
| [no-sensitive-cookie-js](./docs/rules/no-sensitive-cookie-js.md) | CWE-1004 | A02:2021 | Prevent sensitive data in cookies via JS | 💼 | | 💡 |
|
|
103
|
+
| [no-cookie-auth-tokens](./docs/rules/no-cookie-auth-tokens.md) | CWE-1004 | A02:2021 | Prevent auth tokens in JS-accessible cookies | 💼 | | 💡 |
|
|
104
|
+
| [require-cookie-secure-attrs](./docs/rules/require-cookie-secure-attrs.md) | CWE-614 | A05:2021 | Require Secure and SameSite attributes | 💼 | | 💡 |
|
|
103
105
|
|
|
104
106
|
### WebSocket Security
|
|
105
107
|
|
|
106
|
-
| Rule
|
|
107
|
-
|
|
|
108
|
-
| [
|
|
109
|
-
| [
|
|
110
|
-
| [
|
|
108
|
+
| Rule | CWE | OWASP | Description | 💼 | 🔧 | 💡 |
|
|
109
|
+
| ---------------------------------------------------------------- | ------- | -------- | --------------------------------- | --- | --- | --- |
|
|
110
|
+
| [require-websocket-wss](./docs/rules/require-websocket-wss.md) | CWE-319 | A02:2021 | Require secure WebSocket (wss://) | 💼 | | 💡 |
|
|
111
|
+
| [no-websocket-innerhtml](./docs/rules/no-websocket-innerhtml.md) | CWE-79 | A03:2021 | Prevent XSS in WebSocket handlers | 💼 | | 💡 |
|
|
112
|
+
| [no-websocket-eval](./docs/rules/no-websocket-eval.md) | CWE-95 | A03:2021 | Prevent RCE in WebSocket handlers | 💼 | | 💡 |
|
|
111
113
|
|
|
112
114
|
### File API & Workers Security
|
|
113
115
|
|
|
114
|
-
| Rule
|
|
115
|
-
|
|
|
116
|
-
| [
|
|
117
|
-
| [
|
|
118
|
-
| [
|
|
119
|
-
| [
|
|
116
|
+
| Rule | CWE | OWASP | Description | 💼 | 🔧 | 💡 |
|
|
117
|
+
| ------------------------------------------------------------------------------ | ------- | -------- | ----------------------------------- | --- | --- | --- |
|
|
118
|
+
| [no-filereader-innerhtml](./docs/rules/no-filereader-innerhtml.md) | CWE-79 | A03:2021 | Prevent XSS with FileReader data | 💼 | | 💡 |
|
|
119
|
+
| [require-blob-url-revocation](./docs/rules/require-blob-url-revocation.md) | CWE-401 | A04:2021 | Require revoking Blob URLs | 💼 | | 💡 |
|
|
120
|
+
| [no-dynamic-service-worker-url](./docs/rules/no-dynamic-service-worker-url.md) | CWE-829 | A08:2021 | Prevent dynamic service worker URLs | 💼 | | 💡 |
|
|
121
|
+
| [no-worker-message-innerhtml](./docs/rules/no-worker-message-innerhtml.md) | CWE-79 | A03:2021 | Prevent XSS in Worker handlers | 💼 | | 💡 |
|
|
120
122
|
|
|
121
123
|
### CSP Security
|
|
122
124
|
|
|
123
|
-
| Rule
|
|
124
|
-
|
|
|
125
|
-
| [
|
|
126
|
-
| [
|
|
125
|
+
| Rule | CWE | OWASP | Description | 💼 | 🔧 | 💡 |
|
|
126
|
+
| ------------------------------------------------------------ | ------ | -------- | ------------------------------- | --- | --- | --- |
|
|
127
|
+
| [no-unsafe-inline-csp](./docs/rules/no-unsafe-inline-csp.md) | CWE-79 | A03:2021 | Disallow 'unsafe-inline' in CSP | 💼 | | 💡 |
|
|
128
|
+
| [no-unsafe-eval-csp](./docs/rules/no-unsafe-eval-csp.md) | CWE-95 | A03:2021 | Disallow 'unsafe-eval' in CSP | 💼 | | 💡 |
|
|
127
129
|
|
|
128
130
|
## 🔍 Detection Examples
|
|
129
131
|
|
|
@@ -198,7 +200,7 @@ All rules include structured remediation guidance designed for AI assistants:
|
|
|
198
200
|
|
|
199
201
|
## 🔗 Related Packages
|
|
200
202
|
|
|
201
|
-
Part of the [
|
|
203
|
+
Part of the [Interlace ESLint Ecosystem](https://github.com/ofri-peretz/eslint):
|
|
202
204
|
|
|
203
205
|
| Package | Focus |
|
|
204
206
|
| --------------------------------------------------------------------- | --------------------------- |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-browser-security",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
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",
|