Miasma Malware Creates Backdoors in npm Packages, Targets Dev Machines
Key Takeaways Miasma v3 malware has re-emerged, infecting four legitimate AsyncAPI packages on npm. The malware establishes persistent backdoors on developer machines, allowing remote access and...
Key Takeaways
- Miasma v3 malware has re-emerged, infecting four legitimate AsyncAPI packages on npm.
- The malware establishes persistent backdoors on developer machines, allowing remote access and control.
- Unlike typical malware, Miasma v3 activates when an infected module is loaded, not during package installation, making detection difficult.
- Compromised systems could expose sensitive data like source code, cloud credentials, and signing keys.
- Immediate action is required to identify, isolate, and remediate affected systems and rotate all relevant credentials.
The Miasma malware has resurfaced, infiltrating trusted software packages used by numerous developers. Four AsyncAPI packages available on npm were maliciously altered to deliver a Miasma v3 payload, thereby creating persistent backdoors for remote access to affected systems.
Table Of Content
This sophisticated campaign distinguishes itself by not relying on malware execution during package installation. Instead, the hidden malicious code activates when an application, code generator, or build process loads an infected module. This delayed activation can allow the compromise to go unnoticed for an extended period, increasing the potential for damage.
Researchers at JFrog uncovered this activity by meticulously tracking the modified releases and successfully decoding the downloaded payload. JFrog said in a report that traditional package origin records cannot fully protect projects when attackers manage to alter a source branch responsible for triggering releases.
A compromised account or build runner can lead to the exposure of critical assets, including source code, package registry tokens, cloud credentials, signing keys, and deployment secrets. Furthermore, the attacker gains an encrypted communication channel, enabling further commands and control over the compromised environment.
Miasma Turns Trusted npm Packages Into Persistent Backdoors
The tainted releases were published through AsyncAPI’s legitimate GitHub Actions release workflow, leveraging npm’s OIDC trusted-publisher integration. While these packages carried valid provenance attestations, the release process was subverted through an unauthorized direct commit to the repository’s release-triggering branch. This sequence is crucial because the workflow executed its intended function: publishing code from the project. Consequently, provenance accurately indicated the genuine repository and workflow but could not ascertain whether the underlying code change itself had undergone proper review or authorization.
The compromised packages do not contain malicious preinstall, install, or postinstall scripts. Instead, attackers embedded an obfuscated code block within standard source files, where network access and process creation would typically be unexpected. This malicious code was further concealed using whitespace to evade detection during code reviews.
When Node.js loads a modified module, the embedded code initiates a detached child process, allowing the legitimate application or CI task to proceed without interruption. This child process then retrieves a second-stage file from an IPFS gateway, writes it to a user-profile directory under a deceptive, plausible filename, and executes it in the background.
The recovered second-stage payload has been identified as Miasma v3. While its broader codebase includes capabilities for credential theft, package propagation, AI-tool poisoning, and mutation, the specific configuration observed primarily focuses on achieving persistence, establishing remote communications, enabling shell execution, and facilitating payload replacement, rather than automatic self-spreading.
Any project merely containing an affected version might not have executed the malware. However, a developer machine, documentation generation job, container build, or CI runner that loaded any of the affected code should be considered potentially compromised.
Persistent Access Raises the Stakes
Miasma v3 establishes encrypted communication channels and actively checks for updates to its infrastructure or new payloads. Its robust command handler allows an operator to execute arbitrary shell commands, receive output, fetch replacement code from IPFS, and modify its callback interval, effectively granting the attacker full control under the breached account’s privileges.
The malware also attempts to achieve user-level persistence across Linux, Windows, and macOS operating systems. While some of these persistence methods may fail, this does not impede the initial backdoor or the active command-and-control channel from functioning.



No Comment! Be the first one.