sugarforever/next.js security scan
Comprehensive security vulnerability scanner for Next.js and TypeScript/JavaScript projects. Detects OWASP Top 10 vulnerabilities, XSS, injection flaws, authentication issues, hardcoded secrets, and Next.js-specific security problems. Audits dependencies for known CVEs and generates actionable security reports.
npx skills add https://github.com/sugarforever/01coder-agent-skills --skill Next.js Security Scan
This skill enables comprehensive security scanning of Next.js and TypeScript/JavaScript projects based on OWASP guidelines and industry best practices.
Fast scan focusing on critical vulnerabilities:
dangerouslySetInnerHTML, eval)Comprehensive security assessment covering:
Focus on specific vulnerability categories:
--xss - Cross-site scripting patterns--injection - SQL/NoSQL/Command injection--auth - Authentication/authorization issues--secrets - Hardcoded credentials--deps - Dependency vulnerabilities--nextjs - Next.js specific issuesnext.config.js, package.json, .env*)Run the dependency audit script:
./scripts/dependency-audit.sh
Or manually:
npm audit --json
# or
yarn audit --json
Scan for hardcoded secrets:
python scripts/secret-scanner.py /path/to/project
Important: Environment File Handling
.env files are SKIPPED (.env, .env.local, .env.production, etc.).env.example and .env.template files are analyzed for documentation quality--include-env-files flag only if explicitly requested by userThe scanner will:
.env.example templates to check:For each file in the codebase, check against patterns in:
references/xss-patterns.md - XSS vulnerabilitiesreferences/injection-patterns.md - Injection flawsreferences/auth-vulnerabilities.md - Auth issuesreferences/nextjs-specific.md - Next.js vulnerabilitiesGenerate a security report using:
assets/report-template.md - Report structure| Severity | Description | Action Required |
|----------|-------------|-----------------|
| CRITICAL | Exploitable vulnerability with severe impact | Immediate fix required |
| HIGH | Significant security risk | Fix before deployment |
| MEDIUM | Potential security issue | Fix in next release |
| LOW | Minor security concern | Consider fixing |
| INFO | Security best practice suggestion | Optional improvement |
/*.ts, /*.tsx, /*.js, /*.jsx - Source codenext.config.js, next.config.mjs - Next.js configurationpackage.json, package-lock.json - Dependenciesmiddleware.ts, middleware.js - Middleware security.env.example, .env.template - SCAN for template analysis.env, .env.local, .env.production - SKIP by default (contain real secrets)Note: Real .env files should never be committed to version control. The scanner analyzes .env.example templates to ensure proper documentation of required variables.
app/api/**/* - API routes (App Router)pages/api/**/* - API routes (Pages Router)/actions.ts, /*-actions.ts - Server Actionslib/auth*, utils/auth* - Authentication code**/middleware.* - Middleware filesFindings should be reported as:
[SEVERITY] Category: Description
File: path/to/file.ts:lineNumber
Code: <relevant code snippet>
Risk: <explanation of the security risk>
Fix: <recommended remediation>
This skill can generate output compatible with:
Load additional context as needed:
references/owasp-top-10.md - OWASP Top 10:2025 quick referencereferences/xss-patterns.md - XSS detection patternsreferences/injection-patterns.md - Injection vulnerability patternsreferences/auth-vulnerabilities.md - Authentication security patternsreferences/nextjs-specific.md - Next.js specific vulnerabilities and CVEsTake sugarforever/next.js security scan from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.