November 22, 2026

LiteLLM Supply Chain Breach: How a Leaked Master Key Led to the Distribution of Malicious Python Packages

The cybersecurity landscape has been served a stark reminder of the long-tail risks associated with secret mismanagement following a sophisticated supply chain attack targeting LiteLLM. On Friday, the developers behind the popular open-source large language model (LLM) gateway revealed a complex attack chain that culminated in the distribution of a compromised version of their Python package. The incident, which traces its roots back to a configuration error in May 2026, highlights the devastating efficiency with which threat actors can exploit unrevoked credentials to subvert automated build systems.

The breach centered on LiteLLM version 1.107.0, which was found to contain malicious code designed to harvest sensitive credentials and establish persistent backdoors on developer systems. According to LiteLLM’s leadership, the point of failure was not a sophisticated zero-day exploit, but rather a neglected administrative credential that remained active long after it was believed to have been neutralized.

The Genesis of the Breach: A Failure in Secret Revocation

The technical timeline of the incident began on May 27, 2026. During a routine development cycle, a configuration file was inadvertently committed to the public LiteLLM-Labs/lite-harness repository. This file contained the master key for a deployment of the LiteLLM Agent Platform, a tool used by the team for orchestrating various autonomous agents.

LiteLLM’s Oliver Jensen and Mateo Wang admitted that while the error was identified almost immediately, the remediation steps were incomplete. The team performed a "force-push" to overwrite the repository history, a common but often insufficient method for removing sensitive data from GitHub, as the data can often still be accessed via direct commit hashes or cached views. Critically, while the team identified that the exposed keys required revocation, the master key for the Agent Platform was overlooked during the cleanup process.

Leaked LiteLLM Master Key Let Attackers Steal GitHub Tokens and Hijack Release Pipeline

For nearly five months, this master key remained active and valid, sitting as a "sleeping" vulnerability within the organization’s infrastructure. It was not until October 10, 2026, that an unknown threat actor, operating from the IP address 69.48.229[.]143, utilized the unrevoked key to gain unauthorized access to the Agent Platform.

Once inside the platform, the attacker moved to escalate their privileges. They targeted and successfully extracted a GitHub CLI OAuth token. This specific token was configured to allow the service’s self-hosted cloud agents to file pull requests. However, the developers noted a critical security oversight: the token was "not scoped down." Instead of being limited to specific tasks or repositories, it was associated with the account of the GitHub organization’s owner. This gave the attacker owner-level permissions across the entire LiteLLM GitHub organization.

Exploiting Relaxed Security Protocols

The possession of an owner-level token allowed the threat actor to bypass several layers of traditional security. In a typical operational environment, LiteLLM maintained a rigorous release process. Building and publishing a new version of the software normally required an authorized engineer to initiate the process, followed by an approval from a "special account" that was physically locked to a hardware device located in the company’s office.

However, in the days leading up to the attack, these restrictions had been temporarily relaxed. The team was in the midst of a push for more frequent releases and bugfix backports, and to facilitate this speed, the protocol was adjusted to allow any two engineers to trigger and approve a release.

The attacker capitalized on this window of opportunity. Using the stolen owner-level credentials, they were able to act as both the initiator and the approver. By repointing the deployment mechanism to a malicious repository under their control, the threat actor successfully triggered the release of LiteLLM version 1.107.0. While the developers noted that the attacker could have used their owner-level access to remove the physical device restriction entirely, it is suspected that they chose to exploit the existing "two-engineer" relaxation to avoid triggering internal alarms.

Leaked LiteLLM Master Key Let Attackers Steal GitHub Tokens and Hijack Release Pipeline

Forensic Insights: The Hidden Workflows

Subsequent investigations by the application security firm Socket provided deeper insight into how the attacker managed the compromise without leaving a conspicuous trail in the repository’s primary history. Socket’s analysis revealed that the threat actor utilized short-lived branches, named with the prefix "ci-tmp-" followed by a hexadecimal string.

