Dev.to Security 🔐 Cybersecurity 👁 2 📖 2 min read

GHSA-QMJC-65WP-7V34: GHSA-QMJC-65WP-7V34: Software Supply-Chain Compromise and Remote Code Execution in PyPI Package magique

GHSA-QMJC-65WP-7V34: Software Supply-Chain Compromise and Remote Code Execution in PyPI Package magique Vulnerability ID: GHSA-QMJC-65WP-7V34 CVSS Score: 8.7 Published: 2026-12-02 GHSA-QMJC-65WP-7V34 documents a sof

GHSA-QMJC-65WP-7V34: Software Supply-Chain Compromise and Remote Code Execution in PyPI Package magique

Vulnerability ID: GHSA-QMJC-65WP-7V34
CVSS Score: 8.7
Published: 2026-12-02

GHSA-QMJC-65WP-7V34 documents a software supply-chain compromise targeting the Python Package Index (PyPI) package magique. Threat actors utilized stolen maintainer credentials to publish unauthorized phantom releases (versions 0.6.8 and 0.6.9) directly to PyPI on June 8, 2026. These distributions contain a malicious .pth path configuration file that automatically triggers an embedded JavaScript payload via the Bun runtime upon Python interpreter startup, resulting in credential theft, process memory scraping, and worm-like self-propagation.

TL;DR

Versions 0.6.8 and 0.6.9 of the PyPI package magique were compromised via a maintainer account takeover during the Hades wave of the Shai-Hulud campaign. Installing these versions drops a malicious .pth file into site-packages that executes an embedded Bun JavaScript payload on every Python interpreter invocation, harvesting local credentials, scraping process memory, and attempting self-propagation across other PyPI packages.

⚠️ Exploit Status: ACTIVE

Technical Details

  • Advisory ID: GHSA-QMJC-65WP-7V34 (PYSEC-2026-592 / MAL-2026-5296)
  • Weakness Class: CWE-506 (Embedded Malicious Code) & CWE-829
  • Attack Vector: Supply-Chain Phantom Release & Python .pth Startup Hook
  • CVSS v4.0 Score: 8.7 High (CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N)
  • Threat Campaign: Shai-Hulud Campaign (Hades Wave)
  • Payload Runtime: Polyglot Python .pth to Embedded Bun (JavaScript) Runtime
  • Impact: Arbitrary Code Execution, Process Memory Scraping, Credential Theft & Self-Propagation
  • Exploit Status: Active Supply-Chain Compromise (June 2026)

Affected Systems

  • Python environments installing magique==0.6.8 or magique==0.6.9 from PyPI
  • Developer workstations and CI/CD pipelines resolving unpinned magique dependencies between June 8, 2026 and package removal
  • magique: >= 0.6.8, <= 0.6.9 (Fixed in: < 0.6.8 (Malicious versions yanked from PyPI))

Exploit Details

  • PyPI Inspector: Archived forensic evidence of the malicious magique-setup.pth startup hook distributed inside the magique 0.6.9 wheel archive.

Mitigation Strategies

  • Pin all Python dependencies to exact versions and enforce cryptographic hash verification using pip's --require-hashes flag.
  • Implement egress network filtering on CI/CD runners and build environments to block unauthorized outbound connections during package installation and testing.
  • Monitor Python site-packages directories for the introduction of unexpected .pth files containing executable 'import ' statements.
  • Enforce PyPI Trusted Publishing (OIDC) and mandatory Two-Factor Authentication (2FA) for package maintainer accounts to prevent credential-based account takeovers.

Remediation Steps:

  1. Locate and manually delete 'magique-setup.pth' from all Python site-packages directories prior to invoking Python or pip commands.
  2. Terminate any active 'bun' or 'bun.exe' child processes spawned from Python environments.
  3. Uninstall the compromised magique package ('pip uninstall -y magique') or pin the dependency strictly to versions below 0.6.8 ('magique<0.6.8').
  4. Rotate all local and environment secrets on affected hosts, including PyPI API tokens, GitHub PATs, SSH keys, and cloud provider credentials (AWS, GCP, Azure).
  5. Audit PyPI publishing logs for any packages maintained by affected developers to ensure the malware's self-propagation routine did not publish unauthorized releases.

References

Read the full report for GHSA-QMJC-65WP-7V34 on our website for more details including interactive diagrams and full exploit analysis.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.