Article
LiteLLM 1.107.0 Supply Chain Attack: Timeline, Stolen Data and a Response Checklist
LiteLLM 1.107.0 on PyPI and Docker carried a credential stealer on 21 October 2026. See the timeline, what it took and a checklist to…
Quick links
Press Enter to search, Esc to close
Attack technique
Python Startup Hooks let an attacker run code every time Python starts.
In short
Python Startup Hooks let an attacker run code every time Python starts. A file dropped into the Python packages folder is processed by the interpreter itself, so the code runs even if the program never imports anything from it. MITRE tracks this as T1546.018.
MITRE says adversaries may use Python’s startup mechanisms for persistence. These are path configuration files with the .pth extension, and the sitecustomize.py or usercustomize.py modules. Python processes them automatically when the interpreter initializes, so arbitrary code can run whenever Python is invoked.
MITRE explains that a .pth file placed in a site-packages or dist-packages folder has any line that begins with import executed on every Python run. A sitecustomize.py or usercustomize.py file in the Python path is imported at startup, and the code in it runs. MITRE adds that adversaries may abuse this on systems where Python is widely used, for example for automation or scripting in production.
MITRE lists the TeamPCP Cloud Stealer, which used .pth files to persist on compromised hosts, and Mini Shai-Hulud, which used Python startup hooks to run through the .pth import mechanism. On 21 October 2026 Socket mapped the malicious LiteLLM 1.107.0 release to this technique. A cook.pth file imported a stealer at every Python start, and a sitecustomize.py file started a background loader. In March 2026, LiteLLM 1.82.8 also carried a .pth file, litellm_init.pth, per a public GitHub issue and the PyPA advisory. See the LiteLLM 1.107.0 incident profile and our LiteLLM 1.107.0 response checklist.
MITRE's detection strategy DET0258 looks for unauthorized creation or change of Python hook files in site-packages, dist-packages or user paths.
MITRE says to correlate those file writes with unexpected interpreter runs, such as python3 starting without user interaction, and with changes in interpreter behavior such as malicious imports.
MITRE also points to outbound connections started from Python, and to child processes that look out of place, after a hook file was written.
Socket notes that sitecustomize.py can be a legitimate file, so a hit on the name is a reason to read the file, not proof of compromise.
MITRE says this technique cannot be easily mitigated with preventive controls, because it abuses system features. Detection and package hygiene matter more.
Socket's LiteLLM advice is to block the bad version and compare published distributions against the intended source, including data folders and startup files.
LiteLLM tells affected users not to run pip install first, because Python startup re-runs the malicious files. It recommends rebuilding images and virtual environments from scratch.
List every .pth, sitecustomize.py and usercustomize.py in your site-packages folders and read the ones you did not put there.
MITRE describes it as a path configuration file that extends Python's module search path. A line that begins with import in such a file is executed when Python starts.
Yes, for this technique. MITRE says the hook files run whenever Python is invoked, and SafeDep says the LiteLLM 1.107.0 files ran even on hosts where litellm was never imported.
No. Socket notes that the file name can be legitimate, so check who created the file and what it contains.
Take control of your digital security with an exclusive demo of our AI-driven threat intelligence platform.