UTC

PyTorch Lightning PyPI compromise

Two releases of lightning on PyPI ran injected code on import that started an infostealer aimed at credentials, CI secrets and cloud secret stores. It tried to spread with stolen tokens and left hooks in Claude Code and VS Code settings to run again. The maintainers have not published a root cause.

First seen
2026-04-30
Disclosed
2026-04-30
Affected packages
1
Attributed to
No public attribution

What to do

Delete 2.6.2 and 2.6.3, assume the environment is compromised, rotate API keys, tokens, SSH keys and service-account credentials, and rebuild from a clean state. Check Claude Code and VS Code settings for hooks you did not add. Pin 2.6.1, or 2.6.4 and later.

Check a lockfile for these releases →
Affected releases
PackageRegistryVersions
lightningPyPI2.6.2, 2.6.3

Written up from the sources above and last checked on 2026-11-18. ShieldMap describes what was affected and what to do; it does not publish the malicious code or how it worked. Report a correction to [email protected].