LiteLLM 1.107.0 Compromised, Railway Breached: How Attackers Came for AI API Keys, and What It Cost

On the same day, a backdoored LiteLLM release hit PyPI and Docker, and Railway disclosed that customer secrets were decrypted. Both postmortems are out: one unrevoked key, one build sandbox escape, and about $740,000 in stolen AI spend.

A conveyor belt of sealed parcels in a dim warehouse, one parcel glowing red through a split seam

Last updated: November 15, 2026.

What's new: both companies have published root-cause reports. LiteLLM traced its breach to an administrative key leaked in May and never revoked, which replaces the "tokens in gateway logs" theory in our first version. Railway's full report, published November 10, explains how the attacker escaped a build sandbox, how many workspaces were exposed, and that stolen AI keys ran up about $740,000 in fraudulent charges.

On October 21, 2026, two companies that sit between developers and AI models had very bad days.

In the morning, a backdoored release of LiteLLM, the open-source gateway many teams use to route requests to OpenAI, Anthropic and other model providers, was published to PyPI and Docker Hub. A few hours later, cloud platform Railway paused deployments worldwide and told every customer to rotate the secrets stored in their environment variables.

The two incidents have no confirmed link. But they were after the same thing. Railway's forensics found that AI provider keys were the attacker's "primary target," and the LiteLLM attacker was seen testing stolen cloud credentials against AI model services within hours. If you build with AI, your API keys are now a primary target.

LiteLLM 1.107.0 and Railway at a glance

LiteLLM 1.107.0

Railway

What happened

Malicious package and Docker images published through a hijacked release pipeline

Attacker escaped a build sandbox, moved through internal systems and decrypted customer environment variables

Root cause

An admin key exposed in a public repo in May 2026, deleted but never revoked

A previously unknown build-isolation flaw, an over-trusted build credential and a misconfigured cloud identity binding

Exposure window

PyPI: 11:39 to 13:23 UTC; Docker tags: until 14:20 UTC, Oct 21

Attacker active Oct 20 to 09:24 UTC Oct 21

Scale

About 49,000 downloads, per Wiz

Up to about 100,000 workspaces (1.85%) had variables decrypted; 1,852 users' linked tokens exposed

Known damage

Stolen cloud credentials tested against AI services within 4.5 hours; no victim has publicly confirmed a breach

About $740,000 in unauthorized AI spend on stolen keys

Primary action

Treat the host as compromised, rebuild, rotate everything it could reach

Rotate every secret at its source provider, then check provider bills

What happened with LiteLLM 1.107.0?

LiteLLM 1.107.0 is a malicious release of the LiteLLM Python package and Docker images, published on October 21, 2026 after attackers compromised the project's release pipeline. Every one of its seven PyPI wheels carried a credential stealer, and on Linux and macOS it also installed a loader that downloads and runs new code every hour.

The package was live on PyPI from 11:39 to 13:23 UTC, according to The Hacker News. The Docker tags v1.107.0, latest, main-latest and main-stable on Docker Hub and GitHub Container Registry pointed at the infected image until 14:20 UTC. If you install LiteLLM unpinned, or your containers pull latest, a routine rebuild during that window was enough.

This is the second LiteLLM supply chain attack of 2026. In March, versions 1.82.7 and 1.82.8 were published after attackers came in through a compromised Trivy security scanner, according to Security Boulevard, an attack later linked to the TeamPCP hacking group; Australian police have charged two men alleged to be members, according to The Record. No source has linked the March and October attacks.

How did attackers hijack the LiteLLM release?

LiteLLM's first theory, on October 21, was that GitHub CLI tokens had leaked through the logs of an internet-exposed internal deployment. Its root-cause analysis, published on October 23, found a simpler and more avoidable cause. As summarized by Security Boulevard, GitGuardian and The Record:

  1. May 27, 2026: a configuration file containing an administrative key for LiteLLM's internal AI agent platform was committed to a public GitHub repository. Someone noticed and deleted the file about three hours later, but the commit stayed in public history and the key was never revoked. LiteLLM put it down to human error.
  2. October 10: about 136 days later, the attacker used that key to call the agent platform and retrieve the GitHub CLI token of a LiteLLM GitHub organization owner. The token wasn't limited to specific repositories.
  3. October 10 to 12: the attacker harvested CI secrets, including tokens belonging to two more maintainers, from throwaway branches.
  4. Earlier the week of October 19: LiteLLM had relaxed its release gate so any two engineers could trigger and approve a release, instead of requiring an approver on a registered device.
  5. October 21: branch protection rejected the attacker's push, so they overrode it with the owner's token. A stolen maintainer token approved the production release, which was built from a lookalike repository, Berri-AI/litellm with a hyphen, instead of the official BerriAI/litellm, according to StepSecurity.

