Research · AI security · LLMjacking · API keys

The Railway breach: stolen AI keys and an estimated $740,000 bill

How an attacker went from a build container to customers' AI provider keys at Railway, who pays for the stolen usage, and what to change about your own keys.

7 min read

Short answer

Railway's incident report of 10 November 2026 says an attacker partly escaped the isolation in its shared build system on 20 October, reached the credential that decrypts customer environment variables, and searched them for AI provider keys. Unauthorized spend on the stolen keys was estimated to reach about $740,000. At most 1.85% of workspaces, about 100,000, could have had variables decrypted. If your app's AI key sits in a hosting platform's settings, give it a spend limit, keep one key per app, and know how to revoke it within minutes.

An attacker spent about 26 hours inside the hosting platform Railway in October, and what they wanted was its customers’ AI provider keys. Railway’s incident report, published on 10 November 2026, says unauthorized spend on those keys “was estimated to reach ~$740,000.”

Most small teams keep their OpenAI, Anthropic or OpenRouter key in exactly this kind of place: an environment variable in the dashboard of whoever hosts the app. So this note walks through how the keys were reached, what the bill looks like, and what to change on your side. Everything about the incident comes from Railway’s two reports unless we name another source. All times are UTC.

What happened

Railway builds and runs customers’ apps. Its build system was multi-tenant, meaning many customers’ builds ran on shared machines with isolation between them. The report says the attacker’s first signups began on 18 October, using dummy accounts, and that the early attempts failed.

At 07:28 on 20 October the attacker “exploited a previously unknown vulnerability in our build infrastructure” and partly escaped the filesystem isolation. That let them read some files on the host machine, including a credential the build servers use to push finished images. The credential was meant for build work only. An internal Temporal workflow system accepted it as a trusted client anyway, so the attacker could read the stored histories of 353 other builds, variables included, and fetch a copy of Railway’s own monorepo.

Railway’s on-call engineer was paged at 13:58, about six and a half hours after the first exploit, on unusual API calls to a registry service. The team revoked the build credential at 17:28. By then the attacker had the source code, and in it they found a wrongly defined OIDC binding in one of Railway’s cloud environments.

From a build container to customers' AI keys

1. Shared build systemUnknown flaw lets a build read files on the host, 20 October 07:28
isolation escape
2. Build credentialMeant for pushing images, also trusted by the internal workflow system
too much trust
3. Company monorepoCopied, then searched for mistakes
source code
4. Cloud credentialA wrongly defined OIDC binding hands one out, 21 October 03:26
misconfiguration
5. Orchestration machineReached over SSH; a file on disk holds a credential that can decrypt variables
long-lived secret
6. Customer variablesDatabase rows picked by variable name, then decrypted
AI provider keys
Our layout of the path described in Railway's incident report of 10 November 2026. Times are UTC.

At 03:26 on 21 October the attacker used that OIDC mistake to get a short-lived cloud credential. With it they pulled more internal credentials, among them an SSH private key that Railway’s deployment system uses. The key opened a machine that runs orchestration tasks, and a file on that machine’s disk held a longer-lived credential able to decrypt customer variables.

How they picked out the AI keys

Railway stores environment variables with envelope encryption: each variable is encrypted with a key for its environment, and those keys are encrypted by a root key in a cloud key management service. The encryption only helps while nobody else holds a credential that may ask the key service to decrypt.

Between 04:07 and 05:21 on 21 October the attacker queried the variables database. The report says they were “selecting rows where the variable name matched attacker-provided regular expressions” and that the database logs show them “specifically prioritizing AI provider keys.” They also went after customers with large numbers of variables. Decryption ran in two windows, 04:42 to 05:14 and 06:36 to 07:15. Railway disabled its cloud credentials at 07:14 and says the attacker was fully evicted at 09:24.

A name like OPENAI_API_KEY tells an attacker which row is worth decrypting. Renaming your variables won’t save you, since one extra query also matched cloud, database and payment service credentials. But it shows what the attacker valued most.

The numbers in Railway's report

~$740,000unauthorized spend on stolen AI keysan estimate, no time period given
≤1.85%of workspaces, about 100,000, could have had variables decryptedan upper bound
1,852users whose linked-account tokens were decryptedall reset by Railway
353build histories readbuild variables included
Source: Railway, "Incident Report: October 21st Security Attack", read 27 November 2026. The figures count different things, so don't add them up.

The 100,000 figure is a ceiling. Railway’s logs show which environments were touched but not which variables, so it can’t say whose keys were really read. The 1,852 users had linked-account tokens decrypted (bring-your-own-key agent keys and GitHub OAuth tokens). Railway says it reset all of them, found no logins to Railway accounts with stolen credentials, and that its forensics “did not indicate customer databases were accessed.”

