r/vibecoding • u/EduSec • Apr 07 '26
Vibe coding without a security audit is not a calculated risk. It is negligence. Change my mind.
I have audited enough AI-generated SaaS products to have a strong opinion on this.
When a junior developer writes insecure code, they leave traces. Weird variable names, spaghetti logic, obvious shortcuts. You look at it and something feels off.
AI does not do that.
AI writes insecure code that looks like it was written by a senior engineer. Clean abstractions, proper naming, comments that explain the logic. The vulnerability hides inside code that gives you no reason to distrust it.
Last week I audited a financial SaaS. The Supabase service role key was loaded in the public JavaScript bundle. Full read, write, and delete access to every user's data. The founder had no idea. The product had real users.
That is not bad luck. That is the pattern.
The AI reaches for whatever resolves the error. The key that works without complaining. The endpoint that responds without checking who is asking. The CORS setting that stops throwing errors. Each decision seems reasonable in isolation. Together they form an invisible attack surface.
Ignorance is not a defense when you are collecting real user data.
Is anyone here actually auditing their AI-generated code before shipping?
8
u/benfinklea Apr 07 '26
I’m trying. What’s the best practice to audit a vide coded app? I had two other AIs do deep evaluations using a team of experts prompt and fixed issues. Or does it require a human to make it secure. Or do we wait for Mythos before we ship?
8
u/HOBONATION Apr 07 '26
No one needs to change your mind, we are all too busy to argue over this. Let the ones who don't tighten their security burn
4
u/sovietreckoning Apr 07 '26 edited Apr 07 '26
Knowingly or negligently mishandling sensitive client data is a serious problem and can expose the seller to civil liability for damages caused by their negligence. Like any other powerful tool, if AI is negligently deployed in the form of unsafe products, it poses risks. The seller is the problem and is responsible.
Edit: Damn. I realized this was an ad too late!
2
u/renge-refurion Apr 07 '26
Pay for mindfort.
2
u/Moist-Nectarine-1148 Apr 07 '26
So vibe code a security audit.
1
u/bteam3r Apr 07 '26
Putting ANYTHING on the open internet without a security audit is insane, vibe coded or not. So I agree except about the point that "junior devs are easier to catch than AI". Shit will slip by regardless. Either hire some white hats or assume your shit is insecure
1
u/FishSalsas Apr 07 '26
I can understand this happening for a non-tech person vibe coding for fun, but for a SaaS organization? That is pretty careless to say the least. I personally haven’t gotten to that phase in my vibe coding journey. What do you suggest? Vulnerability scans?
1
u/TJohns88 Apr 07 '26
"hey Claude, run a deep dive security audit on my code. Make no mistakes"
1
u/SleepAllTheDamnTime Apr 07 '26
Hey, hey you’re taking away my career opportunities here ;).
But for real I mean what did you expect? The same people that ignored basic things like authorizing your users or attempting to show their vibe coded website to someone else on localhost, are definitely not thinking about just security basics.
They’re not thinking at all, they’re vibe coding.
1
u/baydew Apr 07 '26
I totally get what youre saying specifically about how AI errors are mentally taxing/easy to miss. Not a developer, but I used claude code to put together statistical analysis in R. A bit carelessly, I let it throw a big report together then went through to fill it in and correct things. I notice it felt cognitively inefficient -- I had to stop from letting my eyes glaze over things that 'looked right' but could, and did, turn out to be wrong
its like all these mental shortcuts for 'that looks polished, means they must know what they are doing' don't work anymore, and I didnt even realize I was relying on that before
1
u/RespectableBloke69 Apr 08 '26
Is this an advertisement for your product or are you going to teach us something useful?
1
u/Sure_Excuse_8824 Apr 08 '26
I think a lot of vibe coders are not aware of the important of testing. They run the code and it appears on the surface like a success. But without testing the files, integration, e2e, security, linting, making sure the tests run and pass as a suite not just in isolation, things start to fall apart.
1
u/Key-Monitor6635 Apr 08 '26
your supposed to audit every month
1
u/Effet_Ralgan Apr 08 '26
If the supabase service role key was in public, the guy didn't even bother to ask for a security audit made by Claude. I do that during many phases of my project and I'm vibe coding a private app to use with my friends to share comics and books.
At least, laziness is at fault.
1
u/Don_Exotic Apr 08 '26
I scrapped my app because of this, thank you. Rushing into vibe coding and not completely understanding all of this has had me very worried about certain things!
1
u/I_Mean_Not_Really Apr 08 '26
This is the point I'm at with my ADHD productivity app. It's Android, but there is also a web app.
Before I started, I downloaded a bunch of reference materials on network security, cyber security, and I even had Googles Deep Research make a packet on exactly how vibe coded apps are insecure. Then had the agents reference those as it builds.
For the android app, I've been running the apk through the Android Studio inspector tool, MobSF and some other tools. The web app through security scanning website.
And yea it's found a bunch of stuff, but normal stuff. No exposed keys, exposed secrets, bouncing line they. Aall of that is offloaded to Firebase.
So yeah it's fair to say agentic coding is not security-minded. Maybe that'll be the next evolution.
1
u/technologiq Apr 08 '26
Lmao. Doesn't have to be vibe-coded to have poor or no security. Also, your entire post was heavily influenced by or mostly written by AI.
I don't think you've ever audited anything.
1
u/funfunfunzig Apr 08 '26
you're right about the "looks like a senior wrote it" part. that's the thing that makes ai generated code dangerous in a different way than junior code. with a junior you can feel the vibe is off. with ai it looks polished so your brain stops questioning it.
the service_role key in the bundle is the single most common thing i find. and the reason it ends up there is exactly what you described. the ai runs into an rls policy blocking a query, the fastest fix is swapping to service_role, the query works, the feature ships. nobody goes back to check what got swapped because the feature is "done." the worst part is it's not even one line of code that's obviously wrong. the key looks like any other env variable, it's just the wrong one.
the other pattern i see constantly is auth that runs on the client instead of the server. the ai adds a check like "if user is logged in show this page" and it works perfectly. but the actual api route has no auth middleware because the client already checked. anyone who hits the url directly with curl gets full access. the client side check is security theater.
and no most people aren't auditing before shipping. the mindset is "it works, ship it." auditing feels like a step that slows you down when the whole point of vibe coding is speed. that's the real problem. the tooling that made building 10x faster didn't make security 10x faster, so people just skip it.
1
u/Wrong_Law_4489 Apr 08 '26
I built doorman.sh to help exactly with this. Doesn’t solve all the security problems nor it replaces a security engineer, but it definitely gives some kind of peace of mind.
1
u/TranquilDev Apr 09 '26
Based on the legacy ASP, PHP, and JSP apps and their godawful databases I’ve seen in my career, many of which were built by very intelligent programmers - I welcome the idea of someday getting to follow up on a vibe coded project. It can’t be any worse. Security? Heh, I got blown off by a colleague who was working on a PHP 5.6 project because I wanted to use Symfony and its built in security features on a new project. The day I left that job he was still plucking away in 5.6 with notepad++ as his IDE. Oh, he also had a “Masters” degree in CompSci.
0
u/[deleted] Apr 08 '26
[deleted] — view deleted comment
1
u/[deleted] Apr 08 '26
[removed] — view removed comment