Security Problems in Vibe Coding: “It Works” and “It’s Safe” Are Different Things

The app the AI built for you runs without problems on screen. But that is under normal use. What happens when someone with bad intentions uses it is a separate question you need to check.
Dangerous patterns we often see
Writing secrets into the code
It is common to see API keys or database passwords written straight into the code. Put that code somewhere public, or include it in files sent to the browser, and anyone can read them.
Using input as it is
Build form input into database commands without checking it, and you are open to an attack called SQL injection. Do the same when displaying input on screen, and you invite cross-site scripting (XSS).
Checking only whether someone is logged in
If being logged in is enough to see other people’s data, you have a missing authorization check — a problem that is hard to notice just by clicking around. Sometimes changing one number in the URL reveals someone else’s information.
Showing too much in errors
Detailed error messages are handy during development, but after launch they give attackers clues.
Why it happens more with AI-written code
- AI tends to prioritize making the requested thing work, and protective code nobody asked for can be left out
- The code it learned from includes outdated and unsafe patterns
- The builder does not read the code, so problems go unnoticed
A checklist before publishing
- Are API keys and passwords kept in environment variables or config files (somewhere not public), not in the code?
- Do database commands use placeholders rather than joining values in directly?
- Are values escaped before being shown on screen?
- Have you tried changing URLs and IDs to confirm other people’s data cannot be reached?
- Are passwords stored hashed, not as they are?
- Are detailed error messages turned off in production?
Use AI for review, too
AI can review as well as write. Ask “list the security problems in this code” and it may point out things you missed. But no findings is not proof of safety. Have a person check the parts that handle login, payments and personal data.
Summary
“It works” is the starting line. Before publishing, imagine how it could be misused and run at least the minimum checks.

