~/VibeHandbook
$39

Chapter 18 · 09

Recap and Practice

Key takeaways

  • AI-generated code is insecure by default; assume a vulnerability exists and go looking rather than trusting a clean first impression.
  • The big categories repeat: injection, exposed secrets, missing authorization, unsafe file uploads, and invented dependencies.
  • Authorization is per-request, not per-login — every must check that this user may do this action, not just that they're logged in.
  • Run a scanner like gitleaks before every push, and rotate any key that ever leaked; wire the scan into so you can't skip it.
  • Day ninety is more dangerous than day one — make the security gate cheap enough not to skip and automatic enough that you can't.

Try it

Take any feature of yours that touches auth, user data, or uploads and run the adversarial review below against it. For each vulnerability the AI reports, ask for the exact request that exploits it and the minimal fix, then apply the fix and re-run the prompt. Finish by running gitleaks (or your platform's secret scan) over the repo and history.

Prompt of the chapter

Here is the code for a feature that handles [auth / user data / uploads]:
[paste the code].
Act as an attacker reviewing this for security holes. Specifically check:
  - broken authorization (can a user act on another user's data?)
  - injection via input (SQL injection, XSS, command injection)
  - exposed secrets or keys in code or responses
  - unsafe file handling (type, size, path, generated names)
  - missing validation or rate limits
For EACH issue, show the exact request that exploits it, then the fix.
Do NOT reassure me — assume there IS a vulnerability and find it.

Want it offline?

Get the PDF + EPUB + downloadable prompt library + version updates.

$ Get the PDF — $39