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
- Railway, October 21. Railway detected anomalous activity in systems that store customer environment variables. Its investigation so far indicates an unauthorized third party "may have accessed encrypted environment variables and, for some of them, obtained the decrypted contents." The impact may be limited to a subset of users, but Railway recommends that all users immediately roll every environment variable and API key stored in Railway, plus private registry credentials, and review service logs for unusual activity. Deployments were paused during the investigation. (Railway disclosure, Railway status)
- Railway already reset some credentials for you. Railway regenerated storage bucket credentials and invalidated the GitHub tokens it held. Services that use buckets need a redeploy, and you need to reconnect GitHub yourself. GitHub tokens stored as registry credentials still work on GitHub until you revoke them there. (Railway: buckets and GitHub)
- Press coverage. TechCrunch reports that Railway did not say how many users were affected or what the root cause was. (TechCrunch)
- LiteLLM 1.107.0, also October 21. A malicious
litellm==1.107.0was published to PyPI and was live from 11:39 to 13:23 UTC, and the Docker tagsv1.107.0,latest,main-latestandmain-stablepointed at a compromised image from 11:46 to 14:20 UTC. The payload runs whenever Python starts in that environment and steals credentials, including cloud keys, SSH keys, environment variables and AI coding tool configs such as~/.cursorand~/.claude. It also loads remote code every hour. (LiteLLM incident report, OSV MAL-2026-2144)
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.
- LLM provider keys: OpenAI, Anthropic, OpenRouter, Gemini and any others. Check each provider's usage page for spend you don't recognize.
- Stripe secret key (
sk_live_…) and restricted keys (rk_live_…). Rotate the webhook signing secret too if it was in Railway. - AWS access keys. Deactivate the old key, then review CloudTrail and billing for activity you didn't generate. (Railway's AWS guide)
- Supabase
service_role(orsb_secret_…) key. It bypasses Row Level Security, so treat it like a root password. - Database passwords (Postgres, Redis, Mongo). On Railway, use Regenerate in the Database view rather than editing the variable by hand. (Railway: Postgres, Railway: Redis)
- Everything else: email (Resend, SendGrid), auth secrets, webhook secrets, registry tokens and GitHub tokens.
How to rotate one key without breaking your app
- Add the new key at the provider. Most let you keep two keys active at once.
- Update the variable and redeploy. Containers read variables only at startup, so nothing changes until you redeploy.
- 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:
- Open DevTools, then Sources (or Network, filtered to JS). Search every bundle for
sk_live,service_role,sb_secretandsk-. A Supabase anon or publishable key is normal; a service_role key or anysk-key is not. - Check that any variable with a
NEXT_PUBLIC_orVITE_prefix holds only something that's safe to be public. Those prefixes ship to the browser by design. - Visit
https://yourapp.com/.envandhttps://yourapp.com/.git/HEAD. You want a 404 or 403. A file full ofKEY=valuelines, or a line likeref: refs/heads/main, means it's exposed. (Some single-page apps answer 200 with their normal homepage HTML. That isn't a leak.) - If a key was ever committed to git, rotate it. Scrubbing git history doesn't un-leak it.
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
- If you see 1.107.0, don't run pip in that environment. Every Python start, including pip, re-runs the payload. Follow LiteLLM's cleanup steps first: delete
cook.pth,cook.pyandsitecustomize.pyfrom site-packages and kill the background loader. Then rebuild the environment from scratch and rotate every credential the machine could reach. (LiteLLM) - Pin your version. LiteLLM's guidance is to pin
litellm==1.106.2or another explicit earlier release. Avoid floating Docker tags likelatestormain-stablein production. - If 1.107.0 was installed on your laptop, include your Claude Code and Cursor configs, SSH keys and cloud credentials in the rotation.
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