On October 21, 2026, a compromised version of the LiteLLM 1.107.0 package was uploaded to the Python Package Index (PyPI), leading to significant credential theft across various environments. The malicious package executed code during Python’s initialization, allowing it to run without explicit importation of LiteLLM, thereby affecting a wide range of systems, including developer workstations and CI/CD pipelines, as detailed by Microsoft.
The attack exploited stolen GitHub credentials to alter the release workflow, redirecting it to a malicious repository. This manipulation enabled the attacker to embed malicious Python startup files that executed automatically, targeting sensitive authentication data from developer tools, cloud environments, and browsers. Microsoft’s analysis revealed that the credential collector could be triggered simply by starting Python in an affected environment, raising serious concerns about the security of systems that had installed the compromised package.
Attack Mechanism and Impact
The compromised LiteLLM package utilized Python’s startup mechanisms to execute malicious code, which meant that exposure was not limited to systems actively using the LiteLLM gateway. The malicious code was designed to collect sensitive data, including API keys, database connection strings, and user credentials, from various sources. The collector operated in a daemon thread, allowing it to gather data even if some targets were unavailable.
Upon collection, the data was encrypted using AES-256 and transmitted to an attacker-controlled endpoint. The payload also included a Unix-oriented loader capable of retrieving and executing additional Python code, although this functionality was not confirmed during the investigation. This dual mechanism of credential collection and potential remote code execution significantly broadened the attack surface.
Mitigation Strategies
In response to the incident, Microsoft has outlined several mitigation strategies for organizations that may have been affected by the compromised LiteLLM package:
- Identify and contain affected copies: Organizations should locate all instances of LiteLLM 1.107.0 across their environments, including internal package mirrors and container images.
- Prevent Python execution: It is crucial to isolate affected systems and avoid running Python commands that could trigger the malicious code during investigation.
- Rebuild from verified artifacts: Organizations should ensure that all malicious startup files are removed and rebuild their environments from clean sources.
- Rotate credentials: All credentials that may have been exposed should be rotated from a secure environment.
- Restrict outbound access: Implementing strict outbound traffic controls can help prevent further data exfiltration.
As of October 22, 2026, Microsoft Defender has released several detection signatures to identify and block malicious activity associated with the compromised LiteLLM package. Organizations are encouraged to onboard their systems to Microsoft Defender for Endpoint to enhance their security posture against such threats.
This incident underscores the importance of securing the software supply chain and maintaining vigilance against credential theft, particularly in environments that rely heavily on open-source packages. For further technical details and guidance, organizations can refer to Microsoft’s comprehensive analysis of the LiteLLM compromise.
For more information on the technical aspects of this incident, refer to the detailed report by Microsoft Security Blog here.