Where the keys went

Customers sent Railway the source IP addresses and sample requests they saw on their stolen keys. The traffic ranged “from coding agents to AI training pipelines,” which Railway says is consistent with the keys being handed to services that relay or resell access to AI providers. It believes the end use was distillation, where one model is trained on another’s answers. It also says it has not established whether the original attacker ran those services or sold the keys on.

Railway was not alone. Wiz’s write-up counts at least nine AI developer platforms that disclosed incidents during October, Railway among them. Wiz says there is “no single vulnerability or dependency linking these attacks.” What they share is the target: stored environment variables, above all the ones that grant AI access. Wiz also examined two keys stolen in vendor breaches (it doesn’t name the vendors). On both, the first model call came within 30 minutes of the reported credential access. Fireworks AI is on that list too; we covered what its exposed key led to in the Cursor breach.

Running up usage on someone else’s key has a name, LLMjacking, and we explain how the billing side works in how an AI model is served and billed.

Who pays

Railway’s preliminary report in October said it was “unable to refund customers for spend performed with compromised API keys.” The November report reverses that: for providers that won’t cover the losses, Railway says it will cover all token losses itself.

Refund position by provider, as of 10 November 2026

1AWS Bedrockexisting refund policy covers fraud, refunds startedrefund
2Google Geminiexisting refund policy covers fraud, refunds startedrefund
3OpenAIopen a support request, pass the case ID to Railwayby claim
4SpaceXSIsend the claim to Railway supportby claim
5Anthropictalks continuing, Railway covers the cost meanwhileRailway pays
6OpenRouterenforcing its no-refund policy, Railway covers the costno refund
Source: the "Unauthorized token spend" section of Railway's incident report, which describes the position "at the time of writing". Order is ours.

Two caveats, both raised by The Hacker News: the report doesn’t say how the $740,000 was estimated or what period it covers, and it sets no cap or deadline for claims.

Railway started at “unable to refund” and had changed position by 10 November. Don’t plan on that from your host.

What to do this week

If you had anything on Railway before 21 October, Railway’s own advice is to revoke and replace every sensitive variable stored there. It also says to remove public network access to your databases and to check the audit logs of your GitHub account and your container registry. Rotate at the provider that issued the key. Deleting the variable in Railway doesn’t cancel the key.

For everyone else, the following is our advice, not Railway’s.

  1. List every place each AI key is stored: hosting dashboards, CI settings, build arguments, your laptop. Build variables were read here too, so a key passed only at build time still counts.
  2. Use one key per app and per environment. When a platform tells you to rotate, you’ll know which key lived there.
  3. Put a spend limit and a usage alert on every AI provider account that offers them. A stolen key with a $200 ceiling is a bad afternoon.
  4. Where your cloud can issue short-lived credentials for model access, use those in place of a static key. Our note on AWS STS GetScopedCredentials shows one way.
  5. Practice the rotation once. Wiz saw two stolen keys in use within 30 minutes, so the time to find out where the revoke button is has to come before the alert.

Railway says every build now runs in its own short-lived virtual machine, with a credential that can push one specific image and nothing else, and that decrypt operations are centrally logged. Ask your own hosting platform how its builds are isolated and which of its systems can decrypt your variables.

Sources

All checked on 27 November 2026.

Every course, one plan

Move into AI security from the role you have

34 courses, 350+ videos, labs in your browser and on AWS, Azure and Google Cloud, graded capstones and a certificate for each course.

Regular price $49now $15.99a month Or regular price $299 $149.99 once for Lifetime access. Every course, every update. Final price: nothing is added at checkout.

Enroll now Explore our courses

Every TSG course

Enroll: Monthly or Lifetime

Both plans open every course on the platform, with every lab and every future update, the day you join.

  • 34courses
  • 350+videos
  • 3clouds included
  • All 34 courses, from Learn 101 to AI Security Engineer
  • 350+ videos across AI Security Engineer and the cloud courses, plus reading pages, quizzes and handbooks
  • Browser labs, laptop labs and cloud labs on AWS, Azure and Google Cloud
  • A certificate for each course you finish, with a public verify link
  • New courses at no extra cost, and every future update

Already a member? Sign in

Choose your plan
Need an invoice for a company?

Paid by card in US dollars. Final price: nothing is added at checkout. You pay on Razorpay's secure page; we never see your card or bank details.

  • Paid on Razorpay's secure page: Card, in US dollars
  • Refund policy