Briefing

Backdoored PyTorch Lightning package drops credential stealer

security
by Bill Toulas ·

Rotate all secrets, avoid importing PyTorch Lightning 2.6.3, and use version 2.6.1 until the audit completes.

What to do now

Rotate all secrets, avoid importing PyTorch Lightning 2.6.3, and use version 2.6.1 until the audit completes.

Summary

On May 4, 2026, a malicious version of the PyTorch Lightning package (v2.6.3) was discovered on PyPI, delivering a credential‑stealing payload that triggers automatically upon import. The hidden execution chain downloads the Bun JavaScript runtime (v1.3.13) from GitHub and runs an 11.4 MB obfuscated payload named router_runtime.js, targeting .env files, API keys, GitHub tokens, and credentials stored in Chrome, Firefox, and Brave browsers, as well as cloud provider APIs for AWS, Azure, and GCP. Microsoft Defender identified the activity as “ShaiWorm” and prevented execution in customer environments, reporting that only a small number of devices were affected. Lightning AI’s advisory warned that users who imported v2.6.3 may have had secrets compromised and recommended immediate rotation of all secrets. The package has since been reverted to the safe v2.6.1 release on PyPI, and all recent releases are being audited for similar payloads. The incident underscores the risk of supply‑chain attacks in popular Python libraries and the need for vigilant version management. Users should avoid importing v2.6.3 until the audit is complete and verify that no credentials were exfiltrated. The incident also highlights the importance of monitoring for unexpected background processes in Python environments.

Key changes

  • v2.6.3 of PyTorch Lightning contains hidden execution chain that downloads Bun runtime and runs 11.4 MB JS payload
  • Payload targets .env files, API keys, GitHub tokens, browser credentials, and cloud provider APIs
  • Microsoft Defender detected activity as “ShaiWorm” and prevented execution; only a small number of devices affected
  • Users who imported v2.6.3 may have had secrets compromised; immediate rotation recommended
  • Package reverted to safe v2.6.1 on PyPI; all recent releases are being audited
  • Incident demonstrates supply‑chain risk in popular Python libraries
  • Users should avoid importing v2.6.3 until audit completes
  • Verify that no credentials were exfiltrated

Affects

enterprise internal

Customer impact

Analyzing matches…

Ask about this story

Impact on an agency? Which customers? Compare historically Risks of waiting