Skip to content
Tech News
← Back to articles

Backdoored PyTorch Lightning package drops credential stealer

read original get PyTorch Lightning Security Patch → more articles
Why This Matters

The discovery of a backdoored version of the PyTorch Lightning package highlights the ongoing risks of supply chain attacks in the software industry, especially for widely used open-source tools. This incident underscores the importance of rigorous security practices for developers and organizations relying on third-party packages to prevent credential theft and data breaches.

Key Takeaways

A malicious version of the PyTorch Lightning package published on the Python Package Index (PyPI) delivers a credential-stealing payload targeting browsers, environment files, and cloud services.

The developer disclosed the supply-chain attack on April 30, saying that version 2.6.3 of the package included a hidden execution chain that downloads and executes a JavaScript payload.

PyTorch Lightning is a deep learning framework used for pretraining and fine-tuning AI models. It is a popular package, amassing more than 11 million downloads last month.

The security advisory from the maintainer notes that the malicious execution chain triggers automatically on import and silently spawns a background process.

Spawning a background process

Source: GitHub

That process downloads a JavaScript runtime (‘Bun v1.3.13’) from GitHub, and executes a 11.4 MB heavily obfuscated JavaScript payload (‘router_runtime.js’).

In a post over the weekend, Microsoft Threat Intelligence says that Defender detected and prevented the malicious routine on customer environments, and notified the package maintainer.

The payload, which Defender detects as “ShaiWorm,” is an information-stealing malware that targets .env files, API keys, secrets, GitHub tokens, and data stored in Chrome, Firefox, and Brave browsers.

It also interacts with cloud service APIs (AWS, Azure, GCP) to steal credentials and supports arbitrary system command execution.

... continue reading