oxlint-plugin-secure-coding
v6.1.1
Published
Oxlint security rules for secure coding — detects LDAP, XPath, XXE, GraphQL and template injection, unsafe deserialization, ReDoS, missing authentication, and PII in logs. Same rules and rule IDs as eslint-plugin-secure-coding, for oxlint and Vite+.
Maintainers
Keywords
Readme
⭐ If this plugin caught a real bug for you, star the repo — it's the signal that keeps these rules maintained.
Description
oxlint-plugin-secure-coding is the oxlint and Vite+ name for eslint-plugin-secure-coding. It carries the same rules under the same IDs (secure-coding/<rule>), always at the same version, because it re-exports that package rather than copying it. Installing it does not install ESLint.
Covered natively by oxlint
None of these 35 rules has an oxlint built-in equivalent. Every rule here is new to oxlint.
- Why — a linter nobody reads protects nothing. We would rather miss a finding than spend your attention on one that was never real.
- How — evidence, not names. A rule fires on what the code does, resolved through the AST and ESLint's own scope analysis.
- What — every finding carries its fix, in prose for a human and as structured JSON for an agent. Security rules add a CWE mapping and, where assigned, a CVSS score.
That trade costs recall, and we measure it: methodology · results · a false positive is a bug.
Getting Started
npm install oxlint-plugin-secure-coding --save-devVite+
// vite.config.ts
import { defineConfig } from 'vite-plus';
export default defineConfig({
lint: {
jsPlugins: ['oxlint-plugin-secure-coding'],
rules: {
'secure-coding/no-fail-open-auth': 'error',
'secure-coding/no-hardcoded-credentials': 'error',
'secure-coding/no-homoglyph-identifiers': 'error',
'secure-coding/no-improper-sanitization': 'error',
'secure-coding/no-ldap-injection': 'error',
'secure-coding/no-log-injection': 'error',
'secure-coding/no-redos-vulnerable-regex': 'error',
'secure-coding/no-sql-injection': 'error',
'secure-coding/no-template-injection': 'error',
'secure-coding/no-unsafe-regex-construction': 'error',
'secure-coding/no-xpath-injection': 'error',
'secure-coding/no-xxe-injection': 'error',
},
},
});oxlint
{
"jsPlugins": ["oxlint-plugin-secure-coding"],
"rules": {
"secure-coding/no-fail-open-auth": "error",
"secure-coding/no-hardcoded-credentials": "error",
"secure-coding/no-homoglyph-identifiers": "error",
"secure-coding/no-improper-sanitization": "error",
"secure-coding/no-ldap-injection": "error",
"secure-coding/no-log-injection": "error",
"secure-coding/no-redos-vulnerable-regex": "error",
"secure-coding/no-sql-injection": "error",
"secure-coding/no-template-injection": "error",
"secure-coding/no-unsafe-regex-construction": "error",
"secure-coding/no-xpath-injection": "error",
"secure-coding/no-xxe-injection": "error"
}
}These are the rules the plugin recommends (💼 in the table below).
ESLint
Install eslint-plugin-secure-coding instead. It has the same rules, plus presets for ESLint's flat config.
📦 Compatibility
| Package | Version |
| :------ | :--------------------------------------------------------------- |
| oxlint | verified on 1.90.0: CI loads every rule ID through jsPlugins |
| Vite+ | lint.jsPlugins in vite.config.ts |
| Node.js | >=22.13.0 |
Rules
Legend
| Icon | Description |
| :--: | :------------------------------------------------------------------------ |
| 💼 | Recommended: Included in the recommended preset. |
| ⚠️ | Warns: Set to warn in recommended preset. |
| 🔧 | Auto-fixable: Automatically fixable by the --fix CLI option. |
| 💡 | Suggestions: Providing code suggestions in IDE. |
| 🚫 | Deprecated: This rule is deprecated. |
| 🟢 | Type-unaware: AST-only, runs in oxlint JS-plugin tier. |
| 🟡 | Type-aware (refining): pure-AST primary path; types refine precision. |
| 🟠 | Type-aware (graceful): requires TS program; silent without it. |
| Rule | CWE | OWASP | CVSS | Description | 🧠 | 💼 | ⚠️ | 🔧 | 💡 | 🚫 |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------: | :------: | :--: | :---------------------------------------------------------------------------------------------------------------------- | :-: | :-: | :-: | :-: | :-: | :-: |
| detect-non-literal-regexp | CWE-400 | | | Detects RegExp(variable), which might allow an attacker to DOS your server with a long-running regular expr… | 🟢 | | | | | |
| detect-object-injection | CWE-915 | | | Detects variable[key] written as an assignment target, or read and then invoked (prototype pollution, method injection) | 🟡 | | | | | |
| detect-weak-password-validation | CWE-521 | A07:2021 | | Detects weak password length requirements (less than 8 characters) in validation code. | 🟢 | | | | | |
| no-bidi-characters | CWE-1007 | | | Disallows Unicode bidirectional control characters, which let source render differently than it compiles (T… | 🟢 | | | | | |
| no-directive-injection | CWE-94 | | | Detects directive injection vulnerabilities in template systems | 🟢 | | | | | |
| no-disabled-template-escaping | CWE-79 | A03:2021 | | Disallows assigning false to escapeMarkup, which disables template HTML auto-escaping (CWE-79) | 🟢 | | | | | |
| no-electron-security-issues | CWE-16 | | | Detects Electron security vulnerabilities and insecure configurations | 🟢 | | | | | |
| no-fail-open-auth | CWE-636 | A10:2025 | | Detects authentication and authorization checks whose catch block fails open | 🟢 | 💼 | | | | |
| no-format-string-injection | CWE-134 | | | Detects format string injection vulnerabilities | 🟢 | | | | | |
| no-graphql-injection | CWE-943 | | | Detects GraphQL injection vulnerabilities and DoS attacks | 🟢 | | ⚠️ | | | |
| no-hardcoded-credentials | CWE-798 | | | Detects hardcoded passwords, API keys, tokens, and other sensitive credentials in source code | 🟢 | 💼 | | | | |
| no-hardcoded-session-tokens | CWE-798 | | | This rule detects hardcoded JWT tokens (starting with eyJ), Bearer tokens, and session identifiers | 🟢 | | | | | |
| no-homoglyph-identifiers | CWE-1007 | A08:2021 | | Detects homoglyph identifiers and invisible characters that hide what the code actually does | 🟢 | 💼 | | | | |
| no-improper-sanitization | CWE-116 | | | Detects improper sanitization of user input | 🟢 | 💼 | | | | |
| no-improper-type-validation | CWE-1287 | | | Detects improper type validation in user input handling | 🟢 | | | | | |
| no-insecure-comparison | CWE-697 | | | Detects insecure comparison operators (==, !=) that can lead to type coercion vulnerabilities | 🟢 | | | | | |
| no-invisible-characters | CWE-1007 | A08:2021 | | Disallows invisible letters such as the Hangul fillers (U+3164, U+FFA0), which hide identifiers, values and… | 🟢 | | | | | |
| no-ldap-injection | CWE-90 | | | Detects LDAP injection vulnerabilities | 🟢 | 💼 | | | | |
| no-log-injection | CWE-117 | A09:2021 | | Detects request data concatenated into a log message, which lets an attacker forge log records | 🟢 | 💼 | | | | |
| no-missing-authentication | CWE-287 | | | CWE: CWE-287 | 🟢 | | | | | |
| no-pii-in-logs | CWE-359 | | | Prevent personally identifiable information (PII) — emails, SSNs, credit cards, phone numbers — from reachi… | 🟢 | | | | 💡 | |
| no-privilege-escalation | CWE-269 | | | Detects potential privilege escalation vulnerabilities where user input is used to assign roles or permissi… | 🟢 | | ⚠️ | | | |
| no-redos-vulnerable-regex | CWE-400 | | | ESLint Rule: no-redos-vulnerable-regex | 🟢 | 💼 | | | | |
| no-sensitive-data-exposure | CWE-532 | | | ESLint Rule: no-sensitive-data-exposure | 🟢 | | ⚠️ | | | |
| no-sql-injection | CWE-89 | A03:2021 | | Detects SQL statements built from attacker-controlled input in files that import no SQL driver | 🟢 | 💼 | | | | |
| no-template-injection | CWE-94 | A03:2021 | | Disallow dynamic strings as template arguments to server-side template engines (CWE-94) | 🟢 | 💼 | | | | |
| no-unchecked-loop-condition | CWE-400 | | | Detects unchecked loop conditions that could cause DoS | 🟢 | | | | | |
| no-unlimited-resource-allocation | CWE-770 | | | Detects unlimited resource allocation that could cause DoS | 🟢 | | ⚠️ | | | |
| no-unsafe-deserialization | CWE-502 | | | Detects unsafe deserialization of untrusted data | 🟢 | | ⚠️ | | | |
| no-unsafe-regex-construction | CWE-400 | | | ESLint Rule: no-unsafe-regex-construction with LLM-optimized suggestions and auto-fix capabilities | 🟢 | 💼 | | | | |
| no-weak-password-recovery | CWE-640 | | | ESLint Rule: no-weak-password-recovery with LLM-optimized suggestions and auto-fix capabilities | 🟢 | | ⚠️ | | | |
| no-xpath-injection | CWE-643 | | | Detects XPath injection vulnerabilities | 🟢 | 💼 | | | | |
| no-xxe-injection | CWE-611 | | | Detects XML External Entity (XXE) injection vulnerabilities | 🟢 | 💼 | | | | |
| require-backend-authorization | CWE-602 | | | CWE: CWE-602 | 🟢 | | | | | |
| require-secure-defaults | CWE-1188 | | | CWE: CWE-1188 | 🟢 | | | | | |
🔗 Related ESLint Plugins
Part of the Interlace ESLint ecosystem — AI-native rules with LLM-optimized error messages:
Security
| Plugin | Downloads | Description |
| :----------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------- |
| eslint-plugin-anthropic-security | | Anthropic SDK security. |
|
eslint-plugin-browser-security | | XSS, DOM security. |
|
eslint-plugin-drizzle-security | | Drizzle security. |
|
eslint-plugin-express-security | | Express middleware hardening. |
|
eslint-plugin-gemini-security | | Google Gemini SDK security. |
|
eslint-plugin-jwt-security | | Token security. |
|
eslint-plugin-knex-security | | Knex security. |
|
eslint-plugin-lambda-security | | AWS Lambda hardening. |
|
eslint-plugin-mcp-sdk-security | | MCP SDK security. |
|
eslint-plugin-mongodb-security | | MongoDB injection. |
|
eslint-plugin-mysql-security | | MySQL security. |
|
eslint-plugin-nestjs-security | | NestJS framework hardening. |
|
eslint-plugin-node-security | | Server-side patterns. |
|
eslint-plugin-openai-security | | OpenAI SDK security. |
|
eslint-plugin-postgresql-security | | PostgreSQL security. |
|
eslint-plugin-prisma-security | | Prisma security. |
|
eslint-plugin-secure-coding | | Injection prevention. |
|
eslint-plugin-sequelize-security | | Sequelize ORM security. |
|
eslint-plugin-sqlite-security | | SQLite security. |
|
eslint-plugin-supabase-security | | Supabase security. |
|
eslint-plugin-typeorm-security | | TypeORM security. |
|
eslint-plugin-vercel-ai-security | | AI SDK security. |
Code quality
| Plugin | Downloads | Description |
| :--------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------- |
| eslint-plugin-conventions | | Team-specific habits and styles. |
|
eslint-plugin-import-next | | Fast cycle + import-graph analysis. |
|
eslint-plugin-maintainability | | Cognitive load and clean-code patterns. |
|
eslint-plugin-modernization | | ESNext migration + syntax evolution. |
|
eslint-plugin-modularity | | Structural integrity and DDD patterns. |
|
eslint-plugin-operability | | Production readiness and resource health. |
|
eslint-plugin-react-a11y | | React accessibility / WCAG. |
|
eslint-plugin-react-features | | React best practices and optimization. |
|
eslint-plugin-reliability | | Runtime stability and error safety. |
⭐ Support & follow
If this plugin caught a real bug for you, star the repo — stars are the signal that keeps the Interlace ESLint ecosystem maintained — and follow the writeups on Dev.to for the benchmarks and security research behind these rules.
📄 License
MIT © Ofri Peretz
