A new and sophisticated supply chain attack campaign named "Hades Cluster" has been identified on the Python Package Index (PyPI). The campaign, disclosed on June 7, 2026, has compromised at least 19 legitimate packages, mainly within the scientific and deep-learning ecosystems. The malware's novelty lies in its execution and persistence mechanism: it abuses Python's .pth startup hook files. This technique allows the malicious code to run automatically every time a Python interpreter starts, evading detection tools that focus on more common infection points like setup.py. The malware then uses the Bun JavaScript runtime to facilitate credential harvesting. This campaign is believed to be linked to TeamPCP, the group that recently open-sourced the Shai-Hulud worm, suggesting a rapid evolution and proliferation of these attack methods.
The Hades Cluster campaign represents a tactical evolution in PyPI supply chain attacks. Instead of relying on typosquatting or embedding malicious code directly in a package's setup.py file, the attackers are using a more obscure feature of Python's packaging system. This demonstrates a deeper understanding of the target environment and a conscious effort to evade existing security controls.
The attack targets developers, particularly those in data-intensive fields like scientific research and deep learning, who are likely to have access to valuable data, computational resources, and cloud credentials. By compromising their development environments, the attackers can potentially steal sensitive research, gain access to powerful GPU clusters, or pivot into corporate cloud environments.
The core of the attack is the abuse of Python's path configuration (.pth) files.
pip. During installation, the package drops a malicious *-setup.pth file into the Python site-packages directory. This is a form of T1195.001 - Compromise Software Supply Chain..pth files are processed by Python on startup to add directories to sys.path. However, they can also execute arbitrary code if a line starts with import. The attackers leverage this to create a startup hook. Every time the developer runs python, pip, or any tool that uses the Python interpreter, the malicious code in the .pth file is executed. This provides a highly effective and stealthy persistence mechanism (T1547.001 - Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder, adapted for the Python environment).setup.py or the package's source code for malicious behavior. The .pth file is often overlooked as a simple configuration file, allowing the malware to bypass scrutiny (T1036.005 - Masquerading: Match Legitimate Name or Location).T1552 - Unsecured Credentials).The link to TeamPCP and their Shai-Hulud worm suggests that open-sourcing malware is leading to rapid innovation and adaptation by other threat actors, creating a more diverse and unpredictable threat landscape.
The impact of this campaign is primarily on the developers and organizations that use the compromised packages. The consequences include:
No specific package names, hashes, or C2 domains were provided in the source articles.
To hunt for this type of attack, security teams should:
site-packages/**/*.pth.pth files in Python environments. Any file containing more than simple directory paths should be considered highly suspicious.bun.exebun.exe) in an environment where it is not expected or officially used is a strong indicator of compromise.Network connections from python.exepython.exe process at startup, before any user script is run. This could indicate a malicious startup hook phoning home.import '...'.pth files for lines starting with import, which is the mechanism for code execution..pth files.bun.exe..pth files. D3FEND's File Analysis (D3-FA) is a relevant concept.M1048 - Application Isolation and Sandboxing..pth Files: As a specific countermeasure, organizations can implement scripts that audit all Python environments and flag any .pth file that contains executable code.Use ephemeral, containerized, or sandboxed environments for builds to prevent persistent changes to the build system.
While difficult for interpreted languages, strict auditing and control over what code can be executed at startup can help.
Organizations must specifically adapt their system file analysis to hunt for this threat. A recurring script should be deployed across all developer workstations and CI/CD runners to scan all Python environments. This script must inspect the contents of every .pth file within site-packages directories. Legitimate .pth files typically only contain directory paths. The script should flag any .pth file that contains the string import, as this is the trigger for arbitrary code execution. This is a highly specific and effective detection method that directly targets the core TTP of the Hades Cluster campaign. Flagged files should be immediately quarantined for manual review.
For critical development environments, use hardware-based process isolation and sandboxing for running builds and testing dependencies. Instead of installing packages directly on a developer's machine or a persistent build server, use ephemeral containers (like Docker) or lightweight VMs for every pip install command. The container should be destroyed after the build is complete. This ensures that even if a malicious package like those in Hades Cluster is installed, its persistence mechanism (the .pth file) is wiped out at the end of the build. This prevents the compromise from persisting and spreading, effectively containing the threat to a single, temporary build.
A key observable in this attack is the use of the Bun JavaScript runtime. Most corporate environments, especially in scientific research, will not have a legitimate business need for bun.exe. Security teams should use application control software (like Windows Defender Application Control) to create a denylist rule that blocks the execution of bun.exe across the enterprise. This is a simple but powerful countermeasure. If the Python startup hook executes and attempts to bootstrap the Bun runtime, the action will be blocked and logged, immediately alerting security teams to the compromise attempt and preventing the final credential harvesting stage from running.
The 'Hades Cluster' campaign is first disclosed.
Details of the campaign are shared more widely on platforms like Reddit.

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.
Help others stay informed about cybersecurity threats
Every tactic, technique, and sub-technique used in this threat has been identified and mapped to the MITRE ATT&CK framework for consistent, actionable threat language.
Observables and indicators of compromise (IOCs) have been extracted and cataloged. Risk has been assessed and correlated with known threat actors and historical campaigns.
Detection rules, incident response steps, and D3FEND-aligned mitigation strategies are included so your team can act on this intelligence immediately.
Structured threat data is packaged as a STIX 2.1 bundle and can be visualized as an interactive graph — relationships between actors, malware, techniques, and indicators.
Sigma detection rules are derived from the threat techniques in this article and can be converted for deployment across any major SIEM or EDR platform.