AI-Generated Code Security Scanner
Catch the security gaps AI-generated code ships with: placeholder auth, disabled TLS verification, weak crypto, and hardcoded defaults that were never meant to reach production.
Critical4High21Medium10Low2
Critical4 checks
- Hardcoded Credential in Authentication LogicA hardcoded credential comparison was detected in the response body. Patterns like password === 'admin', password === 'password', or token === '12345' indicate placeholder authentication logic that was never replaced with real credential verification.
- JWT 'none' Algorithm AcceptedThe response body contains patterns suggesting JWT tokens with the 'none' algorithm may be accepted, or the JWT library is used without explicit algorithm restriction.
- SQL String Concatenation Pattern DetectedThe response body contains code patterns that construct SQL queries through string concatenation or template literals. This is one of the most common AI-generated vulnerabilities, enabling SQL injection.
- Path Traversal Risk in File OperationsA file system operation was detected using user-controlled input without path sanitization. AI-generated file serving code often constructs file paths directly from URL parameters, enabling directory traversal attacks.
High21 checks
- eval() Usage in Page ScriptsAn eval() call was found inside the page's <script> blocks. eval() executes arbitrary JavaScript strings and is a common AI-generated mistake when dynamically constructing logic.
- SSL Certificate Verification DisabledThe response body contains code patterns that disable SSL/TLS certificate verification (rejectUnauthorized: false, verify=False, InsecureRequestWarning). This is a common AI-generated workaround for TLS errors.
- Math.random() Used for Security TokensMath.random() was found in a context suggesting security token generation (combined with hex encoding or token/id variable names). Math.random() is not cryptographically secure and must not be used for tokens, session IDs, or CSRF values.
- Weak Hashing Algorithm (MD5/SHA-1) DetectedThe response contains code using MD5 or SHA-1 for hashing. These algorithms are cryptographically broken and should not be used for any security purpose including password hashing, token generation, or data integrity.
- Unsafe Deserialization of User InputThe response body contains patterns of deserializing user-controlled data without schema validation (JSON.parse, eval, node-serialize). Unsafe deserialization is a top OWASP vulnerability class.
- Form Missing CSRF ProtectionAn HTML form was found without a CSRF token field. AI-generated form scaffolding commonly omits CSRF protection, assuming the developer will add it later.
- Base64-Encoded Secret Pattern DetectedA Base64-encoded string that decodes to a secret, token, or credential pattern was found in the response. AI-generated code sometimes 'encodes' secrets as Base64 under the mistaken impression that encoding is encryption.
- File Upload Without Type ValidationA file upload handler was detected without content-type or extension validation. AI-generated upload scaffolding frequently accepts all file types without restriction, enabling malicious file upload attacks.
- Server-Side Template Injection RiskA template rendering function was detected being called with unsanitized user input. Server-side template injection (SSTI) allows attackers to execute arbitrary code on the server by injecting template directives.
- Password or Credential Commented Out in SourceA commented-out password, secret, or credential was found in the response body. Developers frequently comment out credentials temporarily and forget to remove them before committing.
- API Endpoint Missing Input ValidationAn API endpoint appears to process request body data without schema validation. AI-generated API handlers commonly skip input validation, trusting that clients will send well-formed data.
- CORS Wildcard Origin in API HandlerA CORS wildcard origin (Access-Control-Allow-Origin: *) was found combined with Access-Control-Allow-Credentials: true, or in code that explicitly sets Allow-Origin to *. AI-generated CORS configs frequently use wildcards to 'fix' preflight errors.
- Debug or Test Endpoint Exposed in ProductionAn internal debug, test, or health-check endpoint was found exposed with diagnostic information. AI-generated applications frequently include /debug, /test, /__health, or /api/debug routes that were never removed before deployment.
- Mass Assignment Vulnerability RiskAn object spread or direct assignment from request body to database model was detected. Mass assignment allows attackers to set unexpected fields (like role, admin, or isVerified) that should not be user-modifiable.
- XSS Risk via innerHTML AssignmentinnerHTML assignment was detected with what may be user-controlled data. Direct innerHTML assignment is a primary XSS vector: AI-generated frontend code frequently uses it to render dynamic content.
- Authentication Endpoint Lacks Rate LimitingA login, password reset, or OTP verification endpoint was found without rate limiting headers or logic. AI-generated authentication scaffolding almost never includes rate limiting by default.
- Prototype Pollution Vulnerability RiskDeep merge or property assignment with user-controlled keys was detected. When user input can set `__proto__`, constructor, or prototype properties, attackers can pollute the JavaScript prototype chain.
- LLM API Called Directly From Client-Side CodeA client-side script calls the OpenAI or Anthropic API directly via fetch(), instead of proxying the request through a backend endpoint.
- Client-Computed Price Sent Directly to Checkout EndpointA checkout/payment/order request sends an amount/total/price field whose value is read directly from a client-side variable rather than being recomputed server-side.
- Auth Check Fails Open on ErrorAn authentication check is wrapped in try/catch, and the catch block only logs the error rather than denying access, letting a thrown/rejected auth check silently succeed.
- Dynamic import() Called With Request-Derived PathA dynamic import() call's module specifier is built from request params, query, or body data.
Medium10 checks
- TODO/FIXME Security Note in ResponseA TODO or FIXME comment referencing security, authentication, authorization, or validation was found in the HTTP response. This indicates unfinished security logic shipped to production.
- Stack Trace Exposed in ResponseA JavaScript or server-side stack trace was found in the HTTP response. AI-generated error handlers frequently pass exception objects directly to the HTTP response, leaking internal file paths, function names, and line numbers.
- Hardcoded HTTP URL in ApplicationA hardcoded http:// URL (non-localhost) was found in the response body, indicating the application may make insecure connections to external services or load resources over plaintext HTTP.
- Sequential/Predictable IDs in API ResponsesAPI responses contain predictable sequential integer IDs for user accounts or resources. This enables IDOR (Insecure Direct Object Reference) enumeration: an attacker can iterate IDs to access any user's data.
- Open Redirect via User-Controlled URLA redirect was detected that may use a user-controlled URL parameter without validation. AI-generated authentication flows frequently implement 'redirect after login' with an unvalidated redirect_to or next parameter.
- String Comparison Vulnerable to Timing AttacksA direct string equality check was found on what appears to be a token, API key, or password comparison. Standard string comparison (===) is not constant-time and leaks information through response timing.
- Cookie Set Client-Side with Overly Broad DomainA page script sets a cookie via document.cookie with a broad leading-dot domain attribute (e.g., domain=.example.com) that shares it across all subdomains. If any subdomain is compromised or allows user content, this exposes the cookie to that subdomain. The equivalent Set-Cookie response header case is covered separately by the cookie-domain-broad check.
- No Password Strength Requirement EnforcedA password registration or reset handler was found without minimum length or complexity requirements. AI-generated user registration accepts any string as a password, including single characters.
- User Input Concatenated Directly Into an LLM PromptRequest-derived data is interpolated directly into an LLM API call's prompt/message content with no visible isolation or sanitization.
- File Upload Validated With filename.includes() Instead of Real Extension CheckAn uploaded file's type is validated with filename.includes('.ext') or filename.indexOf('.ext') rather than checking the actual file extension or MIME type.
Low2 checks
- Generic Error Messages Leak No ContextThe page responds with a generic catch-all error message (e.g., 'An error occurred', 'Something went wrong'). AI-generated code often wraps all exceptions in a single handler that swallows the real error, making debugging impossible and frustrating legitimate users.
- Loose Equality in Authentication CheckA loose equality comparison (== instead of ===) was detected in what appears to be an authentication or authorization check. In JavaScript, loose equality can produce unexpected coercion results that bypass security checks. Note: this pattern is scanned from client-delivered page scripts, where `role == 'admin'` is most often harmless UI-gating (show/hide an element) rather than the actual server-side authorization decision -- treat this as a prompt to check the real backend logic, not confirmation that a bypass exists.
About the AI code checks
- What does the AI code category check?
- Catch the security gaps AI-generated code ships with: placeholder auth, disabled TLS verification, weak crypto, and hardcoded defaults that were never meant to reach production. Placeholder auth, disabled TLS verification, weak crypto: the gaps generated code ships with.
- How many ai code checks are there?
- VulnRadar runs 37 checks in this category, ranging across critical, high, medium, low severity.
- Do I need to install anything to run the ai code checks?
- No. Paste a URL in the browser or call the REST API, and the scan itself runs from our servers against that URL. There is no agent and no appliance to deploy alongside your application. A browser extension exists if you want to scan the page you are looking at, but nothing has to be installed to use this.
Run the ai code checks on your site
VulnRadar runs all 37 of these against a URL in seconds, with the evidence and fix for every finding. No agent to install, just paste a URL.