Roll every secret you stored in Railway
Railway: intruder may have read customer environment variables · Security incident · News · Railway · Oct 21, 2026
What happened
Railway said on 21 Oct that an unauthorized party may have accessed encrypted customer environment variables and, for some, obtained the decrypted contents. It paused all builds and deployments, told every user to roll all environment variables, API keys and private registry credentials, and later reset bucket credentials and stored GitHub tokens. Railway believes it is part of a series of attacks on platform companies aimed at AI inference providers.
How to prevent it
Any secret stored with a hosting platform is only as safe as that platform. Keep a list of every secret and where it lives, give each service its own key, set spend limits, and when a host reports a breach, rotate at the issuer, not just in the dashboard. See our API key guide.
Fix prompt for your own AI tool
Copy this into your own AI tool (Cursor, Lovable, Claude Code, Bolt…). It's general guidance written by us. Review what the AI suggests before applying it.
I deploy apps on Railway and it has told users to rotate every environment variable after its 21 Oct 2026 security incident. Help me do this without breaking my apps. 1) Help me list every Railway project, environment and service I have, and for each, the names (not values) of the variables that are secrets: AI provider keys, database URLs, Stripe or email keys, OAuth secrets and registry tokens. 2) For each secret, tell me where it was issued and how to create a new one and revoke the old one there. 3) Give me an order to rotate them so my apps keep working, and remind me that new values only take effect after a redeploy once Railway builds are running again. 4) Show me how to check provider usage, billing and logs for anything unusual since 21 Oct. 5) Suggest a spend limit and a separate key per service going forward. Don't change anything until I've approved your plan. Never ask me to paste API keys, passwords or .env contents; tell me where to check them myself.
Why this keeps happening: leaked secrets & api keys
Secret keys placed in front-end code, mobile bundles or public repositories can be found by automated scanners and abused, often running up large bills on AI or cloud accounts before anyone notices.
A quick checklist before you ship
- Keep secret keys only in server-side environment variables, never in browser or app code.
- Set spend limits and usage alerts with every AI and cloud provider.
- Turn on secret scanning and push protection for your repositories.
- If a key leaks, revoke and replace it first; deleting the file is not enough.
More on this: every leaked secrets & api keys story and our related guide.
Tools involved
Railway stories, OpenAI stories, Anthropic API stories
Related stories
- Rotate any AI key you saved in a hosted tool
OpenCode Console breach: saved AI provider keys may be exposed - Never bake API keys or .env files into a container image; pass them at runtime, and if one ever went into a public image, rotate it now even if you deleted the tag
Study: AWS, OpenAI and Anthropic keys left in public Docker Hub images were used within seconds - Put hard spend caps and scoped keys on every AI provider account
Google: hijacked AI keys and cloud tokens ran up as much as $1 million in charges before access was cut
Source: original post on News ↗. Summarised in our own words; numbers are as stated by the source. Browse all stories.