eslint-plugin-secure-coding
v3.0.2
Published
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.
Maintainers
Readme
Description
This plugin provides General secure coding practices and OWASP compliance for JavaScript/TypeScript. By using this plugin, you can proactively identify and mitigate security risks across your entire codebase.
Philosophy
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.
Getting Started
- To check out the guide, visit eslint.interlace.tools. 📚
- 要查看中文 指南, 请访问 eslint.interlace.tools. 📚
- 가이드 문서는 eslint.interlace.tools에서 확인하실 수 있습니다. 📚
- ガイドは eslint.interlace.toolsでご確認ください。 📚
- Para ver la guía, visita eslint.interlace.tools. 📚
- للاطلاع على الدليل، قم بزيارة eslint.interlace.tools. 📚
npm install eslint-plugin-secure-coding --save-dev⚙️ Configuration Presets
| Preset | Description |
| :-------------------- | :-------------------------------------------------------------- |
| recommended | Balanced security for most projects (Web + key Mobile security) |
| strict | Maximum security enforcement (all rules as errors) |
| owasp-top-10 | OWASP Top 10 Web 2021 compliance focused |
| owasp-mobile-top-10 | OWASP Mobile Top 10 2024 compliance focused |
Rules
Legend
| Icon | Description |
| :---: | :--- |
| 💼 | Recommended: Included in the recommended preset. |
| ⚠️ | Warns: Set towarn in recommended preset. |
| 🔧 | Auto-fixable: Automatically fixable by the --fix CLI option. |
| 💡 | Suggestions: Providing code suggestions in IDE. |
| 🚫 | Deprecated: This rule is deprecated. |
| Rule | CWE | OWASP | CVSS | Description | 💼 | ⚠️ | 🔧 | 💡 | 🚫 | | :--- | :---: | :---: | :---: | :--- | :---: | :---: | :---: | :---: | :---: | | detect-non-literal-regexp | CWE-400 | | 7.5 | ESLint security rule documentation for detect-non-literal-regexp | | ⚠️ | | | | | detect-object-injection | CWE-915 | | 7.3 | ESLint security rule documentation for detect-object-injection | | ⚠️ | | | | | detect-weak-password-validation | CWE-521 | | 7.5 | ESLint security rule documentation for detect-weak-password-validation | | | | | | | no-directive-injection | CWE-94 | | 8.8 | ESLint security rule documentation for no-directive-injection | 💼 | | | | | | no-electron-security-issues | CWE-693 | | 8.8 | ESLint security rule documentation for no-electron-security-issues | 💼 | | | | | | no-format-string-injection | CWE-134 | | 9.8 | ESLint security rule documentation for no-format-string-injection | 💼 | | | | | | no-graphql-injection | CWE-943 | | 8.6 | ESLint security rule documentation for no-graphql-injection | 💼 | | | | | | no-hardcoded-credentials | CWE-798 | | 7.5 | ESLint security rule documentation for no-hardcoded-credentials | 💼 | | 🔧 | 💡 | | | no-hardcoded-session-tokens | CWE-798 | | 9.8 | ESLint security rule documentation for no-hardcoded-session-tokens | 💼 | | | | | | no-improper-sanitization | CWE-116 | | 7.5 | ESLint security rule documentation for no-improper-sanitization | 💼 | | | | | | no-improper-type-validation | CWE-20 | | 5.3 | ESLint security rule documentation for no-improper-type-validation | | ⚠️ | | | | | no-insecure-comparison | CWE-697 | | 5.3 | ESLint security rule documentation for no-insecure-comparison | | ⚠️ | 🔧 | | 🚫 | | no-ldap-injection | CWE-90 | | 9.8 | ESLint security rule documentation for no-ldap-injection | 💼 | | | | | | no-missing-authentication | CWE-306 | | 9.8 | ESLint security rule documentation for no-missing-authentication | | ⚠️ | | | | | no-pii-in-logs | CWE-532 | | 7.5 | Enforce no pii in logs | | ⚠️ | | | | | no-privilege-escalation | CWE-269 | | 8.8 | ESLint security rule documentation for no-privilege-escalation | | ⚠️ | | | | | no-redos-vulnerable-regex | CWE-1333 | | 7.5 | ESLint security rule documentation for no-redos-vulnerable-regex | 💼 | | | 💡 | | | no-sensitive-data-exposure | CWE-532 | | 5.5 | ESLint security rule documentation for no-sensitive-data-exposure | | ⚠️ | | 💡 | | | no-unchecked-loop-condition | CWE-835 | | 7.5 | ESLint security rule documentation for no-unchecked-loop-condition | 💼 | | | | | | no-unlimited-resource-allocation | CWE-770 | | 7.5 | ESLint security rule documentation for no-unlimited-resource-allocation | 💼 | | | | | | no-unsafe-deserialization | CWE-502 | | 9.8 | ESLint security rule documentation for no-unsafe-deserialization | 💼 | | | | | | no-unsafe-regex-construction | CWE-400 | | 7.5 | ESLint security rule documentation for no-unsafe-regex-construction | | ⚠️ | | 💡 | | | no-weak-password-recovery | CWE-640 | | 9.8 | ESLint security rule documentation for no-weak-password-recovery | 💼 | | | | | | no-xpath-injection | CWE-643 | | 9.8 | ESLint security rule documentation for no-xpath-injection | 💼 | | | | | | no-xxe-injection | CWE-611 | | 9.1 | ESLint security rule documentation for no-xxe-injection | 💼 | | | | | | require-backend-authorization | | | | ESLint security rule documentation for require-backend-authorization | | | | | | | require-secure-defaults | CWE-276 | | 7.5 | ESLint security rule documentation for require-secure-defaults | | | | | |
🔗 Related ESLint Plugins
Part of the Interlace ESLint Ecosystem — AI-native security plugins with LLM-optimized error messages:
| Plugin | Downloads | Description |
| :--- | :---: | :--- |
| eslint-plugin-secure-coding | | General security rules & OWASP guidelines. |
|
eslint-plugin-pg | | PostgreSQL security & best practices. |
|
eslint-plugin-crypto | | NodeJS Cryptography security rules. |
|
eslint-plugin-jwt | | JWT security & best practices. |
|
eslint-plugin-browser-security | | Browser-specific security & XSS prevention. |
|
eslint-plugin-express-security | | Express.js security hardening rules. |
|
eslint-plugin-lambda-security | | AWS Lambda security best practices. |
|
eslint-plugin-nestjs-security | | NestJS security rules & patterns. |
|
eslint-plugin-mongodb-security | | MongoDB security best practices. |
|
eslint-plugin-vercel-ai-security | | Vercel AI SDK security hardening. |
|
eslint-plugin-import-next | | Next-gen import sorting & architecture. |
📄 License
MIT © Ofri Peretz
