npm / eslint-plugin-security
eslint-plugin-security
What changed in eslint-plugin-security 2 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-24.
2 breaking1 security3 new APIs and options2 behavior and defaults1 tooling9 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initeslint-plugin-security 416 changes
Breaking changes 2
Requires Node.js ^18.18.0 || ^20.9.0 || >=21.1.0.
The recommended config switches to flat configuration.
Security 1
Expands detection to cover non-top-level require() calls and extends detection of non-literal filesystem filenames.
New APIs and options 3
Adds a rule that detects invisible characters.
Adds a rule to detect bidirectional characters.
Adds a legacy recommended configuration.
Behavior and default changes 1
Supports template literals and fixes false positives for static expressions.
Tooling 1
Type definitions are added for TypeScript users of the plugin.
Fixes and other changes 8
Handles all ECMAScript line terminators.
Treats import.meta.dirname as static.
Treats import.meta.filename as static.
Corrects an incorrect method name in the rule.
Improves detection and fixes false positives for destructured exec and spawn; also avoids crashes when exec() has no arguments.
Avoids a crash when eval() is empty.
Fixes false positives for static expressions.
Adds compatibility with ESLint 9 and ESLint 10, including the context.sourceCode API change.
eslint-plugin-security 31 changes
Fixes and other changes 1
Ensures everything works with ESLint v9.
eslint-plugin-security 21 changes
Behavior and default changes 1
The recommended configuration switches to flat config.