The official v1.107.0 source tag is clean; the tampering is in the build config, the wheels and the images. A clean source repository tells you nothing about the package you actually installed. And a secret deleted from a repository is still a live secret until it's revoked.

What does the LiteLLM 1.107.0 malware steal?

According to StepSecurity's analysis, the stealer runs every time Python starts (through a cook.pth file), not only when you import LiteLLM. It collects:

  • Cloud credentials: AWS, Azure and Google Cloud files, plus role credentials pulled from cloud instance metadata services.
  • Developer secrets: SSH and GPG keys, .env files, Kubernetes configs, Docker, npm, PyPI and GitHub CLI tokens.
  • CI and infrastructure secrets: GitLab Runner, Jenkins, Vault and Terraform credentials, Kubernetes service account tokens and /run/secrets.
  • AI tool credentials: stored tokens for AI coding tools including Claude Code, Cursor, Copilot, Gemini CLI and Codex.
  • Browser data: saved passwords, cookies and history.
  • The LiteLLM proxy database: if DATABASE_URL is set, it dumps stored provider credentials and model configs, which means every upstream AI API key your gateway holds.

Stolen data goes, encrypted, to litellm.dev, a domain registered on October 13, 2026. On Linux and macOS, a background process then checks a GitHub dead drop every hour for a server address and runs whatever it finds at /codepy. That turns an infected host into a remote access trojan.

The LiteLLM damage

  • Reach: Wiz estimated about 49,000 downloads of 1.107.0 during the window, based on ClickPy data. How many of those ran on machines holding valuable secrets isn't known.
  • Use of stolen credentials: Wiz saw instance-role credentials harvested from CI runners and Kubernetes nodes in several environments, and the attacker validating stolen AWS credentials about 4.5 hours after exfiltration, then listing the AI models available through Amazon Bedrock. That pattern is consistent with LLMjacking: using someone else's cloud account to run expensive AI models at their cost.
  • Confirmed victims: as of mid-November, no affected organization had publicly confirmed a breach linked to the release, according to The Record. Microsoft hasn't confirmed that a second-stage payload ran anywhere.
  • Not affected: LiteLLM says enterprise customers who install from its private registry were not impacted.

For scale, the March attack is a warning about what a stealer like this collects. Hudson Rock analyzed a 153 GB archive of data stolen in that campaign and attributed 118,829 CI runner dumps to 2,488 corporate domains, according to GitGuardian. There's no equivalent count for October yet.

How LiteLLM fixed it

LiteLLM revoked tokens across its internal systems and vendor platforms, restored its release workflow, published its root-cause analysis, and told anyone who installed 1.107.0 on an internet-connected machine to assume every credential on it was stolen. It has since moved releases to a private repository, made Docker tags immutable and started signing images.

What happened at Railway?

On October 21, 2026, Railway, a cloud platform for deploying web apps and services, disclosed that an unauthorized third party had accessed the encrypted environment variables of its customers and, for some of them, obtained the decrypted values. Environment variables are where most apps on Railway keep their API keys, database passwords and container registry credentials.

Railway published a preliminary report on October 22 and a full incident report on November 10.

How the Railway attacker got in

According to Railway's full report:

  1. October 18: the attacker started creating dummy Railway accounts, according to Security.io's summary of the report.
  2. October 20, 07:28 UTC: using a previously unknown vulnerability, the attacker partially escaped filesystem isolation in Railway's shared build environment. That exposed a credential the build servers used to talk to internal systems.
  3. The over-trusted credential: Railway's internal Temporal workflow system accepted that build credential as a trusted client. Through it, the attacker read 353 build histories, including sealed variables, between 13:50 and 15:30 UTC, and copied Railway's internal code repository.
  4. October 21, 03:26 UTC: the attacker found a wrongly configured cloud identity (OIDC) binding that handed out short-lived cloud credentials.
  5. October 21, 04:07 to 07:15 UTC: using internal credentials and an orchestration machine, the attacker queried the database of encrypted variables and decrypted a subset through Railway's key management service.
  6. October 21, 09:24 UTC: Railway fully evicted the attacker. It found no customer data access after 09:25.

