A recent supply chain attack has compromised the release process of AsyncAPI npm packages, injecting the Miasma malware into trusted software components. This breach poses significant risks to developer systems and automated build environments, as attackers leveraged the project’s legitimate npm namespace to distribute malicious code.
The affected packages, including `@asyncapi/generator` version 3.3.1, `@asyncapi/generator-helpers` version 1.1.1, `@asyncapi/generator-components` version 0.7.1, and `@asyncapi/specs` versions 6.11.2-alpha.1 and 6.11.2, collectively account for approximately 2.9 million weekly downloads. While download figures do not confirm infections, the widespread use of these tools in development workstations, documentation jobs, and CI/CD pipelines—environments often containing sensitive credentials—amplifies the potential impact.
Security researchers at Cato Networks identified the malicious activity through supply chain intelligence monitoring. They discovered that attackers exploited a vulnerable GitHub Actions configuration, allowing untrusted pull request content to interact with a privileged workflow context. This vulnerability enabled unauthorized repository changes, leading to the publication of compromised packages through the project’s official npm namespace.
The attack’s sophistication lies in its use of the project’s own publishing automation to release the altered packages, making them appear legitimate. This method contrasts with traditional typosquatting attacks, where malicious packages are published under deceptive names. Instead, by infiltrating the trusted release process, the attackers ensured that the compromised packages bore the official AsyncAPI branding, increasing the likelihood of widespread adoption.
The Miasma malware employs a stealthy execution strategy. The injected JavaScript code does not rely on common npm lifecycle scripts like postinstall. Instead, it activates when an affected module is imported, allowing the malware to remain dormant post-installation and execute later during a build, application run, documentation task, or CI/CD job. The initial stage launches a detached Node.js process that downloads an encrypted second-stage payload from the InterPlanetary File System (IPFS). This payload can maintain access, execute remote commands, manage files, update itself, and communicate with attacker-controlled infrastructure.
This incident underscores the evolving nature of supply chain attacks, where adversaries target automation processes to gain access to secrets and downstream projects. It highlights the necessity for developers and organizations to scrutinize their CI/CD configurations and implement robust security measures to safeguard against such sophisticated threats.