Replit App Security Checklist: Secrets, Deployments and Public Repls
Building and deploying on Replit is fast. Check these things first: where your secrets live, what your public project shows, what your deployed app exposes and who can reach your data.
๐ก The short version: on Replit the usual risks are secrets pasted into code, a project that's more public than you meant, and a deployed app nobody has looked at from the outside. Fix those three, then check your database access and your site's basics.
Replit makes it easy to go from "let's try something" to a live link you can send to friends. That ease is the whole appeal. It also means the boring-but-important steps tend to get skipped, because nothing breaks when you skip them.
๐คซ 1. Keep secrets out of your code
Use the platform's secrets feature or environment variables for every key, and read them on the server. A key written into a file can end up in a public project, in version history and in a browser bundle. If one ever did, rotate it: make a new key and revoke the old one.
๐ 2. Check what's public
- If your project's code is visible to others, everything in it is visible, including old commits.
- Look through the file tree for
.envfiles, copied configuration and test credentials. - Review who can edit or fork the project.
๐ 3. Look at the deployed app, not the editor
What matters to a stranger is the address your users visit. Open it in a private window and check:
- It loads over HTTPS only, with a valid certificate.
- It sends security headers: Content-Security-Policy,
Strict-Transport-Security,X-Content-Type-Options, a Referrer-Policy. - Paths like
/.env,/.git/configand your.mapfiles return "not found". - Admin and debug pages need sign-in, or don't exist.
๐๏ธ 4. Protect your data
| If you use | Do this |
|---|---|
| Supabase | Enable row level security on every table and write policies. Keep the secret key on the server |
| Firebase | Set Security Rules. Locked mode denies all access, while test mode allows anyone, so replace it before launch |
| Your own database | Don't expose it to the internet, use a least-privilege user and never put the connection string in client code |
๐ธ 5. Protect what costs money
If the app calls an AI model or sends email, those routes need sign-in and limits. An anonymous route that forwards to a paid API lets anyone spend your credits.
๐ง 6. Email and sign-in
- Set SPF, DKIM and DMARC for the domain you send from.
- Require verified email, and make sure repeated wrong passwords get slowed down.
โฑ๏ธ A 15-minute routine
- Search the project for
sk_,secret,passwordandBEGIN PRIVATE KEY. - Open the deployed site in a private window and click through it logged out.
- Request
/.envand/.git/configon the deployed address. - Run an outside scan and fix the highest-severity result first.
Want the key-hunting part in more detail? See how to find API keys in your frontend.
๐ See your deployed app the way a stranger does. Scan it free and get the results in plain language.