Railway's monitoring did page an engineer at 13:58 UTC on October 20, and builds were halted that afternoon. The attacker still moved faster than the response, probing several routes in parallel. Railway said evidence indicated the attacker used "abliterated" AI models, meaning open-weight models with their safety refusals stripped out. Railway has not named an attacker.

The Railway damage

  • Exposed secrets: environment variables were decrypted for at most about 100,000 workspaces, 1.85% of the total. Railway stresses that's an upper bound: its key logs show which environments had keys unwrapped, not which individual variables were taken.
  • Linked accounts: BYOK agent keys and GitHub OAuth tokens for 1,852 users were exposed and reset. Railway found no logins to Railway accounts using stolen credentials.
  • Fraud: Railway estimates about $740,000 in unauthorized spending on stolen keys. Its forensics indicate AI provider keys were the main target and that they were passed on to resale "transfer stations" for model distillation, though it hasn't established whether the original attacker ran those services.
  • Not accessed: Railway says it has no indication the attacker downloaded customer repositories or snapshots, and forensics did not show customer databases were accessed.
  • Downtime: builds stopped worldwide. They came back in stages on October 22 (Enterprise at 03:32 UTC through Free and Trial at 22:49 UTC), and new sign-ups were paused until November 2.

How Railway fixed it

Paying for the fraud. AWS Bedrock and Google Gemini have started refunds under their existing fraud policies. OpenAI and SpaceXSI are reviewing cases one by one. Railway is covering Anthropic charges while talks continue, and is paying the costs itself for OpenRouter, which has a no-refund policy. Railway says it will cover losses from any provider that won't refund. Customers can report unauthorized charges through the form in Railway's incident report.

Rebuilding the platform. Railway says it:

  • Moved every build into its own short-lived virtual machine, with a credential that can only push that build's image. The shared systems the attacker abused are retired.
  • Restricted secrets so only the secrets service can reach the keys that unlock them, each service can decrypt only what it needs, and every encrypt and decrypt operation is centrally logged.
  • Rebuilt its CI pipeline with separated sensitive components, 2FA and biometric approval in critical areas, network isolation and SIEM alerting.
  • Moved service accounts to least privilege, with short-lived, just-in-time credentials where possible.
  • Rotated all keys, rebuilt infrastructure tooling from validated source, revoked all Railway API tokens and rolled every GitHub App installation.

Are the LiteLLM and Railway incidents connected?

There's no public evidence that the same group carried out both. What connects them is the target and the method. Both attacks went after AI provider keys, both moved through developer infrastructure rather than end users, and both turned stolen keys into AI usage within hours.

They also weren't alone. Microsoft says the ConnectWise Cloud Backup attack the same week was carried out with an agentic AI penetration-testing framework, and Railway says its attacker used AI models with their safety guardrails removed. AI API keys have become one of the most valuable credentials in a modern stack, and attackers are using AI to steal them faster. They're spent like cash, they often carry high spending limits, and they're stored in exactly the places these attacks hit: AI gateways, environment variables and developer machines.

How to check if you're affected by LiteLLM 1.107.0

Run these checks on every developer machine, CI runner and container that uses LiteLLM. Don't run python or pip inside a suspect environment to check, because that runs the malware again.

  1. Search lockfiles and requirements for litellm==1.107.0, and check whether any build pulled LiteLLM unpinned between 11:39 and 13:23 UTC on October 21.
  2. Look for the payload files in Python site-packages:

find / -name "cook.pth" -path "*site-packages*" 2>/dev/null
find / -type d -name "litellm-1.107.0.dist-info" 2>/dev/null
ls -la /tmp/remote_code_loader.lock 2>/dev/null && lsof /tmp/remote_code_loader.lock

  1. Check container images that used the latest, main-latest, main-stable or v1.107.0 tags: docker images --digests, then inspect running containers for cook.pth.
  2. Search network and DNS logs for litellm.dev, requests to raw.githubusercontent.com/letters9813/, or any request to a /codepy path. A /codepy request means remote code already ran.
  3. Check AWS CloudTrail for GetCallerIdentity calls from instance roles around the time of installation, a sign stolen credentials were being tested.

