---
name: "eslint-security-rules-hardening"
description: "Harden JavaScript and TypeScript codebases against prototype pollution and injection."
metadata:
  author: "Node Security"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "configure eslint-plugin-security"
  - "prevent prototype pollution eslint"
  - "detect redos regex eslint"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# ESLint Security Rules & AST Taint Hardening

Configures eslint-plugin-security and typescript-eslint: detecting eval(), prototype pollution, unsafe regular expressions (ReDoS), child_process execution, and DOM XSS sinks.

## When to Invoke
Invoke this skill whenever you need to:
- configure eslint-plugin-security
- prevent prototype pollution eslint
- detect redos regex eslint

## Execution SOP & Rules
1. Add plugin:security/recommended to the extends array in ESLint configuration.
2. Prevent prototype pollution by validating object keys against Object.hasOwn() before assignment.
3. Audit regular expressions for nested quantifiers ((a+)+) that cause ReDoS CPU spikes.
4. Forbid dynamic code execution via eval() or new Function().

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
