68 security mistakes AI-generated
code makes, and how to fix them
This is the complete list of what the free scanner checks for in JavaScript, TypeScript and Python, plus Supabase migrations, Firebase rules files, Dockerfiles and compose files. Every rule fires the same way every time, and every one comes with a plain-English explanation and a fix you can paste into your AI tool.
npx @sixthwall/cli initLogins, sessions and access
- criticalPassword Stored or Compared in Plain TextAI-AUTH-005
Passwords are saved or checked as plain text.
- criticalFirebase Rules Open to EveryoneAI-FIRE-001
Your database rules let anyone on the internet read or write your data.
- criticalRow Level Security DisabledAI-SUPA-002
Row-level security is switched off, so any client can read or change every row.
- highMissing Authentication MiddlewareAI-AUTH-001
Express/Hono routes are defined without authentication middleware.
- highJWT Without ExpirationAI-AUTH-003
JWT tokens are created without an expiration time.
- highMCP Server Reachable Over HTTP Without AuthenticationAI-MCP-001
The MCP server listens on the network and accepts tool calls from anyone.
- highNestJS Handler Changes Data Without a GuardAI-NEST-001
A route that changes data does not check that the caller is signed in.
- highJWT Strategy WeakenedAI-NEST-003
The JWT configuration accepts expired tokens or uses a secret written in the code.
- highAPI Route Changes Data Without Checking Who Is AskingAI-NEXT-001
This endpoint accepts writes from anyone, logged in or not.
- highRoute Changes Data Without Checking Who Is AskingAI-PY-AUTH-001
An endpoint that changes data does not check that the caller is signed in.
- highWeak Hashing, Guessable Tokens or Unverified JWTsAI-PY-CRYPTO-001
A password hash, token or JWT check is done with a method that does not protect anything.
- highMCP Server Reachable Over HTTP Without AuthenticationAI-PY-MCP-001
The MCP server listens on the network and accepts tool calls from anyone.
- highPolicy Lets Everyone ThroughAI-SUPA-003
A security policy is written so that it applies to everyone.
- mediumAccess Decided by a Value in the BrowserAI-AUTH-002
Whether a user can see or do something is decided by a value stored in their own browser.
- mediumInsecure Cookie ConfigurationAI-AUTH-004
Authentication cookies are set without security flags.
- mediumJWT Verified Without Pinning the AlgorithmAI-AUTH-006
Token verification does not say which signing algorithm it expects.
- mediumAny Signed-In User Can Access EverythingAI-FIRE-002
Anyone who creates an account can read or change every document under this rule.
- mediumLogin Endpoint Without Rate LimitingAI-NEST-005
Authentication endpoints can be called without limit.
- mediumTable Created Without Row Level SecurityAI-SUPA-004
This migration creates a table but does not turn on row-level security for it.
User input reaching your database or shell
- criticalSQL Query String ConcatenationAI-INJECT-002
SQL queries are built by concatenating user-supplied values directly into the query string.
- criticalUntrusted Data Passed to pickle, yaml.load, eval or execAI-PY-DESER-001
Data that came from outside is decoded with a format that can execute code.
- criticalSQL Built With f-strings, format() or ConcatenationAI-PY-INJECT-001
SQL statements are built by putting values straight into the query text.
- highShell Command Built From VariablesAI-CMD-001
A shell command is put together from variables and handed to a shell.
- highRequest Body Saved Straight to the DatabaseAI-INJECT-001
Everything the client sends is written to the database as-is.
- highRequest Bodies Not Validated or WhitelistedAI-NEST-002
Incoming request bodies are accepted as-is.
- highRequest Object Passed Straight Into a MongoDB QueryAI-NOSQL-001
The whole request is used as the database filter.
- highFile Path Built From the RequestAI-PATH-001
A file is opened using a name the caller controls, so the caller can point it outside the folder you meant.
- highShell Command Built From VariablesAI-PY-CMD-001
A shell command is put together from variables and handed to a shell.
- highFile Path Built From Request DataAI-PY-PATH-001
A file path is built from a name the caller controls.
- highTar Archive Extracted Without a FilterAI-PY-PATH-002
An archive is unpacked without checking where its entries point.
- highXML From the Request Parsed With Entity ExpansionAI-PY-XXE-001
XML supplied by the caller is parsed with a parser that honours external entities.
- mediumRequest Body Accepted Without a DTOAI-NEST-004
A handler takes the raw request body with no declared shape.
Secrets and API keys
- criticalHardcoded API Key or PasswordAI-PY-SECRET-001
A real credential is written into the code as a string.
- criticalHardcoded API Key in Client CodeAI-SECRET-001
An API key or secret is hardcoded directly in your source code.
- criticalSupabase Service Role Key in Browser CodeAI-SUPA-001
The Supabase service_role key is reachable from the browser.
- highSecret Baked Into the ImageAI-IAC-003
A credential is stored in an image layer.
- highSecret Written Into the Compose FileAI-IAC-006
A credential is written directly into docker-compose.
- highSecret Exposed to the BrowserAI-SECRET-002
A secret is being shipped to the browser, where anyone can read it.
- high.env File Not Ignored by GitAI-SECRET-003
Your .env file, which holds real secrets, is not kept out of git.
- mediumSecrets Written to LogsAI-LOG-001
Sensitive values are being written to the logs.
Configuration
- highOverly Permissive CORSAI-CONFIG-001
CORS is configured to allow requests from any origin.
- highWeak Randomness or Hashing for Security ValuesAI-CRYPTO-001
A security value is generated or protected with a method that is easy to predict or reverse.
- highDebug Mode Switched OnAI-PY-CONFIG-001
The application runs with debug mode on.
- mediumMissing Rate LimitingAI-CONFIG-003
Your application has auth routes but no rate limiting.
- mediumVerbose Error Messages in ProductionAI-CONFIG-004
Error handlers return detailed error information (stack traces, internal messages) to the client.
- mediumCSRF Protection Switched OffAI-PY-CONFIG-002
Cross-site request forgery protection is turned off.
- mediumRegular Expression That Can Run ForeverAI-PY-REDOS-001
A regular expression can take exponential time on a crafted input, or is built from input the caller controls.
- mediumRegular Expression That Can Run ForeverAI-REDOS-001
A regular expression can take exponential time on a crafted input, or is built from input the caller controls.
- lowDebug or Development Mode Forced OnAI-CONFIG-002
Debug or development mode is switched on in code, so it stays on in production.
Ports open to the network
Containers and deployment files
- highContainer Given Host-Level AccessAI-IAC-008
A container is allowed to control the host it runs on.
- mediumContainer Runs as RootAI-IAC-001
The image starts its process as root.
- mediumRemote Script Piped Into a ShellAI-IAC-004
The build runs a script straight from the internet.
- mediumWorld-Writable Permissions in the ImageAI-IAC-005
Files in the image are writable by everyone.
- lowBase Image Not PinnedAI-IAC-002
The base image is not pinned to a version.
Your server fetching attacker-chosen URLs
- highServer Fetches a URL Supplied by the CallerAI-PY-SSRF-001
The server will make a request to any address the caller supplies.
- highServer Fetches a URL Supplied by the RequestAI-SSRF-001
The server will make a request to any address the caller supplies.
- mediumImage Optimizer Accepts Any Remote HostAI-NEXT-002
The Next.js image optimizer is allowed to fetch from any host on the internet.