reference
Guides
In-depth, plain-language explainers on AI-generated code security — the vulnerability patterns LLMs repeat, supply-chain attacks, secret hygiene, and what scanners can and can't find. Written by the Vibe-Code Audit team.
7 Security Mistakes AI Coders Keep Making
AI code generators repeat the same flaws: SQL injection, XSS, hardcoded secrets, missing auth checks. Learn the patterns and how to catch them before you ship.
read the guide → 2026-10-11Supply-Chain Attacks in the AI-Coding Era
AI assistants hallucinate package names that attackers register. How slopsquatting, typosquatting and dependency confusion work—and how to defend your builds.
read the guide → 2026-10-11Secret Hygiene Before Release: Stop API Key Leaks
API keys leak via client-side code, git history, chat logs and AI prompts. This pre-release secret scan finds them before you ship — and shows how to rotate safely.
read the guide → 2026-10-11What Code Scanners Can't Find
Scanners catch known patterns fast, but logic bugs and novel attacks need human eyes. An honest guide to the limits of automated security scanning.
read the guide → 2026-11-14What Happens When Your .env File Is Publicly Exposed?
An exposed .env file hands attackers your database password, API keys and session secrets in one request. How the leak happens in AI-built apps, what attackers do in the first hour, and the exact recovery order.
read the guide → 2026-11-14How an Exposed .git Folder Lets Attackers Download Your Source Code
When /.git is reachable, attackers reconstruct your entire repository — source, history and the secrets buried in old commits. How the reconstruction works and how to close it for good.
read the guide → 2026-11-14Which Security Headers Is Your Website Missing — and What Does Each One Actually Do?
Content-Security-Policy, HSTS, X-Frame-Options, X-Content-Type-Options and Referrer-Policy explained in plain language: what attack each one blunts, what breaks if you set it wrong, and a safe order to add them.
read the guide → 2026-11-14Why Your Supabase Service Role Key Must Never Appear in Frontend Code
The Supabase service role key bypasses Row Level Security entirely. AI-generated apps keep shipping it in browser bundles — here is how to tell the two keys apart, test whether yours leaked, and recover safely.
read the guide → 2026-11-14What to Do in the First Hour After an OpenAI API Key Leaks From Your App
A leaked OpenAI key is spent by strangers within hours — on your bill. The first-hour playbook: revoke, replace, set hard limits, find the leak path (bundle, repo or logs), and prove the new key cannot leak the same way.
read the guide → 2026-11-14Stripe Secret Key in Client-Side Code: How Bad Is It, Exactly?
Stripe's publishable key is meant for browsers; the secret key is your business in a string — payments, refunds, customer data. How AI-generated checkout code mixes them up, how to test yours, and the recovery sequence.
read the guide → 2026-11-14How to Fix SQL Injection in AI-Generated Code (Not Just Detect It)
A remediation guide for the string-built query: converting f-string, concatenation and %-formatted SQL to parameterized queries in Python, Node and PHP, proving the fix with the attack string, and finding the copies the first fix missed.
read the guide → 2026-11-14NoSQL Injection: How a MongoDB Login Falls to a Single $ne Operator
Sending {"$ne": null} as a password is not a trick — it is your login working as written. Why JSON body parsing turns request data into query operators, and the casting discipline that stops operator injection in Node and Python apps.
read the guide → 2026-11-14SSRF in AI-Generated Code: When Your App Fetches Any URL a User Gives It
Link previews, image importers and PDF fetchers that take a user URL are server-side request forgery waiting to happen — including the cloud metadata endpoint. The allow-list, IP-blocking and redirect rules that fix it.
read the guide → 2026-11-14Server-Side Template Injection in Flask Apps Built With AI
render_template_string with user input turns a greeting into remote code execution via Jinja2's object graph. How AI-generated Flask code falls into SSTI, how to prove it with {{7*7}}, and the static-template fix.
read the guide → 2026-11-14Why pickle.loads and yaml.load Turn User Data Into Code Execution
Python pickle, unsafe YAML, PHP unserialize and Java readObject all share one design flaw: the data describes how to build objects, so crafted data runs code. Where AI-generated code reaches for them, and the JSON-shaped exit.
read the guide → 2026-11-14JWT alg=none and Key Confusion: How Attackers Forge Any User's Token
Accepting the 'none' algorithm, verifying RS256 tokens with an HMAC secret, or trusting kid/jku headers turns your JWT library into a login-as-anyone machine. The four confusion attacks and the pinned-algorithm fix.
read the guide → 2026-11-14How to Fix CORS Errors Without Opening Your API to Every Website
Access-Control-Allow-Origin: * and origin-reflection both silence the browser error by removing the protection. Why generated code reaches for them, what credentialed CORS actually risks, and the allow-list pattern that ends the error properly.
read the guide → 2026-11-14Debug Mode in Production: What One Stack Trace Hands an Attacker
DEBUG=True, framework debug consoles and verbose error pages leak paths, library versions, environment values and sometimes a remote console. The generated-code pathways that ship debug to production and the layered fix.
read the guide → 2026-11-14Why AI-Generated Login and API Endpoints Ship Without Rate Limits
Generated auth code almost never throttles attempts, so credential stuffing and password spraying run at machine speed against your users. Where limits belong, what numbers to start with, and how GraphQL batching quietly multiplies the problem.
read the guide → 2026-11-14GraphQL Introspection and Batching: The Two Settings AI Starters Leave On
Introspection hands attackers your entire schema as a map; batching turns one request into a hundred operations. Why generated GraphQL servers ship both, when each is acceptable, and the production configuration that closes them.
read the guide → 2026-11-14Prototype Pollution in JavaScript: How One JSON Body Poisons Every Object
Merging user JSON with keys like __proto__ mutates Object.prototype itself, flipping defaults across the whole process — including, in real cases, authorization checks. The merge patterns AI generates, the key-blocking fix, and a 60-second test.
read the guide → 2026-11-14Path Traversal: How a Download Endpoint Serves Files It Never Meant to Share
../ is three characters that turn a file-download feature into a read-anything primitive — source code, .env, /etc/passwd. The resolve-and-verify fix, encoding tricks that beat naive filters, and the allow-list design that ends the class.
read the guide → 2026-11-14Command Injection: shell=True, os.system and child_process.exec in Generated Code
Any code path where user text reaches a shell is remote code execution with extra steps — and AI generators build image converters, PDF tools and exporters on shell strings constantly. The argument-array fix and the allow-list rule.
read the guide → 2026-11-14Mass Assignment: How Passing req.body to Your Model Lets Users Promote Themselves
User.create(req.body) and Model(**request.json) apply every field the client sends — including isAdmin, role, balance and verified. Why AI code loves the shortcut, the allow-list fix, and the fields attackers probe first.
read the guide → 2026-11-14Open Redirects: How Your Real Domain Becomes Someone Else's Phishing Link
A ?next= parameter that accepts any URL lets attackers send victims to your trusted domain — which then forwards them to a credential-harvesting clone. The relative-path fix and the allow-list exceptions that are actually legitimate.
read the guide → 2026-11-14Prompt-Injection Sinks: The Exact Code Shapes That Let Text Become Instructions
Prompt injection is a code pattern before it is a model failure: user text, fetched pages and tool outputs concatenated into system prompts. The sink shapes VibeAudit detects, the delimitation and privilege fixes, and what 'resistant' honestly means.
read the guide → 2026-11-14When LLM Output Is Rendered as HTML: The Stored XSS Nobody Escaped
Chatbots that render model text with innerHTML or a markdown pipeline hand the model — and anyone who can influence it — a script-injection channel into every viewer's browser. The rendering rules that keep AI features from becoming XSS dispensers.
read the guide → 2026-11-14RAG Poisoning: How One Planted Document Rewrites Your Chatbot's Answers
Retrieval-augmented chatbots trust the documents they retrieve. An attacker who can add or edit one — a support article, a web page, an uploaded file — inherits the bot's voice. Ingestion controls, metadata discipline and the access checks RAG skips.
read the guide → 2026-11-14Production Source Maps: You Are Probably Shipping Your Original Source Code
A .map file reconstructs your un-minified source — comments, variable names, internal URLs and occasionally secrets — for anyone who asks. How to check in ten seconds, why builds enable maps by default, and the private-upload alternative.
read the guide → 2026-11-14Secrets in Dockerfiles: Why ARG and ENV Bake Keys Into Your Image Forever
A secret passed as a Docker build ARG or set with ENV lives in the image's layer history, readable by anyone who can pull the image — deleting it in a later layer does not remove it. Multi-stage builds, BuildKit secrets and the recovery for published images.
read the guide → 2026-11-14Race Conditions in Checkout and Balance Code: The Double-Spend Your Tests Never Catch
Read-balance-then-write logic passes every sequential test and fails under two simultaneous requests: double-spends, double-redemptions, negative balances. The TOCTOU pattern in AI-generated commerce code and the atomic-operation fixes.
read the guide → 2026-11-14Web Cache Poisoning and Deception: Making Your CDN Serve the Attack to Everyone
When a cache stores a response shaped by an unkeyed input — a forwarded host, a stray header — one attacker's request becomes every visitor's page. Cache deception tricks caches into storing private pages. The key discipline and header hygiene that prevent both.
read the guide → 2026-11-14DOM Clobbering: How a Form Field Named 'config' Silently Replaces Your JavaScript Objects
Browsers expose named form elements as properties of window and document — so user-influenced markup with id='config' or name='apiUrl' can shadow the globals your code trusts. The collision mechanics and the defensive coding patterns.
read the guide → 2026-11-14Math.random() Is Not a Token Generator: Weak Randomness in Reset Links and Session IDs
Tokens built from Math.random or Python's random module are predictable — the generator's state can be recovered from a few outputs, and every reset link and invite code built on it falls. Where AI code reaches for the wrong random, and the CSPRNG replacements by language.
read the guide → 2026-11-14Session Cookies Without HttpOnly, Secure and SameSite: What Each Missing Flag Costs You
Three flags decide whether a session cookie can be stolen by script, sniffed on the network, or sent along on cross-site forgeries. The scanner checks each flag separately — here is the attack each one prevents and the settings that work for modern apps.
read the guide → 2026-11-14Second-Order Injection: The Payload That Waits in Your Database Until It Reaches a Sink
First-order scanners watch input arrive; second-order injection stores the payload — a display name, an imported record, an AI summary — and detonates it later in an admin panel, an export or a different query. Why input validation alone misses it, and the output-side discipline that catches it.
read the guide →These guides are informational explainers, not security guarantees. Scan your own code before every deploy.