AI-powered code editor
Cursor uses AI to autocomplete and generate code within your existing projects. Since it operates at the code level rather than the infrastructure level, vulnerabilities tend to be subtle — logic flaws, unsafe deserialization, and missed edge cases in auth flows.
AI-generated code sometimes uses eval() or Function() constructors with user input.
Never use eval() with untrusted input. Use JSON.parse() for data and proper template engines for rendering.
Cursor may generate raw SQL queries with string interpolation instead of parameterized queries.
Always use parameterized queries or an ORM. Never concatenate user input into SQL strings.
Generated API handlers often skip auth middleware or token validation.
Add authentication middleware to every protected API route. Verify tokens server-side.
AI may suggest outdated or vulnerable npm packages.
Run npm audit after every AI-assisted coding session. Pin dependency versions.
Generated server configs often set Access-Control-Allow-Origin to wildcard.
Restrict CORS to your specific frontend domains.
After each AI generation, review the diff carefully — don't blindly accept suggestions.
Use Cursor's @codebase feature to give the AI full context, reducing hallucinated imports.
Run Erzo's Secret Scanner on your codebase before every commit.