Back to the shelf
PromptsClaude3 min readAugust 25, 2026

How not to get sued for your vibecoded app

Three prompts to run against any vibecoded app before it touches real users. Paste each one into Claude, let it audit your codebase, and fix what it flags befor...

the short answer

A security audit guide for vibecoded apps using three Claude prompts that check file uploads, payment webhooks, and XSS vulnerabilities before shipping to real users.

key takeaways

  • Run all three security prompts against your codebase before your vibecoded app touches real users, none are optional
  • For file uploads: validate actual file content (magic bytes), enforce size limits, store outside webroot, and rename files to prevent directory traversal
  • For payment webhooks: verify signatures using the provider's signing secret from environment variables, add replay protection, and only allow verified webhooks to change payment status
  • For XSS protection: use framework-safe rendering (never bypass with dangerouslySetInnerHTML), add server-side sanitization, and implement a Content-Security-Policy header
  • These prompts catch the most common security mistakes that get vibecoders into legal trouble, but they don't replace a real security review for apps handling real money or user data

Three prompts to run against any vibecoded app before it touches real users. Paste each one into Claude, let it audit your codebase, and fix what it flags before you ship.

Run all three. None of them are optional.

01, File upload checks

Fake image extensions, oversized payloads, and files that land somewhere the server will happily execute, this closes all three.

Review every file upload endpoint in this codebase. For each one:
1. Validate the file type by checking its actual content/magic bytes, not just the file extension or the Content-Type header (both can be spoofed).
2. Enforce a max file size limit and reject anything over it before it's fully read into memory.
3. Confirm uploaded files are stored outside the webroot, or in object storage (S3/Cloudinary/etc.) that is NOT configured to execute code, never in a folder the server would serve or execute directly.
4. Rename uploaded files on save (don't trust the original filename) and strip any path characters to prevent directory traversal.
5. Show me every upload endpoint you changed and explain what was missing before.

02, Payment webhooks

If anyone can hit your webhook URL and grant themselves a paid subscription, this is the one that catches it.

Review how this app handles incoming payment webhooks (Stripe or any other provider).
1. Confirm the webhook signature is being verified using the provider's signing secret before any payment/subscription logic runs, if it's not, add it.
2. Make sure the webhook secret is loaded from an environment variable, never hardcoded.
3. Add a check to reject events with a timestamp too far in the past (replay protection).
4. Confirm no endpoint changes a user's payment/access status based on client-side calls or unverified request data, only verified webhook events should do that.
5. Show me the webhook handler before and after, and point out exactly what was unverified.

03, XSS protection

Anywhere a comment, username, or bio gets echoed back to other users is a place someone can inject a script. This sweeps the whole app for it.

Review every place in this app where user-generated content (comments, usernames, bios, messages, etc.) gets displayed back to other users.
1. Confirm the frontend is using framework-safe rendering (e.g. React's default JSX escaping) and NOT bypassing it with dangerouslySetInnerHTML, v-html, innerHTML, or raw template interpolation.
2. If any raw HTML rendering is used, tell me exactly where and whether it's actually necessary, if not, replace it with safe rendering.
3. Add server-side input validation/sanitization for user input as a second layer of defense, not the only one.
4. Recommend a Content-Security-Policy header I can add as an extra layer of protection.
5. List every spot in the codebase where user input is rendered, and confirm each one is safe.

None of these replace a real security review before you handle real money or real user data, they just catch the mistakes that show up in almost every vibecoded app.

Run them in order. These three areas account for most of the security holes that get vibecoders into legal trouble, and the same patterns show up again and again in the apps I audit.

frequently asked

How do I secure a vibecoded app before launching?[+]

Run three security prompts in Claude: one checks file uploads for proper validation and storage, one verifies payment webhooks are signed and protected against replay attacks, and one scans for XSS vulnerabilities in user-generated content.

What are the most common security issues in vibecoded apps?[+]

According to this post, the three areas that cause most lawsuits are insecure file uploads, unverified payment webhooks, and XSS vulnerabilities in user-generated content like comments and usernames.

How do I prevent XSS in a web app?[+]

Use framework-safe rendering like React's default JSX escaping, never use dangerouslySetInnerHTML or v-html with user input, add server-side sanitization as a second layer, and implement a Content-Security-Policy header.

How do I verify payment webhooks properly?[+]

Always verify the webhook signature using the provider's signing secret before processing any payment logic, load the secret from environment variables never hardcoded, and add replay protection to reject events with timestamps too far in the past.

How do I secure file uploads in a web app?[+]

Validate file type by checking actual content/magic bytes not just extensions, enforce max file size limits, store uploads outside the webroot or in object storage that can't execute code, and always rename files on save while stripping path characters.

keep exploring