No Security Linting
Without security-focused ESLint rules, common vulnerabilities like XSS sinks, dangerouslySetInnerHTML, and eval() usage slip through code review.
How It Works
Standard ESLint catches code style issues. Security linting plugins like eslint-plugin-security and eslint-plugin-no-unsanitized catch patterns known to cause vulnerabilities — before they reach production. Running them in CI makes security checks automatic on every PR.
// BAD: .eslintrc with no security rules
{
"extends": ["eslint:recommended", "next/core-web-vitals"]
// no security plugins — dangerouslySetInnerHTML goes unnoticed
}// GOOD: add security-focused ESLint plugins
{
"extends": ["eslint:recommended", "next/core-web-vitals"],
"plugins": ["security", "no-unsanitized"],
"rules": {
"security/detect-object-injection": "warn",
"security/detect-non-literal-regexp": "warn",
"no-unsanitized/method": "error"
}
}Real-World Example
Shopify's security engineering team published that introducing security linting rules to their CI pipeline caught 40+ security issues per month that would otherwise have reached code review, reducing security review burden significantly.
How to Prevent It
- Add eslint-plugin-security to your ESLint config and enable its recommended rules
- Add eslint-plugin-no-unsanitized to catch unsafe innerHTML assignments in React
- Run ESLint in CI on every PR — don't let security lint failures be optional
- Review the full list of eslint-plugin-security rules and enable the ones relevant to your stack
Affected Technologies
Data Hogo detects this vulnerability automatically.
Scan Your Repo FreeRelated Vulnerabilities
No .env.example File
lowWithout a .env.example file, new contributors don't know what environment variables are required, leading to insecure workarounds like hardcoding values.
No Git Security Hooks
lowWithout pre-commit hooks that scan for secrets and security issues, developers can accidentally push API keys and passwords to the repository.
Inadequate .gitignore
mediumA .gitignore that doesn't cover .env files, build artifacts, and IDE configs can lead to secrets or sensitive data being accidentally committed.
Insecure npm Scripts
mediumnpm scripts that fetch and execute remote code, or that embed secrets as shell arguments, are a supply chain and credential exposure risk.