eslint-plugin-secure-coding 3.0.0 → 3.0.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 +1 -1
- package/README.md +149 -315
- package/package.json +1 -1
- package/src/index.d.ts +3 -12
- package/src/index.js +7 -2
- package/src/rules/detect-child-process/index.d.ts +18 -1
- package/src/rules/detect-child-process/index.js +5 -0
- package/src/rules/detect-eval-with-expression/index.d.ts +18 -1
- package/src/rules/detect-eval-with-expression/index.js +5 -0
- package/src/rules/detect-mixed-content/index.d.ts +6 -4
- package/src/rules/detect-mixed-content/index.js +7 -6
- package/src/rules/detect-non-literal-fs-filename/index.d.ts +18 -1
- package/src/rules/detect-non-literal-fs-filename/index.js +5 -0
- package/src/rules/detect-non-literal-regexp/index.d.ts +18 -1
- package/src/rules/detect-non-literal-regexp/index.js +5 -0
- package/src/rules/detect-object-injection/index.d.ts +23 -1
- package/src/rules/detect-object-injection/index.js +5 -0
- package/src/rules/detect-suspicious-dependencies/index.d.ts +6 -4
- package/src/rules/detect-suspicious-dependencies/index.js +7 -2
- package/src/rules/detect-weak-password-validation/index.d.ts +6 -2
- package/src/rules/detect-weak-password-validation/index.js +6 -1
- package/src/rules/no-allow-arbitrary-loads/index.d.ts +6 -4
- package/src/rules/no-allow-arbitrary-loads/index.js +7 -6
- package/src/rules/no-arbitrary-file-access/index.d.ts +6 -9
- package/src/rules/no-arbitrary-file-access/index.js +7 -2
- package/src/rules/no-buffer-overread/index.d.ts +10 -2
- package/src/rules/no-buffer-overread/index.js +5 -0
- package/src/rules/no-clickjacking/index.d.ts +25 -1
- package/src/rules/no-clickjacking/index.js +5 -0
- package/src/rules/no-client-side-auth-logic/index.d.ts +6 -2
- package/src/rules/no-client-side-auth-logic/index.js +6 -1
- package/src/rules/no-credentials-in-query-params/index.d.ts +6 -4
- package/src/rules/no-credentials-in-query-params/index.js +7 -2
- package/src/rules/no-data-in-temp-storage/index.d.ts +6 -2
- package/src/rules/no-data-in-temp-storage/index.js +6 -1
- package/src/rules/no-debug-code-in-production/index.d.ts +6 -4
- package/src/rules/no-debug-code-in-production/index.js +10 -7
- package/src/rules/no-directive-injection/index.d.ts +25 -1
- package/src/rules/no-directive-injection/index.js +5 -0
- package/src/rules/no-disabled-certificate-validation/index.d.ts +6 -2
- package/src/rules/no-disabled-certificate-validation/index.js +6 -1
- package/src/rules/no-dynamic-dependency-loading/index.d.ts +6 -4
- package/src/rules/no-dynamic-dependency-loading/index.js +10 -7
- package/src/rules/no-electron-security-issues/index.d.ts +25 -1
- package/src/rules/no-electron-security-issues/index.js +5 -0
- package/src/rules/no-exposed-debug-endpoints/index.d.ts +6 -2
- package/src/rules/no-exposed-debug-endpoints/index.js +6 -1
- package/src/rules/no-exposed-sensitive-data/index.d.ts +18 -1
- package/src/rules/no-exposed-sensitive-data/index.js +5 -0
- package/src/rules/no-format-string-injection/index.d.ts +26 -1
- package/src/rules/no-format-string-injection/index.js +5 -0
- package/src/rules/no-graphql-injection/index.d.ts +27 -1
- package/src/rules/no-graphql-injection/index.js +5 -0
- package/src/rules/no-hardcoded-credentials/index.d.ts +17 -1
- package/src/rules/no-hardcoded-credentials/index.js +5 -0
- package/src/rules/no-hardcoded-session-tokens/index.d.ts +6 -2
- package/src/rules/no-hardcoded-session-tokens/index.js +6 -1
- package/src/rules/no-http-urls/index.d.ts +7 -4
- package/src/rules/no-http-urls/index.js +7 -2
- package/src/rules/no-improper-sanitization/index.d.ts +25 -1
- package/src/rules/no-improper-sanitization/index.js +5 -0
- package/src/rules/no-improper-type-validation/index.d.ts +25 -1
- package/src/rules/no-improper-type-validation/index.js +5 -0
- package/src/rules/no-insecure-comparison/index.d.ts +18 -1
- package/src/rules/no-insecure-comparison/index.js +5 -0
- package/src/rules/no-insecure-redirects/index.d.ts +18 -1
- package/src/rules/no-insecure-redirects/index.js +5 -0
- package/src/rules/no-insecure-websocket/index.d.ts +6 -2
- package/src/rules/no-insecure-websocket/index.js +6 -1
- package/src/rules/no-ldap-injection/index.d.ts +28 -1
- package/src/rules/no-ldap-injection/index.js +5 -0
- package/src/rules/no-missing-authentication/index.d.ts +18 -1
- package/src/rules/no-missing-authentication/index.js +5 -0
- package/src/rules/no-missing-cors-check/index.d.ts +18 -1
- package/src/rules/no-missing-cors-check/index.js +5 -0
- package/src/rules/no-missing-csrf-protection/index.d.ts +18 -1
- package/src/rules/no-missing-csrf-protection/index.js +5 -0
- package/src/rules/no-missing-security-headers/index.d.ts +18 -1
- package/src/rules/no-missing-security-headers/index.js +5 -0
- package/src/rules/no-password-in-url/index.d.ts +6 -4
- package/src/rules/no-password-in-url/index.js +7 -6
- package/src/rules/no-permissive-cors/index.d.ts +6 -4
- package/src/rules/no-permissive-cors/index.js +22 -13
- package/src/rules/no-pii-in-logs/index.d.ts +6 -4
- package/src/rules/no-pii-in-logs/index.js +15 -12
- package/src/rules/no-privilege-escalation/index.d.ts +18 -1
- package/src/rules/no-privilege-escalation/index.js +5 -0
- package/src/rules/no-redos-vulnerable-regex/index.d.ts +20 -1
- package/src/rules/no-redos-vulnerable-regex/index.js +5 -0
- package/src/rules/no-sensitive-data-exposure/index.d.ts +18 -1
- package/src/rules/no-sensitive-data-exposure/index.js +5 -0
- package/src/rules/no-sensitive-data-in-analytics/index.d.ts +6 -4
- package/src/rules/no-sensitive-data-in-analytics/index.js +15 -11
- package/src/rules/no-sensitive-data-in-cache/index.d.ts +6 -4
- package/src/rules/no-sensitive-data-in-cache/index.js +7 -6
- package/src/rules/no-toctou-vulnerability/index.d.ts +18 -1
- package/src/rules/no-toctou-vulnerability/index.js +5 -0
- package/src/rules/no-tracking-without-consent/index.d.ts +6 -2
- package/src/rules/no-tracking-without-consent/index.js +6 -1
- package/src/rules/no-unchecked-loop-condition/index.d.ts +25 -1
- package/src/rules/no-unchecked-loop-condition/index.js +5 -0
- package/src/rules/no-unencrypted-transmission/index.d.ts +18 -1
- package/src/rules/no-unencrypted-transmission/index.js +5 -0
- package/src/rules/no-unescaped-url-parameter/index.d.ts +18 -1
- package/src/rules/no-unescaped-url-parameter/index.js +5 -0
- package/src/rules/no-unlimited-resource-allocation/index.d.ts +25 -1
- package/src/rules/no-unlimited-resource-allocation/index.js +5 -0
- package/src/rules/no-unsafe-deserialization/index.d.ts +29 -1
- package/src/rules/no-unsafe-deserialization/index.js +5 -0
- package/src/rules/no-unsafe-dynamic-require/index.d.ts +13 -1
- package/src/rules/no-unsafe-dynamic-require/index.js +5 -0
- package/src/rules/no-unsafe-regex-construction/index.d.ts +20 -1
- package/src/rules/no-unsafe-regex-construction/index.js +5 -0
- package/src/rules/no-unvalidated-deeplinks/index.d.ts +6 -2
- package/src/rules/no-unvalidated-deeplinks/index.js +6 -1
- package/src/rules/no-unvalidated-user-input/index.d.ts +18 -1
- package/src/rules/no-unvalidated-user-input/index.js +5 -0
- package/src/rules/no-verbose-error-messages/index.d.ts +6 -4
- package/src/rules/no-verbose-error-messages/index.js +7 -2
- package/src/rules/no-weak-password-recovery/index.d.ts +25 -1
- package/src/rules/no-weak-password-recovery/index.js +5 -0
- package/src/rules/no-xpath-injection/index.d.ts +28 -1
- package/src/rules/no-xpath-injection/index.js +5 -0
- package/src/rules/no-xxe-injection/index.d.ts +28 -1
- package/src/rules/no-xxe-injection/index.js +5 -0
- package/src/rules/no-zip-slip/index.d.ts +25 -1
- package/src/rules/no-zip-slip/index.js +5 -0
- package/src/rules/require-backend-authorization/index.d.ts +6 -2
- package/src/rules/require-backend-authorization/index.js +6 -1
- package/src/rules/require-code-minification/index.d.ts +6 -4
- package/src/rules/require-code-minification/index.js +7 -6
- package/src/rules/require-csp-headers/index.d.ts +6 -2
- package/src/rules/require-csp-headers/index.js +6 -1
- package/src/rules/require-data-minimization/index.d.ts +6 -4
- package/src/rules/require-data-minimization/index.js +9 -7
- package/src/rules/require-dependency-integrity/index.d.ts +6 -2
- package/src/rules/require-dependency-integrity/index.js +6 -1
- package/src/rules/require-https-only/index.d.ts +6 -4
- package/src/rules/require-https-only/index.js +24 -19
- package/src/rules/require-mime-type-validation/index.d.ts +6 -2
- package/src/rules/require-mime-type-validation/index.js +6 -1
- package/src/rules/require-network-timeout/index.d.ts +6 -4
- package/src/rules/require-network-timeout/index.js +18 -11
- package/src/rules/require-package-lock/index.d.ts +6 -4
- package/src/rules/require-package-lock/index.js +7 -6
- package/src/rules/require-secure-credential-storage/index.d.ts +6 -4
- package/src/rules/require-secure-credential-storage/index.js +12 -9
- package/src/rules/require-secure-defaults/index.d.ts +6 -4
- package/src/rules/require-secure-defaults/index.js +7 -6
- package/src/rules/require-secure-deletion/index.d.ts +6 -4
- package/src/rules/require-secure-deletion/index.js +7 -6
- package/src/rules/require-storage-encryption/index.d.ts +6 -4
- package/src/rules/require-storage-encryption/index.js +10 -7
- package/src/rules/require-url-validation/index.d.ts +6 -2
- package/src/rules/require-url-validation/index.js +6 -1
- package/src/types/index.d.ts +5 -0
- package/src/types/index.js +3 -12
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,305 +1,48 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://eslint.interlace.tools" target="blank"><img src="https://eslint.interlace.tools/eslint-interlace-logo-light.svg" alt="ESLint Interlace Logo" width="120" /></a>
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
>
|
|
5
|
+
<p align="center">
|
|
6
|
+
General secure coding practices and OWASP compliance for JavaScript/TypeScript.
|
|
7
|
+
</p>
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/eslint-plugin-secure-coding" target="_blank"><img src="https://img.shields.io/npm/v/eslint-plugin-secure-coding.svg" alt="NPM Version" /></a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/eslint-plugin-secure-coding" target="_blank"><img src="https://img.shields.io/npm/dm/eslint-plugin-secure-coding.svg" alt="NPM Downloads" /></a>
|
|
12
|
+
<a href="https://opensource.org/licenses/MIT" target="_blank"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="Package License" /></a>
|
|
13
|
+
<a href="https://app.codecov.io/gh/ofri-peretz/eslint/components?components%5B0%5D=secure-coding" target="_blank"><img src="https://codecov.io/gh/ofri-peretz/eslint/graph/badge.svg?component=secure-coding" alt="Codecov" /></a>
|
|
14
|
+
<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>
|
|
15
|
+
</p>
|
|
10
16
|
|
|
11
|
-
|
|
12
|
-
> With **75 active rules** mapped to CWE and CVSS, it transforms your linter into an enterprise-grade security auditor that AI assistants can understand and fix.
|
|
17
|
+
## Description
|
|
13
18
|
|
|
14
|
-
|
|
15
|
-
> **v3.0.0**: 14 legacy rules have been **removed** and migrated to dedicated plugins with better coverage. See [Related ESLint Plugins](#-related-eslint-plugins) for migration guidance.
|
|
19
|
+
This plugin provides a comprehensive set of security rules for JavaScript and TypeScript, ensuring alignment with OWASP compliance standards. It covers a wide range of vulnerabilities, from injection attacks to insecure data handling, offering a solid foundation for secure application development. By using this plugin, you can proactively identify and mitigate security risks across your entire codebase.
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
## 💡 What you get
|
|
20
|
-
|
|
21
|
-
- **Feature-based coverage:** 75 rules grouped by attack surface (injection, crypto, auth, cookies, headers, mobile security, resource limits, platform specifics).
|
|
22
|
-
- **LLM-optimized & MCP-ready:** Structured 2-line messages with CWE + OWASP + CVSS + concrete fixes so humans _and_ AI auto-fixers stay aligned.
|
|
23
|
-
- **Standards aligned:** OWASP Top 10 Web + Mobile, CWE tagging, CVSS scoring in every finding for compliance mapping.
|
|
24
|
-
- **Tiered presets:** `recommended`, `strict`, `owasp-top-10` for fast policy rollout.
|
|
25
|
-
- **False-positive reduction:** Sanitizer awareness, annotations, ORM patterns, and safe-library detection keep noise low for org rollouts.
|
|
26
|
-
|
|
27
|
-
Every security rule produces a **structured 2-line error message**:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
src/components/Display.tsx
|
|
31
|
-
18:5 error 🔒 CWE-79 OWASP:A03-Injection CVSS:6.1 | XSS via innerHTML | HIGH [SOC2,PCI-DSS]
|
|
32
|
-
Fix: Use textContent or sanitize with DOMPurify: element.textContent = userInput | https://owasp.org/...
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
**Each message includes:**
|
|
36
|
-
|
|
37
|
-
- 🔒 **CWE reference** - vulnerability classification
|
|
38
|
-
- 📋 **OWASP category** - Top 10 mapping (Web or Mobile)
|
|
39
|
-
- 📊 **CVSS score** - severity rating (0.0-10.0)
|
|
40
|
-
- 🏢 **Compliance tags** - affected frameworks (SOC2, PCI-DSS, HIPAA)
|
|
41
|
-
- ✅ **Fix instruction** - exact code to write
|
|
42
|
-
- 📚 **Documentation link** - learn more
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## 📊 OWASP Coverage Matrix
|
|
47
|
-
|
|
48
|
-
> [!IMPORTANT]
|
|
49
|
-
> Rules marked with ~~strikethrough~~ are deprecated. For **complete OWASP coverage**, combine this plugin with dedicated plugins:
|
|
50
|
-
> | Plugin | Coverage |
|
|
51
|
-
> |--------|----------|
|
|
52
|
-
> | [`eslint-plugin-jwt`](https://www.npmjs.com/package/eslint-plugin-jwt) | A02 — JWT security (13 rules) |
|
|
53
|
-
> | [`eslint-plugin-crypto`](https://www.npmjs.com/package/eslint-plugin-crypto) | A02 — Cryptographic failures (24 rules) |
|
|
54
|
-
> | [`eslint-plugin-pg`](https://www.npmjs.com/package/eslint-plugin-pg) | A03 — SQL injection for PostgreSQL (13 rules) |
|
|
55
|
-
> | [`eslint-plugin-express-security`](https://www.npmjs.com/package/eslint-plugin-express-security) | A05/A07 — CORS, headers, cookies, CSRF for Express |
|
|
56
|
-
> | [`eslint-plugin-nestjs-security`](https://www.npmjs.com/package/eslint-plugin-nestjs-security) | A05/A07 — Guards, validation, throttler for NestJS |
|
|
57
|
-
> | [`eslint-plugin-lambda-security`](https://www.npmjs.com/package/eslint-plugin-lambda-security) | A05/A07 — API Gateway, Middy middleware for AWS Lambda |
|
|
58
|
-
> | [`eslint-plugin-vercel-ai-security`](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) | OWASP LLM + Agentic Top 10 for AI apps (19 rules) |
|
|
59
|
-
|
|
60
|
-
### OWASP Top 10 Web 2021
|
|
61
|
-
|
|
62
|
-
| Category | Description | Rules |
|
|
63
|
-
| ------------ | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
64
|
-
| **A01:2021** | Broken Access Control | `no-privilege-escalation`, `no-missing-authorization`, `no-zip-slip`, `detect-non-literal-fs-filename` |
|
|
65
|
-
| **A02:2021** | Cryptographic Failures | ~~`no-weak-crypto`~~, `no-http-urls`, `require-https-only`, ~~`no-timing-attack`~~, ~~`no-insufficient-random`~~, `no-hardcoded-credentials` + **eslint-plugin-jwt/crypto** |
|
|
66
|
-
| **A03:2021** | Injection | `no-sql-injection`, `database-injection`, `detect-eval-with-expression`, `detect-child-process`, `no-xxe-injection`, `no-xpath-injection`, `no-ldap-injection`, `no-unsanitized-html` |
|
|
67
|
-
| **A04:2021** | Insecure Design | `no-improper-type-validation`, `detect-weak-password-validation` |
|
|
68
|
-
| **A05:2021** | Security Misconfiguration | ~~`no-missing-cors-check`~~, ~~`no-missing-security-headers`~~, ~~`no-permissive-cors`~~, `require-csp-headers` + **eslint-plugin-express-security** |
|
|
69
|
-
| **A06:2021** | Vulnerable Components | `detect-suspicious-dependencies`, `require-package-lock`, `require-dependency-integrity` |
|
|
70
|
-
| **A07:2021** | Auth/Session Failures | `no-missing-authentication`, ~~`no-insecure-cookie-settings`~~, ~~`no-missing-csrf-protection`~~, `no-weak-password-recovery` + **eslint-plugin-express-security** |
|
|
71
|
-
| **A08:2021** | Software/Data Integrity | `no-unsafe-deserialization`, `no-unsafe-dynamic-require` |
|
|
72
|
-
| **A09:2021** | Security Logging | `no-sensitive-data-exposure`, `no-pii-in-logs` |
|
|
73
|
-
| **A10:2021** | SSRF | `no-unvalidated-url-input`, `require-url-validation` |
|
|
74
|
-
|
|
75
|
-
### OWASP Mobile Top 10 2024
|
|
76
|
-
|
|
77
|
-
| Category | Description | Rules |
|
|
78
|
-
| -------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
79
|
-
| **M1** | Improper Credential Usage | `no-credentials-in-storage-api`, `no-hardcoded-credentials` |
|
|
80
|
-
| **M2** | Inadequate Supply Chain | `detect-suspicious-dependencies`, `require-package-lock`, `require-dependency-integrity` |
|
|
81
|
-
| **M3** | Insecure Authentication | `no-client-side-auth-logic`, `detect-weak-password-validation` |
|
|
82
|
-
| **M4** | Insufficient Input/Output | `no-unvalidated-deeplinks`, `require-mime-type-validation`, `require-url-validation`, `no-arbitrary-file-access` |
|
|
83
|
-
| **M5** | Insecure Communication | `no-allow-arbitrary-loads`, `no-http-urls`, `require-https-only`, `no-disabled-certificate-validation` |
|
|
84
|
-
| **M6** | Inadequate Privacy | `no-pii-in-logs`, `no-tracking-without-consent`, `no-sensitive-data-in-analytics`, `require-data-minimization` |
|
|
85
|
-
| **M7** | Insufficient Binary Protection | `no-debug-code-in-production`, `require-code-minification` |
|
|
86
|
-
| **M8** | Security Misconfiguration | `no-verbose-error-messages`, `require-secure-defaults` |
|
|
87
|
-
| **M9** | Insecure Data Storage | `no-sensitive-data-in-cache`, `no-data-in-temp-storage`, `require-secure-deletion`, `require-storage-encryption`, `no-unencrypted-local-storage` |
|
|
88
|
-
| **M10** | Insufficient Crypto | `no-weak-crypto`, `require-credential-storage` |
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## 🔐 75 Active Security Rules
|
|
93
|
-
|
|
94
|
-
💼 = Set in `recommended` | ⚠️ = Warns in `recommended` | 🔧 = Auto-fixable | 💡 = Suggestions
|
|
95
|
-
|
|
96
|
-
### Injection Prevention (11 rules)
|
|
97
|
-
|
|
98
|
-
| Rule | CWE | OWASP | CVSS | Description | 💼 | ⚠️ | 🔧 | 💡 |
|
|
99
|
-
| -------------------------------------------------------------------------- | ------- | ----- | ---- | ----------------------------------------------- | --- | --- | --- | --- |
|
|
100
|
-
| [no-sql-injection](./docs/rules/no-sql-injection.md) | CWE-89 | A03 | 9.8 | Prevent SQL injection via string concatenation | 💼 | | | |
|
|
101
|
-
| [database-injection](./docs/rules/database-injection.md) | CWE-89 | A03 | 9.8 | Comprehensive SQL/NoSQL/ORM injection detection | 💼 | | | |
|
|
102
|
-
| [detect-eval-with-expression](./docs/rules/detect-eval-with-expression.md) | CWE-95 | A03 | 9.8 | Detect eval() with dynamic expressions | 💼 | | | |
|
|
103
|
-
| [detect-child-process](./docs/rules/detect-child-process.md) | CWE-78 | A03 | 9.8 | Detect command injection in child_process | 💼 | | | |
|
|
104
|
-
| [no-unsafe-dynamic-require](./docs/rules/no-unsafe-dynamic-require.md) | CWE-95 | A03 | 7.5 | Forbid dynamic require() calls | 💼 | | | |
|
|
105
|
-
| [no-graphql-injection](./docs/rules/no-graphql-injection.md) | CWE-943 | A03 | 8.6 | Prevent GraphQL injection attacks | 💼 | | | |
|
|
106
|
-
| [no-xxe-injection](./docs/rules/no-xxe-injection.md) | CWE-611 | A03 | 9.1 | Prevent XML External Entity injection | 💼 | | | |
|
|
107
|
-
| [no-xpath-injection](./docs/rules/no-xpath-injection.md) | CWE-643 | A03 | 9.8 | Prevent XPath injection attacks | 💼 | | | |
|
|
108
|
-
| [no-ldap-injection](./docs/rules/no-ldap-injection.md) | CWE-90 | A03 | 9.8 | Prevent LDAP injection attacks | 💼 | | | |
|
|
109
|
-
| [no-directive-injection](./docs/rules/no-directive-injection.md) | CWE-94 | A03 | 8.8 | Prevent template directive injection | 💼 | | | |
|
|
110
|
-
| [no-format-string-injection](./docs/rules/no-format-string-injection.md) | CWE-134 | A03 | 9.8 | Prevent format string vulnerabilities | 💼 | | | |
|
|
111
|
-
|
|
112
|
-
### Mobile Security (30 rules)
|
|
113
|
-
|
|
114
|
-
> **Note:** These rules map to OWASP Mobile Top 10 but are **framework-agnostic** and highly effective for general web application security (e.g., preventing PII leaks, insecure communication, and credential misuse).
|
|
115
|
-
|
|
116
|
-
| Rule | CWE | OWASP Mobile | CVSS | Description | 💼 | ⚠️ | 🔧 | 💡 |
|
|
117
|
-
| ---------------------------------------------------------------------------------------- | ------- | ------------ | ---- | ----------------------------------- | --- | --- | --- | --- |
|
|
118
|
-
| [no-http-urls](./docs/rules/no-http-urls.md) | CWE-319 | M5 | 7.5 | Prevent insecure HTTP URLs | 💼 | | | |
|
|
119
|
-
| [no-hardcoded-credentials](./docs/rules/no-hardcoded-credentials.md) | CWE-798 | M1 | 7.5 | Detect hardcoded secrets | 💼 | | 🔧 | 💡 |
|
|
120
|
-
| [no-credentials-in-storage-api](./docs/rules/no-credentials-in-storage-api.md) | CWE-522 | M1 | 7.5 | Prevent credentials in localStorage | 💼 | | | |
|
|
121
|
-
| [no-credentials-in-query-params](./docs/rules/no-credentials-in-query-params.md) | CWE-598 | M1 | 7.5 | Detect credentials in URLs | 💼 | | | |
|
|
122
|
-
| [no-allow-arbitrary-loads](./docs/rules/no-allow-arbitrary-loads.md) | CWE-295 | M5 | 7.5 | Prevent insecure ATS configuration | | | | |
|
|
123
|
-
| [no-disabled-certificate-validation](./docs/rules/no-disabled-certificate-validation.md) | CWE-295 | M5 | 7.5 | Detect disabled cert validation | | | | |
|
|
124
|
-
| [require-https-only](./docs/rules/require-https-only.md) | CWE-319 | M5 | 7.5 | Enforce HTTPS-only connections | 💼 | | | |
|
|
125
|
-
| [require-network-timeout](./docs/rules/require-network-timeout.md) | CWE-400 | M5 | 7.5 | Require network timeouts | | | | |
|
|
126
|
-
| [detect-weak-password-validation](./docs/rules/detect-weak-password-validation.md) | CWE-521 | M3 | 7.5 | Detect weak password requirements | | | | |
|
|
127
|
-
| [no-client-side-auth-logic](./docs/rules/no-client-side-auth-logic.md) | CWE-602 | M3 | 7.5 | Prevent client-side auth | | | | |
|
|
128
|
-
| [no-hardcoded-session-tokens](./docs/rules/no-hardcoded-session-tokens.md) | CWE-798 | M3 | 9.8 | Detect hardcoded session tokens | 💼 | | | |
|
|
129
|
-
| [no-unvalidated-deeplinks](./docs/rules/no-unvalidated-deeplinks.md) | CWE-939 | M4 | 7.5 | Require deeplink validation | 💼 | | | |
|
|
130
|
-
| [require-url-validation](./docs/rules/require-url-validation.md) | CWE-601 | M4 | 7.5 | Require URL validation | | | | |
|
|
131
|
-
| [require-mime-type-validation](./docs/rules/require-mime-type-validation.md) | CWE-434 | M4 | 7.5 | Require MIME type validation | | | | |
|
|
132
|
-
| [no-arbitrary-file-access](./docs/rules/no-arbitrary-file-access.md) | CWE-22 | M4 | 7.5 | Prevent path traversal | | | | |
|
|
133
|
-
| [no-pii-in-logs](./docs/rules/no-pii-in-logs.md) | CWE-532 | M6 | 7.5 | Prevent PII in logs | | ⚠️ | | |
|
|
134
|
-
| [no-tracking-without-consent](./docs/rules/no-tracking-without-consent.md) | CWE-359 | M6 | 7.5 | Require tracking consent | | | | |
|
|
135
|
-
| [no-sensitive-data-in-analytics](./docs/rules/no-sensitive-data-in-analytics.md) | CWE-359 | M6 | 7.5 | Prevent PII in analytics | | | | |
|
|
136
|
-
| [require-data-minimization](./docs/rules/require-data-minimization.md) | CWE-213 | M6 | 7.5 | Identify excessive data collection | | | | |
|
|
137
|
-
| [no-debug-code-in-production](./docs/rules/no-debug-code-in-production.md) | CWE-489 | M7 | 7.5 | Detect debug code | | | | |
|
|
138
|
-
| [require-code-minification](./docs/rules/require-code-minification.md) | CWE-656 | M7 | 7.5 | Require minification config | | | | |
|
|
139
|
-
| [no-verbose-error-messages](./docs/rules/no-verbose-error-messages.md) | CWE-209 | M8 | 7.5 | Prevent stack trace exposure | | ⚠️ | | |
|
|
140
|
-
| [require-secure-defaults](./docs/rules/require-secure-defaults.md) | CWE-276 | M8 | 7.5 | Require secure default configs | | | | |
|
|
141
|
-
| [no-sensitive-data-in-cache](./docs/rules/no-sensitive-data-in-cache.md) | CWE-524 | M9 | 7.5 | Prevent sensitive cache data | | | | |
|
|
142
|
-
| [no-data-in-temp-storage](./docs/rules/no-data-in-temp-storage.md) | CWE-312 | M9 | 7.5 | Prevent sensitive temp data | | | | |
|
|
143
|
-
| [require-secure-deletion](./docs/rules/require-secure-deletion.md) | CWE-459 | M9 | 7.5 | Require secure data deletion | | | | |
|
|
144
|
-
| [require-storage-encryption](./docs/rules/require-storage-encryption.md) | CWE-311 | M9 | 7.5 | Require encrypted storage | | | | |
|
|
145
|
-
| [no-unencrypted-local-storage](./docs/rules/no-unencrypted-local-storage.md) | CWE-312 | M9 | 7.5 | Prevent unencrypted local storage | | | | |
|
|
146
|
-
| [require-credential-storage](./docs/rules/require-credential-storage.md) | CWE-522 | M10 | 7.5 | Require secure credential storage | | | | |
|
|
147
|
-
| [no-exposed-debug-endpoints](./docs/rules/no-exposed-debug-endpoints.md) | CWE-489 | M8 | 7.5 | Prevent exposed debug endpoints | | | | |
|
|
148
|
-
|
|
149
|
-
### Path & File Security (3 rules)
|
|
150
|
-
|
|
151
|
-
| Rule | CWE | OWASP | CVSS | Description | 💼 | ⚠️ | 🔧 | 💡 |
|
|
152
|
-
| -------------------------------------------------------------------------------- | ------- | ----- | ---- | ----------------------------------------- | --- | --- | --- | --- |
|
|
153
|
-
| [detect-non-literal-fs-filename](./docs/rules/detect-non-literal-fs-filename.md) | CWE-22 | A01 | 7.5 | Detect path traversal in fs operations | 💼 | | | |
|
|
154
|
-
| [no-zip-slip](./docs/rules/no-zip-slip.md) | CWE-22 | A01 | 8.1 | Prevent zip slip vulnerabilities | 💼 | | | |
|
|
155
|
-
| [no-toctou-vulnerability](./docs/rules/no-toctou-vulnerability.md) | CWE-367 | A01 | 7.0 | Detect time-of-check to time-of-use races | 💼 | | | 💡 |
|
|
156
|
-
|
|
157
|
-
### Regex Security (3 rules)
|
|
158
|
-
|
|
159
|
-
| Rule | CWE | OWASP | CVSS | Description | 💼 | ⚠️ | 🔧 | 💡 |
|
|
160
|
-
| ---------------------------------------------------------------------------- | -------- | ----- | ---- | ------------------------------------ | --- | --- | --- | --- |
|
|
161
|
-
| [detect-non-literal-regexp](./docs/rules/detect-non-literal-regexp.md) | CWE-400 | A03 | 7.5 | Detect ReDoS in RegExp construction | | ⚠️ | | |
|
|
162
|
-
| [no-redos-vulnerable-regex](./docs/rules/no-redos-vulnerable-regex.md) | CWE-1333 | A03 | 7.5 | Detect ReDoS-vulnerable patterns | 💼 | | | 💡 |
|
|
163
|
-
| [no-unsafe-regex-construction](./docs/rules/no-unsafe-regex-construction.md) | CWE-400 | A03 | 7.5 | Prevent unsafe regex from user input | | ⚠️ | | 💡 |
|
|
164
|
-
|
|
165
|
-
### Object & Prototype (2 rules)
|
|
166
|
-
|
|
167
|
-
| Rule | CWE | OWASP | CVSS | Description | 💼 | ⚠️ | 🔧 | 💡 |
|
|
168
|
-
| ---------------------------------------------------------------------- | ------- | ----- | ---- | ------------------------------ | --- | --- | --- | --- |
|
|
169
|
-
| [detect-object-injection](./docs/rules/detect-object-injection.md) | CWE-915 | A03 | 7.3 | Detect prototype pollution | | ⚠️ | | |
|
|
170
|
-
| [no-unsafe-deserialization](./docs/rules/no-unsafe-deserialization.md) | CWE-502 | A08 | 9.8 | Prevent unsafe deserialization | 💼 | | | |
|
|
171
|
-
|
|
172
|
-
### Cryptography (6 rules)
|
|
173
|
-
|
|
174
|
-
> [!WARNING]
|
|
175
|
-
> **5 rules deprecated** — Use [`eslint-plugin-jwt`](https://www.npmjs.com/package/eslint-plugin-jwt) (13 rules) and [`eslint-plugin-crypto`](https://www.npmjs.com/package/eslint-plugin-crypto) (24 rules) for comprehensive coverage.
|
|
176
|
-
|
|
177
|
-
| Rule | CWE | OWASP | CVSS | Description | 💼 | ⚠️ | 🔧 | 💡 | 🚫 |
|
|
178
|
-
| -------------------------------------------------------------------- | ------- | ----- | ---- | ------------------------------------ | --- | --- | --- | --- | --- |
|
|
179
|
-
| [no-hardcoded-credentials](./docs/rules/no-hardcoded-credentials.md) | CWE-798 | A07 | 7.5 | Detect hardcoded passwords/keys | 💼 | | | | |
|
|
180
|
-
| [no-weak-crypto](./docs/rules/no-weak-crypto.md) | CWE-327 | A02 | 7.5 | Detect weak algorithms (MD5, SHA1) | 💼 | | | | 🚫 |
|
|
181
|
-
| [no-insufficient-random](./docs/rules/no-insufficient-random.md) | CWE-330 | A02 | 5.3 | Detect Math.random() for security | | ⚠️ | | | 🚫 |
|
|
182
|
-
| [no-timing-attack](./docs/rules/no-timing-attack.md) | CWE-208 | A02 | 5.9 | Detect timing attack vulnerabilities | 💼 | | | | 🚫 |
|
|
183
|
-
| [no-insecure-comparison](./docs/rules/no-insecure-comparison.md) | CWE-697 | A02 | 5.3 | Detect insecure string comparison | | ⚠️ | 🔧 | | 🚫 |
|
|
184
|
-
| [no-insecure-jwt](./docs/rules/no-insecure-jwt.md) | CWE-347 | A02 | 7.5 | Detect JWT security issues | 💼 | | | | 🚫 |
|
|
185
|
-
|
|
186
|
-
### Input Validation & XSS (5 rules)
|
|
187
|
-
|
|
188
|
-
| Rule | CWE | OWASP | CVSS | Description | 💼 | ⚠️ | 🔧 | 💡 |
|
|
189
|
-
| -------------------------------------------------------------------------- | ------- | ----- | ---- | ------------------------------------- | --- | --- | --- | --- |
|
|
190
|
-
| [no-unvalidated-user-input](./docs/rules/no-unvalidated-user-input.md) | CWE-20 | A03 | 8.6 | Detect unvalidated user input | | ⚠️ | | |
|
|
191
|
-
| [no-unsanitized-html](./docs/rules/no-unsanitized-html.md) | CWE-79 | A03 | 6.1 | Detect XSS via innerHTML | 💼 | | | |
|
|
192
|
-
| [no-unescaped-url-parameter](./docs/rules/no-unescaped-url-parameter.md) | CWE-79 | A03 | 6.1 | Detect XSS via URL parameters | | ⚠️ | | |
|
|
193
|
-
| [no-improper-sanitization](./docs/rules/no-improper-sanitization.md) | CWE-116 | A03 | 7.5 | Detect improper output encoding | 💼 | | | |
|
|
194
|
-
| [no-improper-type-validation](./docs/rules/no-improper-type-validation.md) | CWE-20 | A04 | 5.3 | Detect type confusion vulnerabilities | | ⚠️ | | |
|
|
195
|
-
|
|
196
|
-
### Authentication & Authorization (3 rules)
|
|
197
|
-
|
|
198
|
-
| Rule | CWE | OWASP | CVSS | Description | 💼 | ⚠️ | 🔧 | 💡 |
|
|
199
|
-
| ---------------------------------------------------------------------- | ------- | ----- | ---- | ------------------------------ | --- | --- | --- | --- |
|
|
200
|
-
| [no-missing-authentication](./docs/rules/no-missing-authentication.md) | CWE-306 | A07 | 9.8 | Detect missing auth checks | | ⚠️ | | |
|
|
201
|
-
| [no-privilege-escalation](./docs/rules/no-privilege-escalation.md) | CWE-269 | A01 | 8.8 | Detect privilege escalation | | ⚠️ | | |
|
|
202
|
-
| [no-weak-password-recovery](./docs/rules/no-weak-password-recovery.md) | CWE-640 | A07 | 9.8 | Detect insecure password reset | 💼 | | | |
|
|
203
|
-
|
|
204
|
-
### Session & Cookies (3 rules)
|
|
205
|
-
|
|
206
|
-
> [!WARNING]
|
|
207
|
-
> **2 rules deprecated** — Use [`eslint-plugin-express-security`](https://www.npmjs.com/package/eslint-plugin-express-security) or [`eslint-plugin-nestjs-security`](https://www.npmjs.com/package/eslint-plugin-nestjs-security) for framework-specific cookie/CSRF detection.
|
|
208
|
-
|
|
209
|
-
| Rule | CWE | OWASP | CVSS | Description | 💼 | ⚠️ | 🔧 | 💡 | 🚫 |
|
|
210
|
-
| -------------------------------------------------------------------------- | ------- | ----- | ---- | --------------------------------- | --- | --- | --- | --- | --- |
|
|
211
|
-
| [no-insecure-cookie-settings](./docs/rules/no-insecure-cookie-settings.md) | CWE-614 | A07 | 5.3 | Detect missing Secure/HttpOnly | | ⚠️ | | | 🚫 |
|
|
212
|
-
| [no-missing-csrf-protection](./docs/rules/no-missing-csrf-protection.md) | CWE-352 | A07 | 8.8 | Detect missing CSRF tokens | | ⚠️ | | | 🚫 |
|
|
213
|
-
| [no-document-cookie](./docs/rules/no-document-cookie.md) | CWE-565 | A07 | 4.3 | Detect direct cookie manipulation | | ⚠️ | | 💡 | |
|
|
214
|
-
|
|
215
|
-
### Network & Headers (5 rules)
|
|
216
|
-
|
|
217
|
-
> [!WARNING]
|
|
218
|
-
> **4 rules deprecated** — Use [`eslint-plugin-express-security`](https://www.npmjs.com/package/eslint-plugin-express-security) or [`eslint-plugin-nestjs-security`](https://www.npmjs.com/package/eslint-plugin-nestjs-security) for framework-specific CORS/header detection (helmet integration).
|
|
219
|
-
|
|
220
|
-
| Rule | CWE | OWASP | CVSS | Description | 💼 | ⚠️ | 🔧 | 💡 | 🚫 |
|
|
221
|
-
| -------------------------------------------------------------------------- | -------- | ----- | ---- | ------------------------------------ | --- | --- | --- | --- | --- |
|
|
222
|
-
| [no-missing-cors-check](./docs/rules/no-missing-cors-check.md) | CWE-942 | A05 | 7.5 | Detect missing CORS validation | | ⚠️ | | | 🚫 |
|
|
223
|
-
| [no-missing-security-headers](./docs/rules/no-missing-security-headers.md) | CWE-693 | A05 | 5.3 | Detect missing security headers | | ⚠️ | | 💡 | 🚫 |
|
|
224
|
-
| [no-insecure-redirects](./docs/rules/no-insecure-redirects.md) | CWE-601 | A01 | 6.1 | Detect open redirect vulnerabilities | | ⚠️ | | 💡 | |
|
|
225
|
-
| [no-unencrypted-transmission](./docs/rules/no-unencrypted-transmission.md) | CWE-319 | A02 | 7.5 | Detect HTTP instead of HTTPS | | ⚠️ | | | |
|
|
226
|
-
| [no-clickjacking](./docs/rules/no-clickjacking.md) | CWE-1021 | A05 | 6.1 | Detect clickjacking vulnerabilities | 💼 | | | | 🚫 |
|
|
227
|
-
|
|
228
|
-
### Data Exposure (2 rules)
|
|
229
|
-
|
|
230
|
-
| Rule | CWE | OWASP | CVSS | Description | 💼 | ⚠️ | 🔧 | 💡 |
|
|
231
|
-
| ------------------------------------------------------------------------ | ------- | ----- | ---- | ---------------------------------- | --- | --- | --- | --- |
|
|
232
|
-
| [no-exposed-sensitive-data](./docs/rules/no-exposed-sensitive-data.md) | CWE-200 | A01 | 7.5 | Detect sensitive data in responses | 💼 | | | |
|
|
233
|
-
| [no-sensitive-data-exposure](./docs/rules/no-sensitive-data-exposure.md) | CWE-532 | A09 | 5.5 | Detect sensitive data in logs | | ⚠️ | | 💡 |
|
|
234
|
-
|
|
235
|
-
### Buffer, Memory & DoS (3 rules)
|
|
236
|
-
|
|
237
|
-
| Rule | CWE | OWASP | CVSS | Description | 💼 | ⚠️ | 🔧 | 💡 |
|
|
238
|
-
| ------------------------------------------------------------------------------------ | ------- | ----- | ---- | ------------------------------- | --- | --- | --- | --- |
|
|
239
|
-
| [no-buffer-overread](./docs/rules/no-buffer-overread.md) | CWE-126 | A06 | 7.5 | Detect buffer over-read | 💼 | | | |
|
|
240
|
-
| [no-unlimited-resource-allocation](./docs/rules/no-unlimited-resource-allocation.md) | CWE-770 | A05 | 7.5 | Detect unbounded allocations | 💼 | | | |
|
|
241
|
-
| [no-unchecked-loop-condition](./docs/rules/no-unchecked-loop-condition.md) | CWE-835 | A05 | 7.5 | Detect infinite loop conditions | 💼 | | | |
|
|
242
|
-
|
|
243
|
-
### Platform-Specific (2 rules)
|
|
244
|
-
|
|
245
|
-
| Rule | CWE | OWASP | CVSS | Description | 💼 | ⚠️ | 🔧 | 💡 |
|
|
246
|
-
| ------------------------------------------------------------------------------------------------ | ------- | ----- | ---- | ---------------------------------- | --- | --- | --- | --- |
|
|
247
|
-
| [no-electron-security-issues](./docs/rules/no-electron-security-issues.md) | CWE-693 | A05 | 8.8 | Detect Electron security misconfig | 💼 | | | |
|
|
248
|
-
| [no-insufficient-postmessage-validation](./docs/rules/no-insufficient-postmessage-validation.md) | CWE-346 | A07 | 8.8 | Detect postMessage origin issues | 💼 | | | |
|
|
249
|
-
|
|
250
|
-
---
|
|
251
|
-
|
|
252
|
-
## 🚀 Quick Start (Org-friendly)
|
|
253
|
-
|
|
254
|
-
```bash
|
|
255
|
-
# Install
|
|
256
|
-
npm install --save-dev eslint-plugin-secure-coding
|
|
257
|
-
|
|
258
|
-
# Add to eslint.config.js
|
|
259
|
-
import secureCoding from 'eslint-plugin-secure-coding';
|
|
260
|
-
|
|
261
|
-
export default [
|
|
262
|
-
secureCoding.configs.recommended, // baseline for most repos
|
|
263
|
-
{ files: ['apps/**'], ...secureCoding.configs['owasp-top-10'] }, // public-facing
|
|
264
|
-
{ files: ['services/auth/**', 'services/payments/**'], ...secureCoding.configs.strict }, // crown jewels
|
|
265
|
-
];
|
|
266
|
-
|
|
267
|
-
# Run
|
|
268
|
-
npx eslint .
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
---
|
|
272
|
-
|
|
273
|
-
## 📋 Available Presets (policy tiers)
|
|
274
|
-
|
|
275
|
-
| Preset | Description |
|
|
276
|
-
| ------------------------- | --------------------------------------------------------------- |
|
|
277
|
-
| **`recommended`** | Balanced security for most projects (Web + key Mobile security) |
|
|
278
|
-
| **`strict`** | Maximum security enforcement (all rules as errors) |
|
|
279
|
-
| **`owasp-top-10`** | OWASP Top 10 Web 2021 compliance focused |
|
|
280
|
-
| **`owasp-mobile-top-10`** | OWASP Mobile Top 10 2024 compliance focused |
|
|
281
|
-
|
|
282
|
-
---
|
|
21
|
+
## Philosophy
|
|
283
22
|
|
|
284
|
-
|
|
23
|
+
**Interlace** fosters **strength through integration**. Instead of stacking isolated rules, we **interlace** security directly into your workflow to create a resilient fabric of code. We believe tools should **guide rather than gatekeep**, providing educational feedback that strengthens the developer with every interaction.
|
|
285
24
|
|
|
286
|
-
|
|
25
|
+
## Getting Started
|
|
287
26
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
27
|
+
- To check out the [guide](https://eslint.interlace.tools/docs/secure-coding), visit [eslint.interlace.tools](https://eslint.interlace.tools). 📚
|
|
28
|
+
- 要查看中文 [指南](https://eslint.interlace.tools/docs/secure-coding), 请访问 [eslint.interlace.tools](https://eslint.interlace.tools). 📚
|
|
29
|
+
- [가이드](https://eslint.interlace.tools/docs/secure-coding) 문서는 [eslint.interlace.tools](https://eslint.interlace.tools)에서 확인하실 수 있습니다. 📚
|
|
30
|
+
- [ガイド](https://eslint.interlace.tools/docs/secure-coding)は [eslint.interlace.tools](https://eslint.interlace.tools)でご確認ください。 📚
|
|
31
|
+
- Para ver la [guía](https://eslint.interlace.tools/docs/secure-coding), visita [eslint.interlace.tools](https://eslint.interlace.tools). 📚
|
|
32
|
+
- للاطلاع على [الدليل](https://eslint.interlace.tools/docs/secure-coding)، قم بزيارة [eslint.interlace.tools](https://eslint.interlace.tools). 📚
|
|
291
33
|
|
|
292
34
|
```bash
|
|
293
|
-
|
|
294
|
-
42:15 error 🔒 CWE-89 OWASP:A03-Injection CVSS:9.8 | SQL Injection detected | CRITICAL [SOC2,PCI-DSS,HIPAA]
|
|
295
|
-
Fix: Use parameterized query: db.query("SELECT * FROM users WHERE id = ?", [userId]) | https://owasp.org/...
|
|
35
|
+
npm install eslint-plugin-secure-coding --save-dev
|
|
296
36
|
```
|
|
297
37
|
|
|
298
|
-
|
|
38
|
+
## ⚙️ Configuration Presets
|
|
299
39
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
40
|
+
| Preset | Description |
|
|
41
|
+
| :-------------------- | :-------------------------------------------------------------- |
|
|
42
|
+
| `recommended` | Balanced security for most projects (Web + key Mobile security) |
|
|
43
|
+
| `strict` | Maximum security enforcement (all rules as errors) |
|
|
44
|
+
| `owasp-top-10` | OWASP Top 10 Web 2021 compliance focused |
|
|
45
|
+
| `owasp-mobile-top-10` | OWASP Mobile Top 10 2024 compliance focused |
|
|
303
46
|
|
|
304
47
|
---
|
|
305
48
|
|
|
@@ -380,7 +123,7 @@ export default [
|
|
|
380
123
|
|
|
381
124
|
---
|
|
382
125
|
|
|
383
|
-
##
|
|
126
|
+
## AI-Optimized Messages
|
|
384
127
|
|
|
385
128
|
This plugin is optimized for ESLint's [Model Context Protocol (MCP)](https://eslint.org/docs/latest/use/mcp), enabling AI assistants like **Cursor**, **GitHub Copilot**, and **Claude** to:
|
|
386
129
|
|
|
@@ -388,6 +131,12 @@ This plugin is optimized for ESLint's [Model Context Protocol (MCP)](https://esl
|
|
|
388
131
|
- Apply the correct fix using structured guidance
|
|
389
132
|
- Provide educational context to developers
|
|
390
133
|
|
|
134
|
+
```bash
|
|
135
|
+
src/api.ts
|
|
136
|
+
42:15 error 🔒 CWE-89 OWASP:A03-Injection CVSS:9.8 | SQL Injection detected | CRITICAL [SOC2,PCI-DSS,HIPAA]
|
|
137
|
+
Fix: Use parameterized query: db.query("SELECT * FROM users WHERE id = ?", [userId]) | https://owasp.org/...
|
|
138
|
+
```
|
|
139
|
+
|
|
391
140
|
```json
|
|
392
141
|
// .cursor/mcp.json
|
|
393
142
|
{
|
|
@@ -400,6 +149,8 @@ This plugin is optimized for ESLint's [Model Context Protocol (MCP)](https://esl
|
|
|
400
149
|
}
|
|
401
150
|
```
|
|
402
151
|
|
|
152
|
+
By providing this structured context (CWE, OWASP, Fix), we enable AI tools to **reason** about the security flaw rather than hallucinating. This allows Copilot/Cursor to suggest the _exact_ correct fix immediately.
|
|
153
|
+
|
|
403
154
|
---
|
|
404
155
|
|
|
405
156
|
## 🔒 Privacy
|
|
@@ -411,37 +162,120 @@ This plugin runs **100% locally**. No data ever leaves your machine.
|
|
|
411
162
|
**Q: Does it work with ESLint 9 flat config?**
|
|
412
163
|
A: Yes, fully compatible.
|
|
413
164
|
|
|
165
|
+
## Rules
|
|
166
|
+
|
|
167
|
+
**Legend**
|
|
168
|
+
|
|
169
|
+
| Icon | Description |
|
|
170
|
+
| :--: | :----------------------------------------------------------------- |
|
|
171
|
+
| 💼 | **Recommended**: Included in the recommended preset. |
|
|
172
|
+
| ⚠️ | **Warns**: Set towarn in recommended preset. |
|
|
173
|
+
| 🔧 | **Auto-fixable**: Automatically fixable by the `--fix` CLI option. |
|
|
174
|
+
| 💡 | **Suggestions**: Providing code suggestions in IDE. |
|
|
175
|
+
| 🚫 | **Deprecated**: This rule is deprecated. |
|
|
176
|
+
|
|
177
|
+
| Rule | CWE | OWASP | CVSS | Description | 💼 | ⚠️ | 🔧 | 💡 | 🚫 |
|
|
178
|
+
| :--------------------------------------------------------------------------------------------------------------------------------------- | :------: | :---: | :--: | :----------------------------------------------------------------------------------------------- | :-: | :-: | :-: | :-: | :-: |
|
|
179
|
+
| [no-sql-injection](https://eslint.interlace.tools/docs/secure-coding/rules/no-sql-injection) | CWE-89 | | 9.8 | [no-sql-injection](./docs/rules/no-sql-injection.md) | 💼 | | | | |
|
|
180
|
+
| [database-injection](https://eslint.interlace.tools/docs/secure-coding/rules/database-injection) | CWE-89 | | 9.8 | [database-injection](./docs/rules/database-injection.md) | 💼 | | | | |
|
|
181
|
+
| [detect-eval-with-expression](https://eslint.interlace.tools/docs/secure-coding/rules/detect-eval-with-expression) | CWE-95 | | 9.8 | [detect-eval-with-expression](./docs/rules/detect-eval-with-expression.md) | 💼 | | | | |
|
|
182
|
+
| [detect-child-process](https://eslint.interlace.tools/docs/secure-coding/rules/detect-child-process) | CWE-78 | | 9.8 | [detect-child-process](./docs/rules/detect-child-process.md) | 💼 | | | | |
|
|
183
|
+
| [no-unsafe-dynamic-require](https://eslint.interlace.tools/docs/secure-coding/rules/no-unsafe-dynamic-require) | CWE-95 | | 7.5 | [no-unsafe-dynamic-require](./docs/rules/no-unsafe-dynamic-require.md) | 💼 | | | | |
|
|
184
|
+
| [no-graphql-injection](https://eslint.interlace.tools/docs/secure-coding/rules/no-graphql-injection) | CWE-943 | | 8.6 | [no-graphql-injection](./docs/rules/no-graphql-injection.md) | 💼 | | | | |
|
|
185
|
+
| [no-xxe-injection](https://eslint.interlace.tools/docs/secure-coding/rules/no-xxe-injection) | CWE-611 | | 9.1 | [no-xxe-injection](./docs/rules/no-xxe-injection.md) | 💼 | | | | |
|
|
186
|
+
| [no-xpath-injection](https://eslint.interlace.tools/docs/secure-coding/rules/no-xpath-injection) | CWE-643 | | 9.8 | [no-xpath-injection](./docs/rules/no-xpath-injection.md) | 💼 | | | | |
|
|
187
|
+
| [no-ldap-injection](https://eslint.interlace.tools/docs/secure-coding/rules/no-ldap-injection) | CWE-90 | | 9.8 | [no-ldap-injection](./docs/rules/no-ldap-injection.md) | 💼 | | | | |
|
|
188
|
+
| [no-directive-injection](https://eslint.interlace.tools/docs/secure-coding/rules/no-directive-injection) | CWE-94 | | 8.8 | [no-directive-injection](./docs/rules/no-directive-injection.md) | 💼 | | | | |
|
|
189
|
+
| [no-format-string-injection](https://eslint.interlace.tools/docs/secure-coding/rules/no-format-string-injection) | CWE-134 | | 9.8 | [no-format-string-injection](./docs/rules/no-format-string-injection.md) | 💼 | | | | |
|
|
190
|
+
| [no-http-urls](https://eslint.interlace.tools/docs/secure-coding/rules/no-http-urls) | CWE-319 | | 7.5 | [no-http-urls](./docs/rules/no-http-urls.md) | 💼 | | | | |
|
|
191
|
+
| [no-hardcoded-credentials](https://eslint.interlace.tools/docs/secure-coding/rules/no-hardcoded-credentials) | CWE-798 | | 7.5 | [no-hardcoded-credentials](./docs/rules/no-hardcoded-credentials.md) | 💼 | | 🔧 | 💡 | |
|
|
192
|
+
| [no-credentials-in-storage-api](https://eslint.interlace.tools/docs/secure-coding/rules/no-credentials-in-storage-api) | CWE-522 | | 7.5 | [no-credentials-in-storage-api](./docs/rules/no-credentials-in-storage-api.md) | 💼 | | | | |
|
|
193
|
+
| [no-credentials-in-query-params](https://eslint.interlace.tools/docs/secure-coding/rules/no-credentials-in-query-params) | CWE-598 | | 7.5 | [no-credentials-in-query-params](./docs/rules/no-credentials-in-query-params.md) | 💼 | | | | |
|
|
194
|
+
| [no-allow-arbitrary-loads](https://eslint.interlace.tools/docs/secure-coding/rules/no-allow-arbitrary-loads) | CWE-295 | | 7.5 | [no-allow-arbitrary-loads](./docs/rules/no-allow-arbitrary-loads.md) | | | | | |
|
|
195
|
+
| [no-disabled-certificate-validation](https://eslint.interlace.tools/docs/secure-coding/rules/no-disabled-certificate-validation) | CWE-295 | | 7.5 | [no-disabled-certificate-validation](./docs/rules/no-disabled-certificate-validation.md) | | | | | |
|
|
196
|
+
| [require-https-only](https://eslint.interlace.tools/docs/secure-coding/rules/require-https-only) | CWE-319 | | 7.5 | [require-https-only](./docs/rules/require-https-only.md) | 💼 | | | | |
|
|
197
|
+
| [require-network-timeout](https://eslint.interlace.tools/docs/secure-coding/rules/require-network-timeout) | CWE-400 | | 7.5 | [require-network-timeout](./docs/rules/require-network-timeout.md) | | | | | |
|
|
198
|
+
| [detect-weak-password-validation](https://eslint.interlace.tools/docs/secure-coding/rules/detect-weak-password-validation) | CWE-521 | | 7.5 | [detect-weak-password-validation](./docs/rules/detect-weak-password-validation.md) | | | | | |
|
|
199
|
+
| [no-client-side-auth-logic](https://eslint.interlace.tools/docs/secure-coding/rules/no-client-side-auth-logic) | CWE-602 | | 7.5 | [no-client-side-auth-logic](./docs/rules/no-client-side-auth-logic.md) | | | | | |
|
|
200
|
+
| [no-hardcoded-session-tokens](https://eslint.interlace.tools/docs/secure-coding/rules/no-hardcoded-session-tokens) | CWE-798 | | 9.8 | [no-hardcoded-session-tokens](./docs/rules/no-hardcoded-session-tokens.md) | 💼 | | | | |
|
|
201
|
+
| [no-unvalidated-deeplinks](https://eslint.interlace.tools/docs/secure-coding/rules/no-unvalidated-deeplinks) | CWE-939 | | 7.5 | [no-unvalidated-deeplinks](./docs/rules/no-unvalidated-deeplinks.md) | 💼 | | | | |
|
|
202
|
+
| [require-url-validation](https://eslint.interlace.tools/docs/secure-coding/rules/require-url-validation) | CWE-601 | | 7.5 | [require-url-validation](./docs/rules/require-url-validation.md) | | | | | |
|
|
203
|
+
| [require-mime-type-validation](https://eslint.interlace.tools/docs/secure-coding/rules/require-mime-type-validation) | CWE-434 | | 7.5 | [require-mime-type-validation](./docs/rules/require-mime-type-validation.md) | | | | | |
|
|
204
|
+
| [no-arbitrary-file-access](https://eslint.interlace.tools/docs/secure-coding/rules/no-arbitrary-file-access) | CWE-22 | | 7.5 | [no-arbitrary-file-access](./docs/rules/no-arbitrary-file-access.md) | | | | | |
|
|
205
|
+
| [no-pii-in-logs](https://eslint.interlace.tools/docs/secure-coding/rules/no-pii-in-logs) | CWE-532 | | 7.5 | [no-pii-in-logs](./docs/rules/no-pii-in-logs.md) | | ⚠️ | | | |
|
|
206
|
+
| [no-tracking-without-consent](https://eslint.interlace.tools/docs/secure-coding/rules/no-tracking-without-consent) | CWE-359 | | 7.5 | [no-tracking-without-consent](./docs/rules/no-tracking-without-consent.md) | | | | | |
|
|
207
|
+
| [no-sensitive-data-in-analytics](https://eslint.interlace.tools/docs/secure-coding/rules/no-sensitive-data-in-analytics) | CWE-359 | | 7.5 | [no-sensitive-data-in-analytics](./docs/rules/no-sensitive-data-in-analytics.md) | | | | | |
|
|
208
|
+
| [require-data-minimization](https://eslint.interlace.tools/docs/secure-coding/rules/require-data-minimization) | CWE-213 | | 7.5 | [require-data-minimization](./docs/rules/require-data-minimization.md) | | | | | |
|
|
209
|
+
| [no-debug-code-in-production](https://eslint.interlace.tools/docs/secure-coding/rules/no-debug-code-in-production) | CWE-489 | | 7.5 | [no-debug-code-in-production](./docs/rules/no-debug-code-in-production.md) | | | | | |
|
|
210
|
+
| [require-code-minification](https://eslint.interlace.tools/docs/secure-coding/rules/require-code-minification) | CWE-656 | | 7.5 | [require-code-minification](./docs/rules/require-code-minification.md) | | | | | |
|
|
211
|
+
| [no-verbose-error-messages](https://eslint.interlace.tools/docs/secure-coding/rules/no-verbose-error-messages) | CWE-209 | | 7.5 | [no-verbose-error-messages](./docs/rules/no-verbose-error-messages.md) | | ⚠️ | | | |
|
|
212
|
+
| [require-secure-defaults](https://eslint.interlace.tools/docs/secure-coding/rules/require-secure-defaults) | CWE-276 | | 7.5 | [require-secure-defaults](./docs/rules/require-secure-defaults.md) | | | | | |
|
|
213
|
+
| [no-sensitive-data-in-cache](https://eslint.interlace.tools/docs/secure-coding/rules/no-sensitive-data-in-cache) | CWE-524 | | 7.5 | [no-sensitive-data-in-cache](./docs/rules/no-sensitive-data-in-cache.md) | | | | | |
|
|
214
|
+
| [no-data-in-temp-storage](https://eslint.interlace.tools/docs/secure-coding/rules/no-data-in-temp-storage) | CWE-312 | | 7.5 | [no-data-in-temp-storage](./docs/rules/no-data-in-temp-storage.md) | | | | | |
|
|
215
|
+
| [require-secure-deletion](https://eslint.interlace.tools/docs/secure-coding/rules/require-secure-deletion) | CWE-459 | | 7.5 | [require-secure-deletion](./docs/rules/require-secure-deletion.md) | | | | | |
|
|
216
|
+
| [require-storage-encryption](https://eslint.interlace.tools/docs/secure-coding/rules/require-storage-encryption) | CWE-311 | | 7.5 | [require-storage-encryption](./docs/rules/require-storage-encryption.md) | | | | | |
|
|
217
|
+
| [no-unencrypted-local-storage](https://eslint.interlace.tools/docs/secure-coding/rules/no-unencrypted-local-storage) | CWE-312 | | 7.5 | [no-unencrypted-local-storage](./docs/rules/no-unencrypted-local-storage.md) | | | | | |
|
|
218
|
+
| [require-credential-storage](https://eslint.interlace.tools/docs/secure-coding/rules/require-credential-storage) | CWE-522 | | 7.5 | [require-credential-storage](./docs/rules/require-credential-storage.md) | | | | | |
|
|
219
|
+
| [no-exposed-debug-endpoints](https://eslint.interlace.tools/docs/secure-coding/rules/no-exposed-debug-endpoints) | CWE-489 | | 7.5 | [no-exposed-debug-endpoints](./docs/rules/no-exposed-debug-endpoints.md) | | | | | |
|
|
220
|
+
| [detect-non-literal-fs-filename](https://eslint.interlace.tools/docs/secure-coding/rules/detect-non-literal-fs-filename) | CWE-22 | | 7.5 | [detect-non-literal-fs-filename](./docs/rules/detect-non-literal-fs-filename.md) | 💼 | | | | |
|
|
221
|
+
| [no-zip-slip](https://eslint.interlace.tools/docs/secure-coding/rules/no-zip-slip) | CWE-22 | | 8.1 | [no-zip-slip](./docs/rules/no-zip-slip.md) | 💼 | | | | |
|
|
222
|
+
| [no-toctou-vulnerability](https://eslint.interlace.tools/docs/secure-coding/rules/no-toctou-vulnerability) | CWE-367 | | 7.0 | [no-toctou-vulnerability](./docs/rules/no-toctou-vulnerability.md) | 💼 | | | 💡 | |
|
|
223
|
+
| [detect-non-literal-regexp](https://eslint.interlace.tools/docs/secure-coding/rules/detect-non-literal-regexp) | CWE-400 | | 7.5 | [detect-non-literal-regexp](./docs/rules/detect-non-literal-regexp.md) | | ⚠️ | | | |
|
|
224
|
+
| [no-redos-vulnerable-regex](https://eslint.interlace.tools/docs/secure-coding/rules/no-redos-vulnerable-regex) | CWE-1333 | | 7.5 | [no-redos-vulnerable-regex](./docs/rules/no-redos-vulnerable-regex.md) | 💼 | | | 💡 | |
|
|
225
|
+
| [no-unsafe-regex-construction](https://eslint.interlace.tools/docs/secure-coding/rules/no-unsafe-regex-construction) | CWE-400 | | 7.5 | [no-unsafe-regex-construction](./docs/rules/no-unsafe-regex-construction.md) | | ⚠️ | | 💡 | |
|
|
226
|
+
| [detect-object-injection](https://eslint.interlace.tools/docs/secure-coding/rules/detect-object-injection) | CWE-915 | | 7.3 | [detect-object-injection](./docs/rules/detect-object-injection.md) | | ⚠️ | | | |
|
|
227
|
+
| [no-unsafe-deserialization](https://eslint.interlace.tools/docs/secure-coding/rules/no-unsafe-deserialization) | CWE-502 | | 9.8 | [no-unsafe-deserialization](./docs/rules/no-unsafe-deserialization.md) | 💼 | | | | |
|
|
228
|
+
| [no-weak-crypto](https://eslint.interlace.tools/docs/secure-coding/rules/no-weak-crypto) | CWE-327 | | 7.5 | [no-weak-crypto](./docs/rules/no-weak-crypto.md) | 💼 | | | | 🚫 |
|
|
229
|
+
| [no-insufficient-random](https://eslint.interlace.tools/docs/secure-coding/rules/no-insufficient-random) | CWE-330 | | 5.3 | [no-insufficient-random](./docs/rules/no-insufficient-random.md) | | ⚠️ | | | 🚫 |
|
|
230
|
+
| [no-timing-attack](https://eslint.interlace.tools/docs/secure-coding/rules/no-timing-attack) | CWE-208 | | 5.9 | [no-timing-attack](./docs/rules/no-timing-attack.md) | 💼 | | | | 🚫 |
|
|
231
|
+
| [no-insecure-comparison](https://eslint.interlace.tools/docs/secure-coding/rules/no-insecure-comparison) | CWE-697 | | 5.3 | [no-insecure-comparison](./docs/rules/no-insecure-comparison.md) | | ⚠️ | 🔧 | | 🚫 |
|
|
232
|
+
| [no-insecure-jwt](https://eslint.interlace.tools/docs/secure-coding/rules/no-insecure-jwt) | CWE-347 | | 7.5 | [no-insecure-jwt](./docs/rules/no-insecure-jwt.md) | 💼 | | | | 🚫 |
|
|
233
|
+
| [no-unvalidated-user-input](https://eslint.interlace.tools/docs/secure-coding/rules/no-unvalidated-user-input) | CWE-20 | | 8.6 | [no-unvalidated-user-input](./docs/rules/no-unvalidated-user-input.md) | | ⚠️ | | | |
|
|
234
|
+
| [no-unsanitized-html](https://eslint.interlace.tools/docs/secure-coding/rules/no-unsanitized-html) | CWE-79 | | 6.1 | [no-unsanitized-html](./docs/rules/no-unsanitized-html.md) | 💼 | | | | |
|
|
235
|
+
| [no-unescaped-url-parameter](https://eslint.interlace.tools/docs/secure-coding/rules/no-unescaped-url-parameter) | CWE-79 | | 6.1 | [no-unescaped-url-parameter](./docs/rules/no-unescaped-url-parameter.md) | | ⚠️ | | | |
|
|
236
|
+
| [no-improper-sanitization](https://eslint.interlace.tools/docs/secure-coding/rules/no-improper-sanitization) | CWE-116 | | 7.5 | [no-improper-sanitization](./docs/rules/no-improper-sanitization.md) | 💼 | | | | |
|
|
237
|
+
| [no-improper-type-validation](https://eslint.interlace.tools/docs/secure-coding/rules/no-improper-type-validation) | CWE-20 | | 5.3 | [no-improper-type-validation](./docs/rules/no-improper-type-validation.md) | | ⚠️ | | | |
|
|
238
|
+
| [no-missing-authentication](https://eslint.interlace.tools/docs/secure-coding/rules/no-missing-authentication) | CWE-306 | | 9.8 | [no-missing-authentication](./docs/rules/no-missing-authentication.md) | | ⚠️ | | | |
|
|
239
|
+
| [no-privilege-escalation](https://eslint.interlace.tools/docs/secure-coding/rules/no-privilege-escalation) | CWE-269 | | 8.8 | [no-privilege-escalation](./docs/rules/no-privilege-escalation.md) | | ⚠️ | | | |
|
|
240
|
+
| [no-weak-password-recovery](https://eslint.interlace.tools/docs/secure-coding/rules/no-weak-password-recovery) | CWE-640 | | 9.8 | [no-weak-password-recovery](./docs/rules/no-weak-password-recovery.md) | 💼 | | | | |
|
|
241
|
+
| [no-insecure-cookie-settings](https://eslint.interlace.tools/docs/secure-coding/rules/no-insecure-cookie-settings) | CWE-614 | | 5.3 | [no-insecure-cookie-settings](./docs/rules/no-insecure-cookie-settings.md) | | ⚠️ | | | 🚫 |
|
|
242
|
+
| [no-missing-csrf-protection](https://eslint.interlace.tools/docs/secure-coding/rules/no-missing-csrf-protection) | CWE-352 | | 8.8 | [no-missing-csrf-protection](./docs/rules/no-missing-csrf-protection.md) | | ⚠️ | | | 🚫 |
|
|
243
|
+
| [no-document-cookie](https://eslint.interlace.tools/docs/secure-coding/rules/no-document-cookie) | CWE-565 | | 4.3 | [no-document-cookie](./docs/rules/no-document-cookie.md) | | ⚠️ | | 💡 | |
|
|
244
|
+
| [no-missing-cors-check](https://eslint.interlace.tools/docs/secure-coding/rules/no-missing-cors-check) | CWE-942 | | 7.5 | [no-missing-cors-check](./docs/rules/no-missing-cors-check.md) | | ⚠️ | | | 🚫 |
|
|
245
|
+
| [no-missing-security-headers](https://eslint.interlace.tools/docs/secure-coding/rules/no-missing-security-headers) | CWE-693 | | 5.3 | [no-missing-security-headers](./docs/rules/no-missing-security-headers.md) | | ⚠️ | | 💡 | 🚫 |
|
|
246
|
+
| [no-insecure-redirects](https://eslint.interlace.tools/docs/secure-coding/rules/no-insecure-redirects) | CWE-601 | | 6.1 | [no-insecure-redirects](./docs/rules/no-insecure-redirects.md) | | ⚠️ | | 💡 | |
|
|
247
|
+
| [no-unencrypted-transmission](https://eslint.interlace.tools/docs/secure-coding/rules/no-unencrypted-transmission) | CWE-319 | | 7.5 | [no-unencrypted-transmission](./docs/rules/no-unencrypted-transmission.md) | | ⚠️ | | | |
|
|
248
|
+
| [no-clickjacking](https://eslint.interlace.tools/docs/secure-coding/rules/no-clickjacking) | CWE-1021 | | 6.1 | [no-clickjacking](./docs/rules/no-clickjacking.md) | 💼 | | | | 🚫 |
|
|
249
|
+
| [no-exposed-sensitive-data](https://eslint.interlace.tools/docs/secure-coding/rules/no-exposed-sensitive-data) | CWE-200 | | 7.5 | [no-exposed-sensitive-data](./docs/rules/no-exposed-sensitive-data.md) | 💼 | | | | |
|
|
250
|
+
| [no-sensitive-data-exposure](https://eslint.interlace.tools/docs/secure-coding/rules/no-sensitive-data-exposure) | CWE-532 | | 5.5 | [no-sensitive-data-exposure](./docs/rules/no-sensitive-data-exposure.md) | | ⚠️ | | 💡 | |
|
|
251
|
+
| [no-buffer-overread](https://eslint.interlace.tools/docs/secure-coding/rules/no-buffer-overread) | CWE-126 | | 7.5 | [no-buffer-overread](./docs/rules/no-buffer-overread.md) | 💼 | | | | |
|
|
252
|
+
| [no-unlimited-resource-allocation](https://eslint.interlace.tools/docs/secure-coding/rules/no-unlimited-resource-allocation) | CWE-770 | | 7.5 | [no-unlimited-resource-allocation](./docs/rules/no-unlimited-resource-allocation.md) | 💼 | | | | |
|
|
253
|
+
| [no-unchecked-loop-condition](https://eslint.interlace.tools/docs/secure-coding/rules/no-unchecked-loop-condition) | CWE-835 | | 7.5 | [no-unchecked-loop-condition](./docs/rules/no-unchecked-loop-condition.md) | 💼 | | | | |
|
|
254
|
+
| [no-electron-security-issues](https://eslint.interlace.tools/docs/secure-coding/rules/no-electron-security-issues) | CWE-693 | | 8.8 | [no-electron-security-issues](./docs/rules/no-electron-security-issues.md) | 💼 | | | | |
|
|
255
|
+
| [no-insufficient-postmessage-validation](https://eslint.interlace.tools/docs/secure-coding/rules/no-insufficient-postmessage-validation) | CWE-346 | | 8.8 | [no-insufficient-postmessage-validation](./docs/rules/no-insufficient-postmessage-validation.md) | 💼 | | | | |
|
|
256
|
+
| [Deprecated](https://eslint.interlace.tools/docs/secure-coding/rules/Deprecated) | | | | Deprecated Rules | | | | | |
|
|
257
|
+
|
|
414
258
|
## 🔗 Related ESLint Plugins
|
|
415
259
|
|
|
416
260
|
Part of the **Interlace ESLint Ecosystem** — AI-native security plugins with LLM-optimized error messages:
|
|
417
261
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
|
423
|
-
|
|
|
424
|
-
| `
|
|
425
|
-
| `
|
|
426
|
-
| `
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
| Plugin | Description | Rules |
|
|
431
|
-
| ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | :---: |
|
|
432
|
-
| [`eslint-plugin-jwt`](https://www.npmjs.com/package/eslint-plugin-jwt) | JWT security (algorithm confusion, weak secrets, claims validation) | 13 |
|
|
433
|
-
| [`eslint-plugin-crypto`](https://www.npmjs.com/package/eslint-plugin-crypto) | Cryptographic best practices (weak algorithms, key handling, CVE-specific) | 24 |
|
|
434
|
-
| [`eslint-plugin-pg`](https://www.npmjs.com/package/eslint-plugin-pg) | PostgreSQL/node-postgres security and best practices | 13 |
|
|
435
|
-
| [`eslint-plugin-express-security`](https://www.npmjs.com/package/eslint-plugin-express-security) | Express.js security (CORS, cookies, CSRF, helmet) | 15 |
|
|
436
|
-
| [`eslint-plugin-nestjs-security`](https://www.npmjs.com/package/eslint-plugin-nestjs-security) | NestJS security (guards, validation pipes, throttler) | 15 |
|
|
437
|
-
| [`eslint-plugin-lambda-security`](https://www.npmjs.com/package/eslint-plugin-lambda-security) | AWS Lambda/Middy security (API Gateway, headers, validation) | 9 |
|
|
438
|
-
| [`eslint-plugin-vercel-ai-security`](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) | Vercel AI SDK security (OWASP LLM + Agentic Top 10) | 19 |
|
|
439
|
-
| [`eslint-plugin-import-next`](https://www.npmjs.com/package/eslint-plugin-import-next) | High-performance import linting with AI-guided cycle fixes | 12 |
|
|
262
|
+
| Plugin | Downloads | Description |
|
|
263
|
+
| :--------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------ |
|
|
264
|
+
| [`eslint-plugin-secure-coding`](https://www.npmjs.com/package/eslint-plugin-secure-coding) | [](https://www.npmjs.com/package/eslint-plugin-secure-coding) | General security rules & OWASP guidelines. |
|
|
265
|
+
| [`eslint-plugin-pg`](https://www.npmjs.com/package/eslint-plugin-pg) | [](https://www.npmjs.com/package/eslint-plugin-pg) | PostgreSQL security & best practices. |
|
|
266
|
+
| [`eslint-plugin-crypto`](https://www.npmjs.com/package/eslint-plugin-crypto) | [](https://www.npmjs.com/package/eslint-plugin-crypto) | NodeJS Cryptography security rules. |
|
|
267
|
+
| [`eslint-plugin-jwt`](https://www.npmjs.com/package/eslint-plugin-jwt) | [](https://www.npmjs.com/package/eslint-plugin-jwt) | JWT security & best practices. |
|
|
268
|
+
| [`eslint-plugin-browser-security`](https://www.npmjs.com/package/eslint-plugin-browser-security) | [](https://www.npmjs.com/package/eslint-plugin-browser-security) | Browser-specific security & XSS prevention. |
|
|
269
|
+
| [`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) | Vercel AI SDK security rules. |
|
|
270
|
+
| [`eslint-plugin-express-security`](https://www.npmjs.com/package/eslint-plugin-express-security) | [](https://www.npmjs.com/package/eslint-plugin-express-security) | Express.js security hardening rules. |
|
|
271
|
+
| [`eslint-plugin-lambda-security`](https://www.npmjs.com/package/eslint-plugin-lambda-security) | [](https://www.npmjs.com/package/eslint-plugin-lambda-security) | AWS Lambda security best practices. |
|
|
272
|
+
| [`eslint-plugin-nestjs-security`](https://www.npmjs.com/package/eslint-plugin-nestjs-security) | [](https://www.npmjs.com/package/eslint-plugin-nestjs-security) | NestJS security rules & patterns. |
|
|
273
|
+
| [`eslint-plugin-import-next`](https://www.npmjs.com/package/eslint-plugin-import-next) | [](https://www.npmjs.com/package/eslint-plugin-import-next) | Next-gen import sorting & architecture. |
|
|
440
274
|
|
|
441
275
|
## 📄 License
|
|
442
276
|
|
|
443
277
|
MIT © [Ofri Peretz](https://github.com/ofri-peretz)
|
|
444
278
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
279
|
+
<p align="center">
|
|
280
|
+
<a href="https://eslint.interlace.tools/docs/secure-coding"><img src="https://eslint.interlace.tools/images/og-secure-coding.png" alt="ESLint Interlace Plugin" width="300" /></a>
|
|
281
|
+
</p>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-secure-coding",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.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",
|