If you find any of it, treat the host as fully compromised. Uninstalling isn't enough; Microsoft put it plainly: removing the package or a release tag is not sufficient recovery. Rebuild the environment from trusted artifacts on a clean pinned version such as 1.106.2, which StepSecurity lists as clean, and block litellm.dev at DNS or egress. Then, from a clean machine, rotate every credential the host could reach, including LiteLLM's own master key, salt key, database password and every provider key stored in its database.

What Railway customers should do now

Railway asked all users to act, not only those who got an email. If you haven't finished, the order of operations matters:

  1. Inventory every variable by name for each service and environment, including sealed variables. Railway's report confirms the attacker read sealed values in build histories.
  2. Rank by damage potential: AI provider keys and cloud keys first, then database credentials, payment keys like Stripe, source and registry tokens, then everything else.
  3. Rotate at the source, not just in Railway. Changing the value in Railway doesn't revoke the old key at AWS, OpenAI or GitHub. Create the new key, update Railway, deploy, verify, then revoke the old one.
  4. Use Railway's Regenerate option for managed databases rather than editing passwords by hand.
  5. Reconnect GitHub and create new Railway API tokens for CI and scripts.
  6. Check for misuse, then claim it back. Review AI provider usage and billing, AWS CloudTrail, Google Cloud audit logs, database session lists and GitHub audit logs. Report unauthorized charges to each provider and through Railway's form.

Pro tip: check your AI providers' usage dashboards first, and keep checking after you rotate. LLMjacking shows up as a spending spike long before anything else looks wrong, and a rotated key that's still being used means something was missed.

What these attacks mean for security teams

Neither postmortem describes anything exotic. LiteLLM's breach began with a secret that was deleted instead of revoked. Railway's turned a small sandbox escape into a platform-wide breach because one credential was trusted far more than it needed to be. The fixes both companies shipped (per-build isolation, least-privilege service accounts, short-lived credentials, device-bound release approval) are standard practice that wasn't fully in place.

Those fixes come from a handful of roles that are in demand for exactly this reason:

Browse open roles across all four on ThreatHire.

LiteLLM and Railway FAQ

Which LiteLLM versions are compromised?

Only LiteLLM 1.107.0 is compromised in the October 2026 incident: all seven PyPI wheels, plus the Docker tags v1.107.0, latest, main-latest and main-stable while they pointed at the infected image on October 21. StepSecurity lists 1.106.x, 1.105.x, 1.104.x, 1.103.x and the 1.107.0rc1 and rc2 release candidates as clean. Separately, versions 1.82.7 and 1.82.8 were malicious in the March 2026 incident.

How did hackers compromise LiteLLM?

An administrative key for LiteLLM's internal agent platform was committed to a public repository on May 27, 2026, then deleted but never revoked. On October 10 the attacker used it to steal a GitHub organization owner's token, harvested more maintainer tokens, and on October 21 used them to override branch protection and approve a malicious release.

Is it safe to use LiteLLM now?

Pinned, verified clean versions are safe to use, according to the researchers who analyzed the attack. Pin to an exact version such as 1.106.2, or pull images by digest rather than tag. LiteLLM has since moved releases to a private repository, made Docker tags immutable and started signing images.

How did Railway get hacked?

According to Railway's November 10 report, an attacker used a previously unknown vulnerability to partially escape its shared build environment, took a build credential that internal systems trusted too much, then used a misconfigured cloud identity binding to reach the key service and decrypt customer environment variables. The attacker was active from October 20 until 09:24 UTC on October 21.

How many Railway customers were affected?

Railway says environment variables were decrypted for at most about 100,000 workspaces, 1.85% of the total, and calls that an upper bound. Linked-account tokens for 1,852 users were also exposed. Railway estimates about $740,000 in unauthorized spending on stolen keys and says it will cover losses that AI providers won't refund.

What is LLMjacking?

LLMjacking is the theft and abuse of cloud or AI provider credentials to run large language models at the victim's expense. Attackers either use the models themselves or resell the access. It typically shows up as unexpected model usage and large bills, which is why AI usage dashboards are one of the first places to check after a credential leak.

Sources

about the author

The ThreatHire Editorial Team tracks the cybersecurity job market daily, aggregating security roles from Greenhouse, Lever, and 200+ company career pages. The team combines this real-time hiring data with independent research to report on compensation, in-demand skills, certifications, and hiring trends across security engineering, AppSec, cloud security, incident response, threat intelligence, GRC, and more.