← All Articles 🔑 Secret Detection Critical By Nishant Kumar Verma

Railway Breach: Which Environment Variables to Rotate

Railway's 10 November report on its October 2026 breach: how the attacker reached customer environment variables, the time window and what to rotate first.

SEC-014 GIT-005 GIT-007 GIT-011

Quick Answer

In the Railway breach of 20 and 21 October 2026, an attacker partly escaped Railway's build isolation, moved across its internal systems and decrypted some customers' environment variables. Railway's incident report, dated 10 November, says at most 1.85% of workspaces, about 100,000, could have had variables decrypted, that AI provider keys were the main target, and that the attacker had no access to customer data after 09:25 UTC on 21 October. Railway recommends that all users revoke and reapply sensitive variables stored on Railway before 21 October. Start with AI provider keys, cut off each old key at its provider, then update it on Railway and redeploy.

What Railway Says Happened

Railway has published a first disclosure (21 October), a preliminary report (22 October) and a incident report (10 November). The first said an unauthorised third party may have accessed encrypted environment variables and, for some, obtained their decrypted contents. Where the reports differ, this post follows the 10 November report.

According to the 10 November report, the attacker first exploited Railway's build infrastructure at 07:28 UTC on 20 October. An alert about unusual API calls to a registry service paged the on-call engineer at 13:58 UTC, and Railway says the attacker was fully evicted at 09:24 UTC on 21 October. Railway invalidated every user session and token at 20:19 UTC on 21 October, and restored builds for all plans by 22:49 UTC on 22 October. Running services kept running, but new deploys were blocked until builds returned.

Railway believes the attacker wanted AI provider credentials to sell on for use in distillation. It says OpenCode, Warp, Fireworks AI and others disclosed similar thefts between 6 and 23 October. Our October 2026 supply chain roundup, published on 24 October before Railway's 10 November report, covers the OpenCode Console leak.

How the Attacker Got In

Railway's report describes two entry points. The first turned on a build credential that worked far beyond the build work it was meant for.

  1. A build escape. Builds ran isolated from each other on shared virtual machines. A previously unknown vulnerability let the attacker partly escape filesystem isolation and read some host files, including a credential build servers use to reach some internal systems.
  2. A credential trusted too widely. That credential was meant only for build work, but the internal Temporal instance that drives builds accepted it as a trusted client. The attacker read a limited subset of other builds' stored histories, including some build variables.
  3. A copy of Railway's code. The same credential could fetch repository snapshots kept for caching, so the attacker retrieved Railway's internal monorepo. Railway replaced the credential at 17:28 UTC on 20 October, not yet knowing the code had been taken.
  4. A wrong OIDC setting. In that code the attacker found a wrongly defined OIDC binding in one of Railway's cloud environments. At 03:26 UTC on 21 October it used the binding to get a short-lived cloud credential meant for Railway's CI/CD.
  5. Long-lived keys behind the short-lived one. With it, the attacker retrieved internal credentials, including an SSH private key, and connected to a machine that runs orchestration tasks. A file on its disk held a longer-lived credential that allowed decryption of encrypted variables.
  6. Read, then decrypt. Between 04:07 and 05:21 UTC the attacker pulled encrypted variables from a production database, selecting rows whose names matched its own regular expressions for AI provider keys. Decryption ran in two bursts, from 04:42 to 05:14 UTC and from 06:36 UTC until Railway disabled the credential at 07:14 UTC.

Each environment's variables are encrypted with its own data key, under a root key that cannot leave a cloud provider's key management service. The attacker used the orchestration machine's credential to ask that service to decrypt.

What Was Exposed, and What Was Not

All figures come from Railway's 10 November report. Its logs identify environments, not individual variables, so Railway calls the 1.85% an upper bound.

What Status in Railway's 10 November report
Customer environment variablesDecrypted for a subset. At most 1.85% of workspaces, about 100,000, could have had any decrypted
Stored build histories353 builds read between 13:50 and 15:30 UTC on 20 October, sealed variables included
Linked-account tokens (BYOK agent keys, GitHub OAuth tokens)Decrypted for 1,852 users, all reset and notified
Railway's internal monorepoCopied
Railway account loginsNone found using credentials taken in this incident
Customer databasesForensics did not indicate they were accessed
Customer repositories and snapshotsNo indication they were downloaded in the build-system phase. The preliminary report had not ruled out access to source code

Railway says a further query also matched cloud, database and payment service credentials. From 09:25 UTC on 21 October it asked GitHub, GitLab, Anthropic, OpenAI, OpenRouter, SpaceXSI, Google and Stripe to revoke potentially compromised keys, sending hashes of every key it held. It estimates unauthorised spend on the stolen keys at about $740,000.

The Time Window That Decides What to Rotate

  • From 18 October: the attacker created dummy accounts. Every early attempt failed.
  • 20 October, 07:28 UTC: first exploit of the build system.
  • 20 October, 13:50 to 15:30 UTC: 353 build histories read.
  • 21 October, 04:07 to 07:14 UTC: encrypted variables pulled and some decrypted.
  • 21 October, 09:25 UTC: in Railway's words, the attacker had "no access to any customer data beyond" this time.

Railway's preliminary report recommends revoking and reapplying sensitive variables stored on Railway before 21 October. By Railway's account, a key created after 09:25 UTC on 21 October was stored after the attacker's access to customer data ended.

