PyTorch Lightning Backdoored for 42 Minutes — Your CI Ran During That Window
What Happened
On April 30, attackers compromised PyPI publishing credentials for PyTorch Lightning and pushed tampered versions 2.6.2 and 2.6.3. The packages were live for 42 minutes before being yanked. The payload executes on import, not on an explicit function call. It spawns a background thread that your application never sees, installs the Bun JS runtime, and runs obfuscated JavaScript that scrapes cloud credentials, browser secrets, .env files, and GitHub tokens.
The Python-to-Bun hop is the interesting part. Most Python scanners stop at the language boundary. The malware crosses it deliberately.
Why 42 Minutes Is Not Short
A CI pipeline pulling pip install lightning without hash pinning takes 2-4 minutes to resolve, install, and cache. One CI run inside that window is enough to bake the tampered artifact into a Docker image that will sit in the registry for months. The image looks clean to every scanner because the malware already ran and exfiltrated. The payload is ephemeral. The damage is permanent.
Cross-Source Pattern: Credential Theft Is the 2026 Attack Vector
This is not one incident. The same report surfaces the Checkmarx KICS compromise: stolen publisher credentials used to push malicious images to Docker Hub. GitHub Actions' structural flaws — mutable action references, overpermissive default tokens — add more injection points. The pattern is consistent. Compromise a publishing credential, push to a trusted registry, let the trust chain do the rest.
Verification Protocol
- Check pip install logs, Docker build logs, and lockfiles for April 30 installs of
lightning==2.6.2orlightning==2.6.3 - If your lockfile has hash pinning and the hash matches the clean release, and the install step enforces hashes, you are probably fine
- If the build resolves fresh on every run (
pip install lightningwithout version pin), diff what shipped during the window against what is in the registry now - If affected, rotate ALL cloud credentials, GitHub tokens, and secrets reachable from those environments
The Structural Fix
The boring, known, underdeployed pattern. Hash-pinned requirements — the hash, not just the version. Egress monitoring on training and inference nodes, where the exfil would show as unexpected outbound from a training pod. A private PyPI mirror with provenance checks. The SSH honeypot data from the same reporting tells you the threat density: 7,556 attacking IPs hit a single port-22 endpoint in 54 days, with 99.6% pure automation.
What to do
Search all CI/CD logs, Docker build histories, and pip install traces for PyTorch Lightning 2.6.2 or 2.6.3 installs on April 30
Rotate ALL cloud credentials, GitHub tokens, and environment secrets on any machine that installed the affected versions
Add --require-hashes to all pip install commands in CI pipelines by end of this sprint
Implement egress monitoring alerts on training and inference nodes for unexpected outbound connections