Websites · Mobile Apps · Web Apps & SaaS · AI
Home / Blog / Technology

Railway Security Incident: How to Rotate Your API Keys and Secrets

Railway told all users to rotate environment variables after a breach on 21 October 2026. Here is a plain checklist to rotate secrets on any hosting platform.

Railway Security Incident: How to Rotate Your API Keys and Secrets
Quick answer

On 21 October 2026 the hosting platform Railway said an unauthorized third party may have accessed encrypted environment variables and, for some, obtained the decrypted contents. Railway recommends that every user roll all environment variables, including API keys and private registry credentials, and review logs for unusual activity. If you host anything on Railway, rotate the secrets today, starting with database passwords and payment, email and cloud keys.

If your website, app or API runs on Railway, treat today as a key-rotation day. On 21 October 2026 Railway published a security disclosure saying it had detected anomalous activity involving the systems that store customer environment variables.

According to Railway, an unauthorized third party may have accessed encrypted environment variables and, for some of them, obtained the decrypted contents. Railway says its analysis so far suggests the impact may be limited to a subset of users, but it still recommends that all users act. It did not publish how many users are affected or what the root cause was.

What Railway recommends

From Railway's disclosure:

  • Roll all environment variables stored in Railway, including API keys and private registry credentials.
  • Review logs for those services for unusual activity.
  • Expect an email from Railway if your account is confirmed as affected.

Railway also said it believes this is part of a series of attacks aimed at platform companies, with the goal of compromising AI inference providers, and that it has asked upstream providers to revoke keys proactively. As of 22 October, The Hacker News reported that Railway had rotated its own bucket credentials, invalidated Railway API tokens and restored builds for Pro and Enterprise workspaces, with other plans still being worked on. Check the Railway status page for current details, because they are changing quickly.

The Hacker News also cited a security researcher who reported that cryptocurrency wallets whose private keys were stored on Railway had been drained. Treat that as reported and not confirmed by Railway.

Why environment variables matter so much

Environment variables are where most apps keep the keys to everything else: database passwords, payment gateway keys, email and SMS provider keys, cloud storage keys and AI provider keys. If a key leaks, an attacker can use it exactly as your app would, from anywhere, until you revoke it.

What to do this week (works on any platform)

  1. List every secret. Open your platform's variables page and write down each key and where it came from (database, payment provider, email service, cloud account, AI provider).
  2. Rotate in order of damage. Start with database and cache passwords, then payment keys, then cloud access keys, then email, SMS and AI provider keys.
  3. Rotate one at a time. Create the new key, put it in your app's variables, redeploy, test, then revoke the old key. This avoids downtime.
  4. Rotate signing secrets too. Session and JWT signing keys, and webhook secrets. Expect users to be logged out once.
  5. Check provider dashboards for strange use. Look for unfamiliar API calls, new access keys, new team members, unexpected cloud spend or unfamiliar AI model usage.
  6. Check access logs on your database and storage for logins from unknown IP addresses.
  7. Never keep wallet or signing keys in plain environment variables. Use a dedicated secrets manager or a hardware-backed key store where you can.
  8. Turn on alerts. Set billing alerts and per-key usage limits with your cloud and AI providers so abuse shows up fast.
  9. Write down what you rotated and when. It makes the next incident much faster.

If you also run PHP or Node.js, this is a good week to update those runtimes as well. See our guides on the PHP2Shell patch and the Node.js October 2026 security release, and our website maintenance checklist for a routine that keeps this from piling up.

Not sure which keys your app uses, or want help rotating them safely? Talk to Susraj Tech.

Frequently asked questions

Do I have to rotate secrets if Railway has not emailed me?

Railway recommends it for all users as a precaution while it confirms which accounts were affected.

Will rotating a key break my site?

Not if you create the new key, update your app and test it before revoking the old one.

Sources

Last reviewed 22 October 2026. This article is general security information, not a guarantee of protection. Details may change as Railway publishes more information.

Frequently asked questions

What happened at Railway?

Railway said on 21 October 2026 that it detected anomalous activity involving systems that store customer environment variables. It said an unauthorized third party may have accessed encrypted environment variables and, for some of them, obtained the decrypted contents. It believes the impact may be limited to a subset of users.

Do I have to rotate secrets even if Railway has not emailed me?

Railway recommends that all users roll their environment variables as a precaution while it confirms which accounts were affected. It said it would email customers it confirms as affected. Waiting for that email is a risk, because rotating is cheap and a leaked key can be used immediately.

What counts as a secret?

Anything that grants access: API keys, database and cache passwords, JWT or session signing keys, payment gateway keys, email and SMS provider keys, cloud access keys and registry credentials. Feature flags and public site URLs are not secrets.

I do not use Railway. Does this matter to me?

The same steps apply if any provider that stores your secrets is ever breached, including hosting platforms, CI tools and developer tools. Having a short rotation checklist ready saves hours when it happens.

Will rotating a key break my site?

It can if you swap a key before the new one is in place. Create the new key, update the app, confirm it works, then revoke the old key. Do this for one secret at a time.

Written by the Susraj Tech team

We design and build websites, mobile apps, SaaS products and AI solutions. Have a project in mind? Tell us about it and we’ll send a clear, written quote.

Have an idea? Let’s build it.

Tell us what you need and we’ll reply with a clear, written quote. No pressure, no jargon.