ESLint plugin providing security-focused lint rules for Node.js applications, maintained by eslint-community. Current stable version is 4.0.0 (released 2026-02-19), with a slower release cadence of major versions every ~2 years. Key differentiators: it identifies potential security hotspots like eval() with expressions, unsafe Buffer usage, and child_process exec() calls; integrates as a recommended flat config for ESLint 9+; replaced the legacy eslintrc config with flat config (breaking change), and has dropped support for older Node versions. Currently in active development.
npm install eslint-plugin-securityVerified import paths — ran on the pinned version, not inferred.
Shows how to set up eslint-plugin-security v4 with flat config in eslint.config.js, both using recommended config and custom rules.
Use pluginSecurity.configs.recommended in a flat config file. For eslintrc, use 'extends: plugin:security/recommended-legacy'.
Upgrade Node.js to a supported version (18.18+, 20.9+, or 21.1+).
Do not rely solely on this plugin; combine with manual review and other security tools.
Migrate to flat config using pluginSecurity.configs.recommended, or use recommended-legacy config.
Switch to flat config: use pluginSecurity.configs.recommended or install v3 (but prefer migrating).
Use import pluginSecurity from 'eslint-plugin-security' (default import) or require().
Manually inspect the flagged code; if it's safe, add an eslint-disable comment with explanation.
No dependency data recorded yet.