Close Menu
Savannah HeraldSavannah Herald
    • Home
    • News
      • Local
      • State
      • National
      • World
      • HBCUs
    • Events
    • Directories
    • Weather
    • Traffic
    • Jobs
    • Sports
    • Politics
    • Lifestyle
      • Faith
      • Senior Living
      • Health
      • Travel
      • Beauty
      • Fashion
      • Food
      • Art & Literature
    • Business
      • Real Estate
      • Entertainment
      • Investing
      • Education
    • Guides
      • Summer Camp Guide
      • Juneteenth Guide
      • Black History Savannah
      • MLK Guide Savannah
    We're Social
    • Twitter
    • Facebook
    • YouTube

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    Trending
    • Off-Roading Adventures for Black Americans’ Physical and Mental Well-Being
    • Alicia Keys to Perform “Empire State of Mind” at Knicks Championship Celebration
    • Jelly Roll: Daughter Speaks As Fans React To Bunnie XO Divorce
    • MEAC adds women’s flag football and women’s golf
    • 10 Executive Branding Strategies | Obsidi®
    • JD Vance Faces off With ‘The View’ Hosts, Defends Trump Policies
    • Laughlin wins Work-Based Learning scholarship
    • The ‘Black Chef Series’ Is Turning Juneteenth Jubilee Into A Movement On Martha’s Vineyard –
    Facebook X (Twitter) Instagram YouTube
    Login
    Savannah HeraldSavannah Herald
    Savannah HeraldSavannah Herald
    Home » Shai-Hulud Malware in PyTorch Lightning: A Critical Supply Chain Attack Analysis
    Tech

    Shai-Hulud Malware in PyTorch Lightning: A Critical Supply Chain Attack Analysis

    Savannah HeraldBy Savannah HeraldMay 23, 20268 Mins Read
    Facebook Twitter Pinterest LinkedIn WhatsApp Reddit Tumblr Email
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Tomorrow’s Tech, Today: Innovation That Moves Us Forward

    Key takeaways
    • Cross-ecosystem worm propagation from the Python ecosystem into npm, enabling cascading, multi-ecosystem supply chain compromise.
    • Multiple parallel exfiltration channels and comprehensive credential harvesting ensured data theft and persistence across cloud, GitHub, and local environments.
    • Persistence via developer tool hooks and malicious workflows demanded immediate remediation: rotate credentials, audit repositories, and patch dependencies.

    Introduction

    On April 30, 2026, the Python ecosystem faced a significant supply chain attack when the PyPI package ‘lightning’ (PyTorch Lightning) was compromised in versions 2.6.2 and 2.6.3. This sophisticated attack, attributed to the same threat actor behind the previous “Mini Shai-Hulud” campaign, demonstrates the evolving sophistication of supply chain attacks targeting AI and machine learning infrastructure.

    The attack is particularly concerning because PyTorch Lightning is a widely-used deep learning framework that appears in the dependency trees of countless projects building image classifiers, fine-tuning large language models, running diffusion models, and developing time-series forecasters. A single pip install lightning command was all that was needed to activate the malicious payload.

    Attack Overview

    Affected Versions

    The compromise affected two specific versions:

    • lightning version 2.6.2
    • lightning version 2.6.3

    These versions contained hidden _runtime directories with obfuscated JavaScript payloads that executed automatically upon module import. This means any developer or CI/CD pipeline that installed these versions during the affected window became compromised.

    Attack Scope

    The malware’s reach extends far beyond the initial PyPI compromise. The attack includes sophisticated worm propagation mechanisms that spread to npm packages if npm publish credentials are discovered. This cross-ecosystem spread represents a new level of threat sophistication, where a single compromised package can trigger cascading attacks across multiple package management systems.

    Technical Analysis

    Payload Delivery Mechanism

    The malicious code was delivered through a hidden _runtime directory containing:

    • _runtime/start.py: A Python loader that initializes the payload on import
    • _runtime/router_runtime.js: An obfuscated JavaScript payload (14.8 MB, Bun runtime)

    The use of obfuscation and a large payload size suggests the attackers invested significant effort in evading detection. The 14.8 MB size is particularly notable, as it indicates the payload includes a complete Bun runtime environment.

    Data Exfiltration Channels

    The malware implements four parallel exfiltration channels, ensuring stolen data gets out even if individual paths are blocked:

    1. HTTPS POST to C2: Direct communication with attacker-controlled servers over port 443. The domain and path are stored as encrypted strings, making static analysis more difficult.

    2. GitHub Commit Search Dead-Drop: The malware polls GitHub’s commit search API for commit messages prefixed with “EveryBoiWeBuildIsAWormyBoi”, which carry double-base64-encoded tokens. This clever technique uses GitHub’s public infrastructure as a dead-drop for stolen credentials.

    3. Attacker-Controlled Public GitHub Repo: The malware creates new public repositories with randomly chosen Dune-themed names and descriptions like “A Mini Shai-Hulud has Appeared”. Stolen credentials are committed as base64-encoded JSON files, with large files split into numbered chunks.

    4. Victim’s Own Repository: If the malware obtains a GitHub server token (ghs_), it pushes stolen data directly to all branches of the victim’s own repository.

    Credential Harvesting

    The malware targets credentials across multiple systems:

    Filesystem: Scans 80+ credential file paths for GitHub tokens (ghp_, gho_) and npm tokens (npm_), reading up to 5 MB per file.

    Environment: Executes gh auth token and dumps all environment variables from process.env.

    GitHub Actions: On Linux runners, dumps Runner.Worker process memory via embedded Python and extracts all secrets marked “isSecret”:true, along with GITHUB_REPOSITORY and GITHUB_WORKFLOW.

    Cloud Providers:

    • AWS: Attempts environment variables, ~/.aws/credentials profiles, IMDSv2, and ECS endpoints to call sts:GetCallerIdentity. Enumerates and fetches all Secrets Manager values and SSM parameters.
    • Azure: Uses DefaultAzureCredential to enumerate subscriptions and access Key Vault secrets.
    • GCP: Authenticates via GoogleAuth and enumerates Secret Manager secrets.

    This comprehensive credential harvesting approach means any machine that imported the malicious package during the affected window should be treated as fully compromised.

    Persistence Mechanisms

    Once inside a repository, the malware plants persistence hooks targeting two critical developer tools:

    Claude Code Integration: The malware writes a SessionStart hook into .claude/settings.json with matcher: "*", pointing to node .vscode/setup.mjs. This hook fires every time a developer opens Claude Code in the infected repository — no tool use or user action required.

    VS Code Integration: A parallel hook targets VS Code users via a runOn: folderOpen task in .vscode/tasks.json that runs node .claude/setup.mjs every time the project folder is opened.

    Dropper Execution: Both hooks invoke setup.mjs, a self-contained Bun runtime bootstrapper. If Bun isn’t installed, it silently downloads bun-v1.3.13 from GitHub releases, handling multiple architectures (Linux x64/arm64/musl, macOS x64/arm64, Windows x64/arm64).

    Malicious GitHub Actions Workflow: If the malware holds a GitHub token with write access, it pushes a workflow named “Formatter” to the victim’s repository. On every push, it dumps all repository secrets via ${{ toJSON(secrets) }} and uploads them as downloadable Actions artifacts.

    Indicators of Compromise

    Organizations should search for these indicators:

    • Commit messages prefixed with “EveryBoiWeBuildIsAWormyBoi”
    • GitHub repositories with description “A Mini Shai-Hulud has Appeared”
    • Unexpected files in .claude/ and .vscode/ directories
    • Unexpected GitHub Actions workflows named “Formatter”
    • Suspicious entries in .vscode/tasks.json or .claude/settings.json

    Remediation Steps

    Immediate Actions

    1. Identify Affected Systems: Check all development machines and CI/CD pipelines for lightning versions 2.6.2 or 2.6.3.

    2. Upgrade Immediately: Update to a patched version of lightning (2.6.4 or later).

    3. Credential Rotation: Rotate all GitHub tokens, cloud credentials, and API keys that may have been present in affected environments.

    4. Repository Audit: Search all repositories for the indicators of compromise listed above.

    5. CI/CD Review: Examine CI/CD logs for suspicious activity, particularly around the time the malicious package was installed.

    Long-Term Mitigation

    1. Dependency Scanning: Implement automated tools like Semgrep to detect malicious dependencies before they reach production.

    2. Supply Chain Verification: Use tools that verify package integrity and check for known vulnerabilities.

    3. Principle of Least Privilege: Limit the permissions of CI/CD tokens and development credentials.

    4. Code Review: Implement mandatory code review processes that include security scanning.

    5. Monitoring: Set up alerts for unusual credential access patterns or unexpected repository modifications.

    Broader Implications

    Rising Threat Landscape

    This attack is part of a concerning trend. According to security research, there have been 7 major supply chain attacks in the past 12 months, compared to only 9 in the two decades before that. The frequency and sophistication of these attacks are increasing dramatically.

    Cross-Ecosystem Attacks

    Unlike the previous Mini Shai-Hulud campaign that targeted npm directly, this attack demonstrates the ability to compromise one ecosystem (PyPI) and use it as a springboard to attack another (npm). This cross-ecosystem approach significantly expands the potential impact.

    AI/ML Infrastructure Vulnerability

    The targeting of PyTorch Lightning specifically highlights the vulnerability of AI and machine learning infrastructure. These tools are often installed in high-value environments with access to significant computational resources and sensitive data.

    Community Response

    Semgrep has released advisories and detection rules to help organizations identify compromised packages. The security community is actively tracking the threat actor’s infrastructure and working to disrupt their operations.

    However, the incident highlights a systemic issue: the Python ecosystem, like many package management systems, lacks robust mechanisms for detecting and preventing supply chain attacks before packages reach users.

    Lessons Learned

    For Developers

    1. Verify Package Sources: Always verify that packages come from official sources.
    2. Use Lock Files: Implement dependency lock files to ensure reproducible builds.
    3. Monitor Dependencies: Regularly audit your dependency tree for known vulnerabilities.
    4. Principle of Least Privilege: Run development tools with minimal necessary permissions.

    For Package Maintainers

    1. Secure Credentials: Protect PyPI credentials with strong authentication and minimal scope.
    2. Code Review: Implement mandatory code review processes.
    3. Automated Testing: Use automated security scanning in your CI/CD pipeline.
    4. Transparency: Communicate security incidents promptly and clearly.

    For Package Repositories

    1. Enhanced Scanning: Implement more sophisticated malware detection.
    2. Behavioral Analysis: Monitor for suspicious patterns in package behavior.
    3. Rapid Response: Develop faster processes for removing malicious packages.
    4. Community Coordination: Work with security researchers to identify threats early.

    Conclusion

    The Shai-Hulud malware in PyTorch Lightning represents a sophisticated and concerning evolution in supply chain attacks. The attack’s use of multiple exfiltration channels, cross-ecosystem propagation, and persistence mechanisms demonstrates that threat actors are investing significant resources in compromising critical infrastructure.

    While the immediate threat has been addressed through package updates and security advisories, the incident serves as a stark reminder of the vulnerabilities in our software supply chains. Organizations must implement comprehensive security practices, including dependency scanning, credential management, and continuous monitoring.

    The Python ecosystem, and particularly the AI/ML community, must work together to develop more robust defenses against supply chain attacks. This includes better tooling for detecting malicious packages, stronger authentication mechanisms for package maintainers, and more rapid response procedures for removing compromised packages.

    For organizations that may have been affected, immediate action is required: identify affected systems, rotate credentials, and audit repositories for signs of compromise. The threat is real, but with proper vigilance and security practices, the impact can be minimized.

    For more information and detection rules, visit: https://semgrep.dev/blog/2026/malicious-dependency-in-pytorch-lightning-used-for-ai-training/

    In case you have found a mistake in the text, please send a message to the author by selecting the mistake and pressing Ctrl-Enter.

    Read the full article on the original site


    AI and Machine Learning ai infrastructure Black Technologists credential theft Cybersecurity Cybersecurity News Digital Innovation Emerging Technologies Future of Work Gadget Reviews Innovation in Education malware Minorities in Tech pypi python pytorch Security Silicon Valley Updates Smart Devices Software Development Startup News STEM News supply chain attack Tech Culture Tech Equity Tech for Good Tech Industry Updates Tech Trends Technology News threat analysis
    Share. Facebook Twitter Pinterest LinkedIn WhatsApp Reddit Tumblr Email
    Savannah Herald
    • Website

    Related Posts

    Tech June 17, 2026

    10 Executive Branding Strategies | Obsidi®

    Tech June 16, 2026

    What Are Google Gemini Gems?

    Tech June 16, 2026

    Scottish minister clarifies police facial-recognition approach

    Tech June 16, 2026

    Intel CPUs with Nvidia RTX integrated graphics are targeting an early 2028 release

    Tech June 15, 2026

    This Ultra-Thin Inspection Borescope With iPhone & Android Support Is 50% Off For Limited Time

    Tech June 15, 2026

    Cameras, sensors, and 3D body scans: All the tech helping eliminate blown calls

    Comments are closed.

    Don't Miss
    Business August 28, 2025By Savannah Herald04 Mins Read

    There is an assault on media like ours. Public Media and how it can be dismantled was apart of Project 2025. Now we’re being sued too.

    August 28, 2025

    Empowering Black Entrepreneurship: Stories of Success, Strategy & Growth What is Project 2025? Project 2025…

    Africa’s Business Heroes launches 8th edition with $1.5m in funding available for African entrepreneurs

    May 2, 2026

    Juicy Turkey Burgers (Stove & Air Fryer)

    September 13, 2025

    Remarkable Lion’s Hair Steaks – Sugary Food Potato Spirit

    January 5, 2026

    BET Icon Debra Lee Debuts New Luxury Handbag Line – Essence

    May 28, 2026
    Archives
    • June 2026
    • May 2026
    • April 2026
    • March 2026
    • February 2026
    • January 2026
    • December 2025
    • November 2025
    • October 2025
    • September 2025
    • August 2025
    • July 2025
    • June 2025
    • May 2025
    • April 2025
    • March 2025
    • February 2025
    Categories
    • Art & Literature
    • Beauty
    • Black History
    • Business
    • Climate
    • Culture
    • Education
    • Employment
    • Entertainment
    • Faith
    • Fashion
    • Food
    • Gaming
    • Georgia Politics
    • HBCUs
    • Health
    • Health Inspections
    • Investing
    • Lifestyle
    • Local
    • Lowcountry News
    • National
    • National Opinion
    • News
    • Politics
    • Real Estate
    • Senior Living
    • Sports
    • State
    • Tech
    • Traffic
    • Transportation
    • Travel
    • World
    Savannah Herald Newsletter

    Subscribe to Updates

    A round up interesting pic’s, post and articles in the C-Port and around the world.

    About Us
    About Us

    The Savannah Herald is your trusted source for the pulse of Coastal Georgia and the Low County of South Carolina. We're committed to delivering timely news that resonates with the African American community.

    From local politics to business developments, we're here to keep you informed and engaged. Our mission is to amplify the voices and stories that matter, shining a light on our collective experiences and achievements.
    We cover:
    🏛️ Politics
    💼 Business
    🎭 Entertainment
    🏀 Sports
    🩺 Health
    💻 Technology
    Savannah Herald: Savannah's Black Voice 💪🏾

    Our Picks

    Black midwives challenge regulations in Alabama, Georgia, Mississippi

    June 5, 2026

    Surrounded Pork Chops Dish

    October 3, 2025

    Democrats Divided On Plan To End Government Shutdown

    November 5, 2025

    Honoring our Fallen Heroes: Annual Memorial Day celebration held by Post 32

    November 11, 2025

    The Discerning Telling of the Saltville Carnage

    July 12, 2025
    Categories
    • Art & Literature
    • Beauty
    • Black History
    • Business
    • Climate
    • Culture
    • Education
    • Employment
    • Entertainment
    • Faith
    • Fashion
    • Food
    • Gaming
    • Georgia Politics
    • HBCUs
    • Health
    • Health Inspections
    • Investing
    • Lifestyle
    • Local
    • Lowcountry News
    • National
    • National Opinion
    • News
    • Politics
    • Real Estate
    • Senior Living
    • Sports
    • State
    • Tech
    • Traffic
    • Transportation
    • Travel
    • World
    Copyright © 2002-2026 Savannahherald.com All Rights Reserved. A Veteran-Owned Business

    Type above and press Enter to search. Press Esc to cancel.

    Manage Consent
    To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
    Functional Always active
    The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
    Preferences
    The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
    Statistics
    The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
    Marketing
    The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
    • Manage options
    • Manage services
    • Manage {vendor_count} vendors
    • Read more about these purposes
    View preferences
    • {title}
    • {title}
    • {title}
    Ad Blocker Enabled!
    Ad Blocker Enabled!
    Our website is made possible by displaying online advertisements to our visitors. Please support us by disabling your Ad Blocker.

    Sign In or Register

    Welcome Back!

    Login below or Register Now.

    Lost password?

    Register Now!

    Already registered? Login.

    A password will be e-mailed to you.