Home / Guides

Your host leaked env vars: rotate your keys in 15 minutes

Railway says an unauthorized party may have accessed customer environment variables, and recommends every user roll their secrets. Here is a quick, sourced checklist: inventory, rotate the riskiest keys first, revoke the old ones, redeploy when builds are back, and check logs.

Updated 2026-10-23 · Railway status checked at 09:34 UTC (5:34 AM ET) · ShipCheck guides

On October 21, 2026, Railway published a security disclosure about customer environment variables and recommended that every user rotate their secrets. If your app runs on Railway, this is a short, practical order of operations. Every Railway fact below comes from Railway's own posts, and every rotation step links to the provider's official docs.

What Railway said

From the disclosure, Security Disclosure: Wednesday October 21st (Railway Blog, Oct 21, 2026):

From the Railway status page:

Railway also published step-by-step recovery guides. They are linked in the steps below.

1. Inventory your env vars (3 minutes)

Open each Railway service's Variables tab, in every environment you use, and list every secret: API keys, database URLs and passwords, webhook signing secrets, auth secrets and registry tokens. Mark each one by risk:

Also note anything outside Railway that holds the same secret: local .env files, CI, other hosts. They need the new value too.

2. Rotate the highest-risk keys first (10 minutes)

For each key, create the replacement, paste it into the Railway variable, then retire the old one (step 3). Official steps per provider:

3. Revoke the old keys

A new key does nothing if the old one still works. Delete, expire or deactivate every old value once its replacement is in place. Clerk and Supabase both advise confirming the new key works before deleting the old one, because a deleted key breaks anything still using it. Where a provider shows "last used" or request logs per key (Clerk, Stripe, Resend), use that to confirm the old key has gone quiet.

If builds aren't back for your plan yet, your running services still use the old values until they redeploy, so revoking right away may cause an outage. Weigh that per key; for databases, Railway's own guidance is to cut off the old credential first.

4. Redeploy once Railway allows it

5. Check provider logs for misuse

6. While you're in there: make sure no secret ships to the browser

Rotation fixes the server side. It's also a good moment to confirm none of the new keys ends up in a browser-exposed variable (NEXT_PUBLIC_…, VITE_…, REACT_APP_…), where every visitor can read it from your JavaScript. ShipCheck scans your live HTML and shipped JavaScript for OpenAI, Anthropic, Stripe live secret and restricted, AWS, GitHub and Google keys, private keys and Supabase service_role JWTs, and checks for a publicly served .env file. It doesn't detect every key format (for example Supabase sb_secret_, Resend keys or database URLs), so search for those by hand.

Quick checklist

Sources: Railway security disclosure (Oct 21, 2026) and status.railway.com. For a general walkthrough of leaked keys, see Exposed .env file or API key? How to check and rotate.

Check your bundle for leaked keys, free

After you rotate, run a free ShipCheck scan on your live URL to confirm no secret sits in your client-side JavaScript or a public .env file. No signup.

Or open the scan box on the homepage

FAQ

Was my Railway account affected?

Railway's disclosure says its initial analysis suggests the impact may be limited to a subset of users, that it will contact affected customers directly by email as it confirms which accounts were affected, and that it recommends all users rotate as a precaution. This guide doesn't add anything beyond Railway's own posts.

Do I need to rotate publishable keys too?

Usually not. Stripe publishable keys (pk_), Clerk publishable keys and Supabase publishable or anon keys are designed to be public. Clerk's docs say you don't need to rotate a publishable key that was made public. Focus on secret keys, database credentials, webhook signing secrets and tokens.

Can I rotate before Railway builds are back for my plan?

Yes, partly. Railway's status page says some recommended steps require a redeploy and must wait for builds, but others you can begin now. You can create new keys and stage new variable values now; services only pick up new variables when they are redeployed.

More guides

Exposed .env file or API key? How to check and rotate

How to find leaked API keys and committed .env files in your repo, JavaScript bundle or live site, rotate them safely, and stop it happening again.

Supabase Row Level Security (RLS) checklist for vibe-coded apps

Your Supabase anon key is public by design, so RLS is what protects your data. Enable RLS on every table, write auth.uid() policies, lock down storage, keep service_role server-side and test with a logged-out request.

The vibe-coded app launch checklist

A practical pre-launch checklist for apps built with Lovable, Cursor, Bolt, v0 or Replit: security, secrets, database rules, performance, SEO, legal and monitoring.

Is my Lovable app secure?

How to check whether your Lovable app is secure: Supabase Row Level Security, exposed keys, security headers, auth and storage. A step-by-step checklist with fixes.