TL;DR
You built something real with AI, and the same tools that let you ship that fast also left blind spots behind. When Veracode gave 100+ AI models 80 coding tasks that each had a secure and an insecure way to solve them, the models chose the insecure way 45% of the time. Most of what that leaves in a real app is fixable in an afternoon once you know where to look.
You've shipped. Maybe it's an MVP, maybe it's already got users. Either way you built something functional with Cursor, Bolt, Lovable or another AI tool, and that's a real achievement.
Then comes the part nobody mentions in the vibe coding pitch: all of that generated code is now running your business.
45% of coding tasks came back with a security flaw in Veracode's 2025 GenAI Code Security Report (published July 30, 2025). Cross-site scripting went unblocked in 86% of cases, Java failed more than 70% of the time, and bigger models did no better than small ones.
Read that number carefully. It's a rate over curated test tasks built around known weakness types, not a measurement of every line an AI has ever written, so "45% of AI code is broken" overstates it. What it does show is a habit: given a choice, the model reaches for the insecure pattern nearly half the time, and it hasn't improved as models got larger. That's the useful starting point for checking your own codebase.
Why AI-Generated Code Has Security Gaps
AI coding tools are optimized to hand you working code fast. Security is a secondary concern, when it's a concern at all. Four reasons vulnerabilities slip through:
The training data includes insecure patterns
AI models learn from millions of public repositories, and plenty of those repositories are full of deprecated methods and outright security flaws. The model has no way to tell "this works" apart from "this is safe." It gives you something that runs.
Functionality wins over safety
Ask for a login form and you'll get one that works. Whether it hashes passwords properly is a coin flip, and rate limiting almost never appears unless you name it. The AI solved the problem you asked about. It has no opinion about the problems you didn't know to ask about.
Context is missing
The AI doesn't know whether you're building a weekend side project or handling medical records, and it has never heard of your compliance requirements. So it reaches for generic patterns that can be wildly wrong for what you're actually doing.
Speed creates blind spots
When you can ship in an afternoon instead of a quarter, a security review feels like pure friction. "I'll fix it later" becomes the default answer. Later never arrives, and by then there are real users on a system nobody ever secured.
The Vulnerabilities You Probably Have
These are the issues that come up again and again when we scan apps built with Cursor, Bolt, Lovable and friends. Each row links to the page that walks through the fix:
| Issue | How Common | Why It Matters | Fix |
|---|---|---|---|
| Exposed API keys in frontend code | Very Common | Anyone can view source and steal your keys. Leads to financial loss and data breaches. | Hide API keys |
| Missing Row Level Security (RLS) | Very Common | Users can access other users' data. One API call exposes your entire database. | Add RLS to Supabase |
| Weak authentication | Common | Account takeovers, unauthorized access, impersonation attacks. | Broken authentication |
| Missing security headers | Very Common | Opens doors to XSS, clickjacking, and other browser-based attacks. | Add security headers |
| Exposed .env files | Occasional | Complete system compromise. All your secrets in one discoverable file. | Keep secrets out of git |
| No HTTPS enforcement | Occasional | Data interception, session hijacking, credential theft. | Set up HTTPS |
Look at what that list is made of. No zero-days, no exotic exploit chains, nothing that needs a researcher. Configuration mistakes, every one, and all of them fixable the moment you know they're there. The single most common thing we see in a scan is an API key sitting in a frontend bundle in plain text, on a site that has been live for months.
The Real Risk Isn't Technical
The vulnerabilities themselves are fixable. What isn't fixable is what happens if somebody finds them first:
- User trust evaporates instantly. One data breach notification email and your users are gone.
- Financial damage compounds. Stolen API keys can rack up thousands in cloud bills overnight.
- Legal exposure grows. GDPR, CCPA, and other regulations don't care that you used AI to build your app.
- Investor confidence drops. Due diligence will uncover security issues. Better they find fixes than vulnerabilities.
The founders who get burned are usually the ones who assumed security could wait. It can't.
Making Vibe Coding Secure
Security doesn't have to slow you down. It just has to happen. Here's the practical version:
1. Accept the baseline
Assume your AI-generated code has vulnerabilities in it. That's not pessimism, it's just where the numbers sit, and assuming it makes you far more likely to go and check.
2. Scan before you ship
Automated scans catch the obvious problems in minutes. Run one before you deploy, and again after any change big enough to make you nervous. The goal is for it to become a habit rather than a special occasion.
3. Fix critical issues immediately
Exposed secrets, missing authentication, wide-open database access. Those three can't wait. Everything else can go in a queue and be worked through in order.
4. Ask AI about security explicitly
The model won't raise security on its own. Ask it directly: "Is this implementation secure? What vulnerabilities might exist?" The output changes noticeably, because you've made security part of the problem you asked it to solve.
5. Build security into your workflow
This is not a task you finish. Every feature and every deploy is another chance to introduce something, so regular scans and security-conscious prompting are what stop the debt piling up.
Security Checkpoint
- Run a security scan on your current codebase
- Search your frontend code for API keys and secrets
- If using Supabase, verify RLS is enabled on all tables
- Check that authentication requires proper credentials
- Confirm HTTPS is enforced (no http:// access)
- Verify .env files are in .gitignore
- Review your deployment's security headers
- Add "make this secure" to your AI prompts
The Bottom Line
Vibe coding changed who gets to build software, which is genuinely a big deal. The catch is that the same abstraction making development accessible also hides the security complexity underneath it.
Read Veracode's 45% as a reality check rather than a verdict on AI tools. They're built for speed, they're very good at it, and security is the part that only happens when someone asks for it.
You've already done the hard part. Now protect it.
Is vibe coding safe?
It's safe enough to build with and risky to ship unchecked. The code usually works, but AI models default to insecure choices often: in Veracode's 2025 tests they picked the insecure option in 45% of tasks, and failed to block cross-site scripting 86% of the time. The usual damage comes from configuration gaps (a key in the frontend bundle, a Supabase table without RLS), and those take minutes to find and fix once you look.
Why does AI-generated code have security vulnerabilities?
AI models learn from millions of code repositories, including code with security flaws. They optimize for functionality rather than security, often using deprecated methods, skipping input validation, or using insecure defaults. The AI doesn't know your specific security requirements unless you explicitly ask for secure implementations.
Can vibe coding be done securely?
Yes, vibe coding can be secure with the right practices. Running security scans before deployment, asking AI explicitly about security during generation, and fixing critical issues like exposed API keys and missing authentication significantly reduces risk. Most vulnerabilities in vibe-coded apps are configuration mistakes that anyone can fix.
What are the most common security issues in vibe-coded apps?
The most common issues are exposed API keys in frontend code, missing Row Level Security on databases like Supabase, weak or missing authentication, lack of HTTPS, missing security headers, and exposed environment variables. These are usually configuration mistakes rather than sophisticated vulnerabilities.
How do I know if my vibe-coded app has security issues?
Run an automated security scan on your codebase. These tools can identify exposed secrets, missing security configurations, and common vulnerabilities in minutes. Most issues are detectable without deep security expertise and fixable with the right guidance.
Find Out What's In Your Code
Run a free security scan and get plain-English results about what needs fixing.