Rules
All ESLint security rules provided by eslint-plugin-express-security
10 Security Rules
Comprehensive coverage of Express.js security including CORS, CSRF, cookies, and rate limiting.
All Rules
| Rule | 🧠 | 💼 | 🔧 | 💡 | ⚠️ | Docs |
|---|---|---|---|---|---|---|
| no-client-controlled-authorization Disallow authorization decisions taken on request-supplied role, permission or identity values | 🟢 | |||||
| no-cors-credentials-wildcard Disallow credentials: true with wildcard CORS origin (CVE-2024-25124) | 🟢 | |||||
| no-disabled-helmet-protections Disallow disabling helmet security-header defaults: contentSecurityPolicy, frameguard/xFrameOptions, noSniff/xContentTypeOptions, referrerPolicy, hidePoweredBy/xPoweredBy, crossOriginResourcePolicy, crossOriginOpenerPolicy | 🟢 | |||||
| no-error-details-in-response Disallow sending caught error objects, stacks, or spreads of them in HTTP responses | 🟢 | |||||
| no-exposed-debug-endpoints Detect debug endpoints without auth in Express applications | 🟢 | |||||
| no-express-unsafe-regex-route Disallow ReDoS-vulnerable regular expressions in Express.js route patterns | 🟢 | |||||
| no-graphql-introspection-production Disallow GraphQL introspection in production environments | 🟢 | |||||
| no-host-header-in-links Disallow building absolute URLs (reset/verification links) from the Host or X-Forwarded-Host request header | 🟢 | |||||
| no-idor-resource-access Disallow fetching a resource by a request-supplied key in a handler with no principal in scope | 🟢 | |||||
| no-insecure-cookie-options Require secure cookie flags (httpOnly, secure, sameSite) in Express.js | 🟢 | |||||
| no-missing-cors-check Detects missing CORS validation (wildcard CORS, missing origin check) | 🟢 | |||||
| no-missing-csrf-protection Detects missing CSRF token validation in POST/PUT/DELETE requests | 🟢 | |||||
| no-missing-security-headers Detects missing security headers in HTTP responses | 🟢 | |||||
| no-permissive-cors Disallow overly permissive CORS configurations (wildcard origin, origin: true) | 🟢 | |||||
| no-permissive-trust-proxy Disallow unconditional 'trust proxy' — it makes req.ip client-controlled | 🟢 | |||||
| no-sensitive-data-in-query Disallow reading sensitive-named parameters (password, token, secret, ...) from req.query | 🟢 | |||||
| no-static-root-exposure Disallow express.static() roots that expose the application directory and any serve-index usage | 🟢 | |||||
| no-unsafe-csp-directives Disallow Content-Security-Policy directives that permit 'unsafe-inline', 'unsafe-eval', wildcard sources, or unrestricted framing | 🟢 | |||||
| no-user-controlled-redirect Disallow res.redirect() with values directly from req.query / req.body / req.params | 🟢 | |||||
| no-user-controlled-render-locals Disallow res.render() with locals or view names sourced wholesale from req.body / req.query / req.params | 🟢 | |||||
| require-case-insensitive-path-guard Require case-insensitive comparison when guarding protected paths via req.path / req.url / req.originalUrl | 🟢 | |||||
| require-csrf-protection Require CSRF protection middleware for state-changing HTTP methods | 🟢 | |||||
| require-express-body-parser-limits Require size limits on Express.js body parsers to prevent DoS attacks | 🟢 | |||||
| require-helmet Require helmet middleware for security headers in Express.js applications | 🟢 | |||||
| require-query-type-guard Require a type guard or String() coercion before calling string methods on req.query values | 🟢 | |||||
| require-rate-limiting Require rate-limiting middleware in Express.js applications | 🟢 | |||||
| require-route-authentication Require authentication on routes that expose a critical function (account, credential, payment, configuration) | 🟢 | |||||
| require-strict-transport-security Require a Strict-Transport-Security header with a long max-age and includeSubDomains | 🟢 |
Rule Categories
CORS & Headers
Rules enforcing proper CORS configuration and security headers via Helmet.
Cookie Security
Rules detecting insecure cookie options and improper session handling.
Rate Limiting & CSRF
Rules requiring rate limiting and CSRF protection middleware.
API Security
Rules preventing exposed debug endpoints and GraphQL introspection in production.
Building secure JavaScript with Interlace? Star the repo to get new rules and CWE coverage as we ship them — or follow the AI-code-security benchmarks behind them.