pwnmyvibecode_

explainers

Web security basics for vibe coders

The few ideas that decide whether an app you shipped with AI is safe to put in front of people. Each one is a short answer here, with a longer explainer or fix where you need it.

In depth

The basics in one page

What is HTTPS and HSTS?

HTTPS encrypts traffic between the browser and your site. HSTS is a response header that tells the browser to only ever use HTTPS for your domain, so nobody can quietly downgrade a visit to plain HTTP.

Add HSTSRedirect to HTTPS

What are security headers?

Response headers that switch on browser protections: Content Security Policy, frame protection, nosniff and Referrer Policy. They cost nothing to send and each one closes a common gap.

Headers by hostHeaders checker

What is a Content Security Policy?

A header that lists where your page may load scripts, styles and other resources from. If someone gets a script into your page, a strict policy stops the browser from running it.

Add a CSPTighten a weak CSP

What is CORS?

Cross origin resource sharing: the headers that decide which other websites may read responses from your API in a visitor's browser. Echoing back whatever site asks while also allowing credentials lets other sites read your logged in users' data.

Reflected origin fixWildcard origin fix

What makes a cookie safe?

A login cookie should be Secure, so it only travels over HTTPS, and HttpOnly, so scripts on the page can't read it. Without HttpOnly, one injected script can steal a session.

Secure flagHttpOnly flag

What is a .env file?

A file of environment variables, usually API keys and database passwords, that your app reads at startup. It belongs on the server only. If it's served from your site or bundled into browser code, anyone can read it.

Public env variablesExposed .env fix

Which API keys are safe in the browser?

Publishable keys, like a Stripe publishable key, a Supabase anon or publishable key or a Firebase web config, are made to be public. Secret keys, like a Stripe secret key or an OpenAI key, must stay on the server.

API key guidesLeaked key fix

What is row level security?

A Postgres feature Supabase relies on: rules on each table that decide which rows a user may read or change. With RLS off, or a policy that allows everyone, your public anon key can read the whole table.

Supabase RLS explained

What are Firebase security rules?

The rules that decide who can read and write your Firestore, Realtime Database and Storage data. Test mode rules let anyone read and write your data while they last.

Firebase rules explained

Why is a public .git folder a problem?

If your .git folder is served from your site, anyone can download your source code and its history, including any key that was ever committed.

Exposed .git fix

Check your own site

The quick check grades your HTTPS, headers and cookies in seconds. The full check adds leaked keys, public files, CORS and your Supabase or Firebase config. For the whole picture, read the vibe coding security checklist.