Semgrep reports that the PyPI package **lightning**—a widely used deep learning framework for training and inference—was compromised in versions **2.6.2** and **2.6.3** in a supply chain attack published on **April 30, 2026**. The malicious code activates simply when the package is imported, meaning `pip install lightning` could expose developers and CI systems to infection.
The payload hides in a `_runtime` directory and runs an obfuscated JavaScript malware component that **steals credentials, authentication tokens, environment variables, and cloud secrets**. It also attempts to **poison GitHub repositories** by planting persistence mechanisms and spreading to other packages. Semgrep says the campaign appears tied to the same actor behind the **Mini Shai-Hulud** malware family, using similar Dune-themed naming and commit-message patterns such as **EveryBoiWeBuildIsAWormyBoi**.
Unlike the earlier npm-focused campaign, this attack starts in **PyPI** but uses **npm** for propagation. If it finds npm publish credentials, it injects malicious files into packages the token can publish, adds a `preinstall` script, bumps the patch version, and republishes the package so downstream users are infected too.
The malware exfiltrates data through multiple channels: HTTPS to attacker infrastructure, GitHub commit-search dead drops, attacker-controlled public repos, and direct pushes to victim repositories when possible. It targets local files, shell environment variables, GitHub Actions secrets, and major cloud providers including **AWS, Azure, and GCP**.
Semgrep advises affected users to audit repos for injected files, rotate exposed credentials, and check whether their projects installed the compromised versions.
Article timeline
Build this article’s timeline
Extract dated events, key actors, and open questions using the same timeline analysis available in Signal.
Semgrep reports that the PyPI package **lightning**—a widely used deep learning framework for training and inference—was compromised in versions **2.6.2** and **2.6.3** in a supply chain attack published on **April 30, 2026**.
🤖 AI prefill
📅WhenWhen did this happen, or what is the timeframe?
📍Where
RSA, Linux, and macOS
🤖 AI prefill
💡Why
Centers on PyPI package lightning, supply chain attack, and credential-stealing malware
🤖 AI prefill
Login to answer and earn XP for each gap you fill.
Comments
Login to view and post comments.