These branches were created, used to run malicious GitHub Actions workflows, and deleted within minutes. This "ephemeral branching" strategy ensured that the activity remained hidden from the repository’s ordinary commit history. Socket recovered two malicious commits made on October 10 and October 12, 2026, which added a workflow file located at .github/workflows/cache.yml.

These workflows were engineered for massive credential exfiltration. The October 10 workflow focused on harvesting GitHub tokens and API keys for the organization’s Linear workspace, Together AI, and the signing keys for a GitHub App. By October 12, the scope of the theft had expanded significantly. The updated workflow was designed to capture API keys for nearly every major AI provider, including OpenAI, Anthropic, and AWS Bedrock, as well as secrets for Tavily and the organization’s GitGuardian tenant.

The inclusion of the GitGuardian API key was particularly tactical. As a secret-scanning platform, GitGuardian is intended to alert developers when credentials are leaked. By compromising this key, the attacker gained visibility into—and potential control over—the very alerts that might have exposed their presence. Furthermore, the attacker exfiltrated "E2E_LINEAR_STORAGE_STATE_B64," which contains serialized browser session data. This allowed the attacker to gain authenticated access to the organization’s Linear account, effectively bypassing multi-factor authentication (MFA).

Anatomy of the Malicious Package

The impact of the breach extended far beyond LiteLLM’s internal systems once version 1.107.0 hit the public Python Package Index (PyPI). Detailed analysis from Microsoft Security Research and other firms revealed that the compromised package was designed to be exceptionally invasive.

Leaked LiteLLM Master Key Let Attackers Steal GitHub Tokens and Hijack Release Pipeline

The malware contained within the package featured two primary execution paths. The first was a comprehensive credential harvester. Unlike many malicious packages that only activate when a specific function is called, this malware was engineered to execute automatically as soon as Python started. This was achieved through the use of Python startup hooks. Because these hooks reside outside the standard LiteLLM application directory, simply deleting the LiteLLM package might not be enough to remove the infection; the malicious startup components could remain persistent on the host system.

The second path was a Unix-oriented backdoor. This background process was designed to "phone home" every hour to fetch and execute arbitrary code provided by the attacker. This established a persistent foothold on any system where the compromised package was installed, allowing for long-term surveillance or further exploitation.

The range of data targeted by the stealer was exhaustive. It collected system information, environment variables, SSH files, and tokens for a wide array of developer tools and package managers, including npm, PyPI, Yarn, Maven, and Cargo. All gathered data was compressed and exfiltrated via HTTP POST requests to a health-check endpoint on "litellm[.]dev," a domain the attacker had registered on October 13, 2026, to mimic official infrastructure.

Response and Remediation

In the wake of the discovery, LiteLLM has moved aggressively to contain the damage. The company is currently in the process of revoking every token and credential associated with their internal systems and third-party vendor platforms. They have also worked to correct earlier misconceptions about the attack; initial theories suggested the GitHub tokens might have been leaked through internal logs, but the discovery of the unrevoked May master key has clarified the actual entry point.

"The investigation was a process in which we continually learned additional information," acknowledged Oliver Jensen. He noted that as the team uncovered the depth of the workflow manipulation, they had to revise their understanding of the attacker’s capabilities and the extent of the data theft.

Leaked LiteLLM Master Key Let Attackers Steal GitHub Tokens and Hijack Release Pipeline

Security researchers emphasize that users who may have installed LiteLLM version 1.107.0 should do more than just update the package. Because the malware utilizes startup hooks that persist independently of the library, a thorough audit of the Python environment and a rotation of all potentially exposed secrets—including cloud provider keys, Git credentials, and AI API tokens—is considered essential.

This incident serves as a high-profile case study in the risks of the "move fast and break things" mentality often found in the rapidly evolving AI development space. The combination of a forgotten secret, a non-scoped token, and a temporary relaxation of security protocols provided a perfect environment for a supply chain compromise that has now impacted a broad segment of the developer community.