On this page
- The AI-generated security problem
- The OWASP Top 10: Your security baseline
- Prompt injection and AI-specific attacks: The new attack surface
- Secrets and non-human identities: What the AI leaks
- Software supply chain: The attacks your dependencies ship
- Web application vulnerabilities: The classics your AI ships
- Authentication and access: Who are you and what can you do?
- Testing and scanning: Finding the AI’s mistakes before attackers do
- Broader security concepts
- Checklist
- FAQ
- Related topics
- Sources
InfoSec for Vibecoders: Every Security Concept Your AI-Generated Code Gets Wrong
Your AI coding assistant ships SQL injection, exposed secrets, and broken access control by default. Learn every infosec concept you need to catch these before they hit production. 40+ linked guides.
Quick answer
- AI coding assistants default to vulnerable patterns — they learned from public code, and public code is full of vulns.
- The top three AI-generated security mistakes: SQL injection via string concatenation, hardcoded secrets, and missing access controls.
- Every concept below links to a full guide. Read the ones your AI is generating today, bookmark the rest.
The AI-generated security problem
AI assistants are trained on public repositories — Stack Overflow answers, tutorials that skip auth for brevity, and open-source projects with known CVEs. The model learns “this is how code looks” and reproduces it faithfully, vulnerabilities included. Worse: it’s confident. It will assert that a string-concatenated query is “standard.” It will hardcode an API key and call it “the simplest approach.” It will build an endpoint with no authorization check because nobody asked for one.
Prodogon’s infosec guides start from this reality. Each one explains the vulnerability, how AI assistants introduce it, and the fix you need to apply before merging.
The OWASP Top 10: Your security baseline
The OWASP Top 10 is the industry-standard list of the most critical web application security risks. Your AI has never read it. Start here.
- What Is the OWASP Top 10? — Every entry explained in plain language.
- What Is Broken Access Control (IDOR)? — Your AI builds endpoints; it rarely checks who can call them.
- What Is SQL Injection (and Why Does AI-Generated Code Keep Writing It)? — The #1 AI coding assistant vulnerability.
- What Is CSRF (Cross-Site Request Forgery)? — The attack your framework might or might not block.
- What Are Security Headers (and How Do You Add Them)? — CSP, HSTS, X-Frame-Options — the AI skips them.
Prompt injection and AI-specific attacks: The new attack surface
Prompt injection is the OWASP #1 for LLM applications. If your app uses an LLM anywhere, this is your first read. Then: slopsquatting, agentic AI risks, and the “lethal trifecta.”
- What Is Prompt Injection? — When user input becomes AI instructions. The hardest AI security problem.
- What Is Slopsquatting (AI Package Hallucination Attacks)? — AI models hallucinate package names; attackers register them.
- What Is Agentic AI Security? — When AI agents have tools and autonomy, the attack surface explodes.
- What Is the “Lethal Trifecta” for AI Agents? — Tools + autonomy + internet access = danger.
- What Is MCP (Model Context Protocol) and Why Does It Need Securing? — The protocol connecting AI to tools, and its security risks.
- How to Secure an MCP Server — Hardening the AI-tool connection.
Secrets and non-human identities: What the AI leaks
Your AI will hardcode API keys, paste .env files into prompts, and generate service accounts with no rotation. These guides explain what NHIs are, how secrets leak, and how to fix both.
- What Is a Non-Human Identity (NHI)? — Service accounts, API keys, CI/CD tokens — everything that authenticates without a human.
- What Is the OWASP Non-Human Identity Top 10? — The top risks for machine identities.
- Why Your Frontend API Keys Are Not Secret — Anything in client-side code is public. Period.
- How to Scan Your Codebase for Hardcoded Secrets — Find what your AI left behind.
- How to Find and Remove Secrets From Git History — Once committed, secrets require surgery to remove.
- How to Automate API Key Rotation — Keys should expire. Automate it.
Software supply chain: The attacks your dependencies ship
Your AI adds dependencies freely — npm install, pip install, go get — without checking if they’re safe. Supply chain attacks exploit this. Dependency confusion, SBOMs, and CVE triage are the defense.
- What Is a Software Supply Chain Attack? — Attacks that compromise your dependencies.
- What Is Dependency Confusion (and How Do You Prevent It)? — When a public package shadows your private one.
- What Is a Software Bill of Materials (SBOM)? — The ingredient list for your software.
- How to Generate an SBOM for Your Project — The how-to.
- What Is a CVE? — The vulnerability database your dependencies live in.
- How to Read a CVE and Know If You’re Affected — CVE triage for non-security-engineers.
Web application vulnerabilities: The classics your AI ships
These are the bread-and-butter web vulns that AI assistants reproduce from training data. Path traversal in file downloads, SSRF in URL fetchers, open redirects in login flows — the AI writes them all.
- What Is Path Traversal (Directory Traversal)? — Reading files outside the intended directory using
../. - What Is SSRF (Server-Side Request Forgery)? — Making the server fetch URLs it shouldn’t.
- What Is an Open Redirect (and Why Do Phishers Love It)? — Your login redirect is a phishing tool.
- What Is Clickjacking (and How Do You Prevent It)? — Invisible buttons over your real UI.
- What Is Subdomain Takeover? — Your old DNS records point to services that no longer exist.
- What Is Web Cache Poisoning? — Storing a malicious response in the CDN cache.
- What Is HSTS (and Why Your HTTPS Isn’t Enough)? — Forcing browsers to use HTTPS, always.
- What Is Content Security Policy (CSP)? — The header that blocks XSS.
Authentication and access: Who are you and what can you do?
AI assistants generate login pages but not secure ones. OAuth misconfigurations, JWT mistakes, credential stuffing — the assistant doesn’t know the attack, so it doesn’t defend against it.
- What Is OAuth 2.0? — The delegation protocol behind “Sign in with Google.”
- JWT Security: Common Mistakes That Get Tokens Stolen — Your AI defaults to
alg: none. - What Is Phishing-Resistant MFA? — Passkeys, FIDO2, and why SMS 2FA isn’t enough.
- What Are Passkeys (and Should You Switch)? — The password replacement.
- What Is Credential Stuffing (and How Does It Get Your Accounts)? — Reusing leaked passwords across services.
- How to Store Passwords Correctly (Hashing vs Encryption) — bcrypt, not SHA-256.
Testing and scanning: Finding the AI’s mistakes before attackers do
Your AI writes the code. You need to verify it. SAST scans your source for vulns. Penetration testing simulates an attacker. Broken access control testing checks every endpoint.
- What Is Static Application Security Testing (SAST)? — Scanning source code for vulnerabilities.
- How to Add SAST Scanning to a GitHub Repo — The setup.
- How to Test Your App for Broken Access Control — Verify every endpoint checks auth.
- What Is Penetration Testing (and Do You Need One)? — When to hire someone to break your app.
Broader security concepts
- What Is a Man-in-the-Middle Attack? — Intercepting traffic.
- What Is Ransomware (and How Does It Actually Get In)? — The most expensive threat.
- What Is Zero Trust Architecture? — Never trust, always verify.
- What the Moltbook Breach Teaches About Shipping Vibecoded Apps — A real-world case study.
Where this bites vibecoders
Every vulnerability in this guide has shipped in AI-generated code. The assistant doesn’t know it’s writing vulnerable code — it’s reproducing patterns that were common in its training data. You are the security review layer. The habit: after every AI-generated feature, ask “what could an attacker do with this endpoint?” and scan for the patterns above. Catching these before merge is infinitely cheaper than catching them after a breach.
Checklist
- Read the OWASP Top 10 guide first. It’s the framework everything else hangs on.
- After every AI-generated endpoint, ask: “Is the caller authorized?”
- After every AI-generated query, ask: “Is this parameterized?”
- After every AI-generated config, ask: “Are there secrets in here?”
- After every
pip installornpm install, ask: “Do I know this package?” - Run a SAST scanner in CI — it catches what you miss.
FAQ
Why does AI-generated code have so many security vulnerabilities?
AI models are trained on public code — which includes tutorials, Stack Overflow answers, and open-source projects with known vulnerabilities. The model learns the insecure pattern as “normal” and reproduces it. Training data skews toward “code that works” over “code that’s secure,” so the assistant generates working-but-vulnerable code by default.
What’s the most common AI-generated security mistake?
SQL injection via string concatenation. AI assistants default to building queries with f-strings or template literals instead of parameterized queries. Second: hardcoded secrets (API keys, passwords) in source code. Third: missing access control checks — the AI writes the endpoint but doesn’t verify the caller is authorized.
Where do I start if I know nothing about security?
Start with the OWASP Top 10 guide — it covers the most common and most dangerous vulnerabilities in plain language. Then read the Prompt Injection guide if your app uses an LLM, and the SQL Injection guide because your AI is almost certainly generating vulnerable queries.
Is prompt injection really that big a deal?
Yes. It’s the OWASP #1 for LLM applications, and unlike traditional vulns, there’s no definitive fix — only layers of mitigation. If your app sends user input to an LLM, assume attackers are already trying prompt injection against it.
Related topics
- What Is the OWASP Top 10?
- What Is Prompt Injection?
- What Is SQL Injection (and Why Does AI-Generated Code Keep Writing It)?
- What Is a Non-Human Identity (NHI)?
- What Is a Software Supply Chain Attack?
- What Is Dependency Confusion (and How Do You Prevent It)?
- Why Your Frontend API Keys Are Not Secret