pylithium PyPI dependency-confusion malware: environment fingerprinting and exfiltration via Sentry endpoint
Severity: medium · Patch status: no-fix-needed · Since 2026-12-03
A malicious PyPI package named 'pylithium' was published as a dependency-confusion attack against Tesla's internal liblithium library, disguised as a simple electrical calculator. Versions 0.0.1, 0.0.2, 0.1.0 and 1.0.1 override the install command in setup.py to execute malicious code during installation, and also trigger on import and at Python process start via a PTH file. The code fingerprints the environment and reports data such as IP address and username to a Sentry endpoint; collected data appears not to be highly sensitive. The advisory classifies it as PROBABLYPENTEST with limited risk. No patched versions exist; the package is malware and should be removed, not upgraded.
What to do
- Check whether pylithium is installed anywhere in your environment (pip list, lockfiles, CI caches) and remove it immediately
- Audit pip configuration and internal package indexes to ensure internal names like liblithium are registered or blocked on public PyPI
- Rotate or review any credentials/secrets accessible from affected build or developer machines
- Hunt for Sentry endpoint traffic or PTH files in site-packages indicating execution
- Pin dependencies and use hash verification / private indexes to prevent future dependency confusion
Sources
All live incidents on Threat Watch