Vibecoding Patterns

Security mistakes commonly found in AI-generated code from tools like Cursor, Copilot, and Claude. The code works, but it's often insecure.

10 vulnerabilities

Hardcoded API Keys

critical

API keys, tokens, or secrets written directly in source code, making them visible to anyone with repo access — including public GitHub repositories.

CWE-798A02:2021

No Input Validation

medium

User-supplied data sent directly to databases or external APIs without any type, format, or content validation.

CWE-20A03:2021

Passwords Stored in Plaintext

critical

User passwords stored as raw strings in the database instead of being hashed with a proper algorithm like bcrypt or Argon2.

CWE-256A02:2021

JWT Without Expiration

high

JWTs signed without an `exp` claim that never expire, meaning a stolen token grants permanent access with no way to revoke it.

CWE-613A07:2021

Auth Logic in Frontend Only

high

Showing or hiding UI elements based on user role in React, without any server-side enforcement — easily bypassed by anyone who opens DevTools.

CWE-602A01:2021

Endpoints Without Authentication

high

API routes that perform sensitive operations — reading user data, modifying records, deleting resources — with no session or token verification.

CWE-306A01:2021

Verbose Error Messages

medium

Detailed error messages, stack traces, or internal paths sent to the client or logged publicly, giving attackers a map of your application internals.

CWE-209A05:2021

Outdated Dependencies with Known CVEs

medium

npm packages or other dependencies with published security vulnerabilities (CVEs) that haven't been updated, leaving known attack vectors open in your app.

CWE-1104A06:2021

eval() with User Input

critical

Passing user-controlled data to eval(), new Function(), or similar dynamic code execution functions, enabling arbitrary code execution on your server.

CWE-94A03:2021

Secrets in Committed .env Files

critical

A .env file containing real credentials committed to git, making all secrets permanently accessible to anyone with repo access — including through git history.

CWE-540A02:2021