Railway Breach Turned Stolen AI Keys Into $740K in Free Compute

| 5 min read

Stolen AI credentials now work like cash, and Railway just found out how quickly a thief can spend it. The cloud hosting provider confirmed a nearly 26-hour fight against attackers who went after AI provider keys, which they planned to sell to AI "transfer stations" that support model distillation. Before Railway shut them out, the attackers ran up about $740,000 in fraudulent AI usage charges.

The exposure goes beyond the bill. Railway says the attackers may have had access to as many as 100,000 workspace credentials, and its own database searches put AI provider keys first, with some queries also targeting cloud, database, and payment service credentials. Railway hasn't shared the full scale of the exploitation while its investigation continues. Still, the incident shows where attackers are placing their bets: on machine identities that carry a price tag and rarely get watched closely.

How the intrusion unfolded

The attack began on October 20 with a previously unknown vulnerability in Railway's build infrastructure. The attackers got around filesystem isolation protections and grabbed an internal credential that opened stored build histories. From there, they pulled a copy of Railway's internal source code and studied it for other ways in.

They found one. An improperly configured trust relationship gave them broader access across Railway's infrastructure, including credentials capable of decrypting customer environment variables. That's the part that should worry platform operators most. Secrets stored as environment variables are only as safe as the system that holds the decryption keys, and in this case that system was reachable from a build pipeline.

Railway described the response as a "contest of agent speed." Its engineers worked in 24/7 shifts while the attacker chained exploits, moved laterally across systems, and "probed many potential routes, in parallel." Defenders hardened those routes in parallel too. As Railway put it, "This was not a single breach followed by a single fix." That line is worth remembering, because it describes most real incidents better than the clean post-mortem narrative many vendors prefer.

The attackers were fully evicted on October 21. By then, they had obtained and decrypted a subset of customer variables, roughly 100,000, which Railway says represents at most 1.85% of workspaces. The breach also exposed linked-account tokens for more than 1,850 users, including GitHub and OAuth tokens. Railway reset those and worked with GitHub, GitLab, Anthropic, OpenAI, OpenRouter, Stripe, and others to revoke potentially compromised keys.

Customer reports described the fraud in specific terms. Keys were used to answer coding questions and perform training-data tasks that the account owners never ran. Railway says it is reimbursing affected customers, including for charges that AI providers decline to refund. Whether every provider will cooperate on that is an open question, and it's one customers should press on.

Why AI keys are the target

David Shipley of Beauceron Security put it bluntly: "AI credentials are becoming the new credit card numbers." He expects so-called LLMjacking to displace cryptojacking as a cheap, scalable way to make money. My read is that he's right about the economics, even if the comparison will get more debate than it deserves.

Cryptojacking burned victims' compute to mine coins. LLMjacking skips the middleman. A stolen key gives direct access to frontier models that cost real money per token, and resellers can route that access through so-called AI routers to users who couldn't otherwise afford it, or couldn't reach it at all. Attackers also don't need to hunt one company at a time. A single platform that holds thousands of customers' secrets is a single point of harvest.

The buyer side is where it gets more interesting. Distillation transfers knowledge from a larger model to a smaller one, cutting costs and improving efficiency. It also takes enormous volume. Frank Dickson of Dickson Research pointed out that training one model on another's answers at scale takes millions of questions, and a single account firing off millions of queries stands out immediately. Stolen keys solve that detection problem by spreading the queries across thousands of real customers, each one looking like ordinary usage.

Dickson's analogy is the clearest I've seen: "Think of copying a textbook one page at a time, using library cards that belong to other people." The copier gets the knowledge for free. The cardholder gets the overdue notice. And with frontier AI priced per token, the owner of the key pays for every page.

He also framed it as a repeat of an old pattern: "It is the 2026 version of cryptomining; [the] same playbook with a different output." That's the sentence I'd put in front of any CFO who still thinks of AI keys as a developer convenience rather than a financial instrument.

Speed is the real problem

Rotation sounds simple until you account for how fast attackers move. An investigation by Wiz found that stolen keys were tested within 30 minutes of theft, then flooded with traffic four to seven days later. That gap is the window defenders have to work with. If rotation happens after the flood, the damage is already on the invoice.

Railway's own fixes point in the right direction. The company is moving to short-lived credentials and logging every decryption event. Dickson called that the right fix and said every platform holding customer secrets should copy it. Short-lived credentials shrink the value of a stolen key, and decryption logs turn a silent theft into a visible anomaly.

Dickson also credited Railway for a "remarkably candid report." The company admitted its own configuration mistake, acknowledged it can't be certain it found every account the attacker created, and committed to telling customers about issues faster in the future. Candor doesn't reverse the losses, but it's the kind of disclosure that lets other teams fix their own trust relationships before someone else exploits them.

What to do this week

If you run on Railway, Dickson's guidance is blunt: treat every secret stored on the platform as stolen until it's rotated. Railway has advised users to revoke and reapply sensitive environment variables stored before October 21, and it has recommended removing public network access to databases, rotating sensitive variables and keys, checking GitHub audit logs and reviewing all app access, and auditing registry logs such as Dockerhub.

Dickson's sequence is practical. Start with AI provider keys, then rotate cloud, database, and payment credentials. Check AI provider bills and usage logs for traffic your internal teams didn't generate, and report unauthorized charges to Railway. Set alerts for any API call from an address you don't recognize. Those steps take an afternoon and cover the most expensive exposure first.

Then limit the blast radius of any single key. Set hard spending caps and usage alerts on every AI key, and scope each one as narrowly as the provider allows. Dickson cited a case Wiz examined in which a key restricted to a narrow set of model profiles left most of the thief's traffic throttled. Least privilege isn't glamorous, but it's the difference between a bad afternoon and a five-figure invoice.

For teams on other platforms, Dickson suggests two questions for every provider: How are my secrets stored, and who can decrypt them? If the answers are vague, that's your signal. He also offered a principle worth repeating in every infrastructure review: issue fewer keys. "No one ever said during a key rotation that they wished they had issued more keys," he pointed out.

That's the thread running through this incident. A stolen AI key spends real money, and machines now hold most of the keys in most organizations. Dickson's closing line says it best: "Protect machine identities like cash, because to a thief, that is exactly what they are." Teams that still audit human accounts carefully while leaving service credentials sprawling across build pipelines and environment variables should expect this kind of bill to keep arriving.

Source: Christopher Brown · www.csoonline.com