Guide · October 22, 2026

Railway breach: rotate your keys in the right order

If your app runs on Railway, Railway is asking you to treat every environment variable you stored there as exposed. This page covers what happened, the order to rotate keys in so the expensive ones die first, how to check that your live site isn't still shipping a secret, and a quick check for this week's LiteLLM compromise.

What happened

1. Rotate in this order: the keys that cost money first

A stolen LLM or cloud key turns into a bill within hours. A stolen database password is serious too, but rotating it usually takes your app down for a moment, so do the quick, expensive ones first.

  1. LLM provider keys: OpenAI, Anthropic, OpenRouter, Gemini and any others. Check each provider's usage page for spend you don't recognize.
  2. Stripe secret key (sk_live_…) and restricted keys (rk_live_…). Rotate the webhook signing secret too if it was in Railway.
  3. AWS access keys. Deactivate the old key, then review CloudTrail and billing for activity you didn't generate. (Railway's AWS guide)
  4. Supabase service_role (or sb_secret_…) key. It bypasses Row Level Security, so treat it like a root password.
  5. Database passwords (Postgres, Redis, Mongo). On Railway, use Regenerate in the Database view rather than editing the variable by hand. (Railway: Postgres, Railway: Redis)
  6. Everything else: email (Resend, SendGrid), auth secrets, webhook secrets, registry tokens and GitHub tokens.

How to rotate one key without breaking your app

  1. Add the new key at the provider. Most let you keep two keys active at once.
  2. Update the variable and redeploy. Containers read variables only at startup, so nothing changes until you redeploy.
  3. Revoke the old key, then confirm the app still works.

One exception. If you have reason to think a key is actually being abused, revoke it first and accept a few minutes of downtime. Railway's own Postgres guide says the same: when a leak is suspected, cutting off the old credential matters more than the short outage. If Railway builds are still paused when you read this, you can still revoke at the provider; check status.railway.com for when deploys resume.

2. Check what your live site is still shipping

Shortcut: run our free live-site check to scan your public JavaScript for leaked keys, an exposed /.env or /.git, and Supabase tables readable while logged out. Coming from Railway? Start here.

Rotating a key in Railway does nothing if a copy is baked into your frontend, and if a secret key ended up there once, the new one will too. Open your site logged out, the way a stranger would:

3. Check for LiteLLM 1.107.0

LiteLLM gets pulled in by many AI apps and agent tools, sometimes as a dependency you never chose directly.

pip show litellm          # shows the version in the current environment
pip freeze | grep -i litellm
docker images | grep -i litellm

Want a second pair of eyes?

The VibePreflight report scans your repo and, optionally, your live URL for exposed secrets, risky dependencies and Supabase RLS gaps, and gives you a ranked list with a copy-paste fix prompt for each finding. See a full sample report on our demo app first, or get your own report. If you'd rather do it yourself, the free guardrail pack is a good start.

This guide is general guidance, not a forensic investigation. If you think you were affected, follow your providers' incident guidance too.

The VibePreflight team