The preliminary report had given 03:32 UTC on 22 October as when Railway confirmed the attacker was out of internal systems. The 10 November report puts the eviction at 09:24 UTC on 21 October, and says Railway only confirmed later that day that the attacker had no access to customer data beyond 09:25 UTC. Railway says it told providers first so they could revoke keys while it secured its systems, because it could not yet promise that replacement credentials stored on Railway would stay protected.

If You Used Railway: What to Do Now

These steps are based on Railway's own posts and guides. The rotation order in step 2 and the AI usage check in step 8 are ours.

  1. List every variable stored before 09:25 UTC on 21 October (Railway's own advice says before 21 October), across services, shared variables and environments, plus private registry credentials, which the first disclosure names.
  2. Rotate AI provider keys first, which Railway calls the primary target. Then cloud, database and payment keys, which the further query matched. Then the rest, as Railway recommends rotating all of them.
  3. Cut off the old credential first. Railway's PostgreSQL rotation guide says that if you suspect a leak, stopping the old credential matters more than a short outage. Its zero-downtime flow is for credentials you do not suspect are compromised. Revoke the old key with its provider and create a new one.
  4. Update the variable and deploy. Railway's variables docs say each change becomes a staged change you must review and deploy, and its PostgreSQL guide adds that containers read variables only at startup.
  5. Railway PostgreSQL: in the database's Database tab, open Config and click Regenerate next to the password. Railway changes the password inside PostgreSQL and updates the template's connection variables. Redeploy every service that uses it. Railway warns against editing POSTGRES_PASSWORD or PGPASSWORD by hand or running ALTER USER yourself.
  6. Remove public network access to databases that do not need it, the first item in the preliminary report's recommendations.
  7. Recreate Railway tokens. Project tokens (RAILWAY_TOKEN) and account or workspace tokens (RAILWAY_API_TOKEN) were revoked, so CI deploys fail until you create new ones. Locally, run railway logout, then railway login.
  8. Check for misuse. Review your GitHub audit log and app access, your registry's audit logs (Railway names Docker Hub) and your AI provider usage.

Railway's guide notes that a pasted connection string keeps the old password after Regenerate, while a reference variable picks up the new one on the next deploy.

# BAD: a pasted connection string. Regenerate does not update it.
DATABASE_URL=postgresql://<user>:<old password>@<host>/<database>

# GOOD: reference variables. One update reaches every service on its next deploy.
DATABASE_URL=${{ Postgres.DATABASE_URL }}
OPENAI_API_KEY=${{ shared.OPENAI_API_KEY }}

Sealed variables, per Railway's docs, are passed to builds and deployments but never shown in the UI or returned by the API. That did not keep them out of the build histories the attacker read. Railway's rotation guide still calls sealing a good default for production credentials. To rotate one, edit it from the variable's 3-dot menu and deploy.

How to Fix It on Any Platform

In the same month, Zeabur said an attacker used long-lived admin credentials stored in plaintext to read 3,218,965 environment variable records. Our Zeabur breach guide covers that case. You cannot audit a host's internals, but you can make a leak cheaper:

  • Keep a secrets inventory. List each secret, every place it is stored and where to revoke it, without the values. After a breach, that list is your rotation checklist.
  • Revoke at the provider, not only on the platform. Changing a variable on a host does not stop the old key working for whoever copied it. Railway's rotation checklist ends with revoking at the source: the provider dashboard or the database.
  • Use scoped, short-lived keys. Railway's fixes for its own systems include short-lived, narrowly scoped credentials issued just in time. On Railway, a project token is scoped to one environment in one project, while an account token can take any API action you can, across all your workspaces.
  • Check what sits behind short-lived credentials. Railway's short-lived cloud credential came from a misconfigured OIDC binding and reached longer-lived credentials. Review who your OIDC trust rules allow, and keep long-lived keys out of CI roles' reach.
  • Scan your code for secrets, private repositories too. Rotate what you find, then store the new value in your host's variables.
# GOOD: find keys in your files, then in every commit on every branch
gitleaks dir .
gitleaks git .

Tools like VibeDoctor's Vibe Check (vibedoctor.io) automatically scan your codebase with Gitleaks and their own secret checks, and flag OpenAI, Anthropic and other AI provider keys, AWS keys and Stripe keys with specific file paths and line numbers. Free to sign up.

FAQ

Was my Railway account taken over?

Railway says it found no logins to Railway accounts using credentials taken in this incident. It still invalidated every session and token on 21 October, and reset the linked-account tokens of the 1,852 users whose tokens were decrypted.

I rotated my keys on 22 October. Do I need to rotate them again?

Railway's 10 November report says the attacker had no access to customer data after 09:25 UTC on 21 October, so by its account a key created after that was never exposed to the attacker on Railway. A key replaced earlier on 21 October is inside the window.

A provider emailed to say it revoked my key. Was it stolen?

Not necessarily. Railway sent providers hashes of every key it held, and some revoked more on their own. Its preliminary report says a vendor's revocation notice does not by itself mean your credentials were impacted. Railway's preliminary report still recommends that all users revoke and reapply sensitive variables stored on Railway before 21 October.

Can I get money back for AI charges I did not make?

Railway asks you to report them through the form in its 10 November report. It says AWS and Google have started refunds for Bedrock and Gemini, OpenAI and SpaceXSI review claims case by case, and Railway is covering OpenRouter costs, Anthropic costs for now, and losses for any provider that does not refund.

Diagnose your codebase - free

VibeDoctor checks for SEC-014, GIT-005, GIT-007, GIT-011 and 148 other issues across 21 diagnostic areas - security, performance, code quality, and more.

SCAN MY APP →