MAL-2025-190636
Malicious code in @asyncapi/generator (npm)
Details
--- _-= Per source details. Do not edit below this line.=-_
## Source: amazon-inspector (271b2ffc02354a99b950c43cd98e81e855e4ec554a445246410b25ab57cf3313) lib/templates/config/validator.js contains a javascript-obfuscator string-array block (variables `_0x1dd48b`/`_0x2d89`, base64+URI-decode decoder with rotation) injected between legitimate functions. The block requires `fs`, `path`, `https`, `child_process.spawn`, and `os`, and invokes a top-level `main()` that calls `spawn(<decoded-node-binary>, ['-e', <decoded-payload>], {detached:true, stdio:'ignore', windowsHide:true}).unref()`. The `-e` argument is a ~4KB base64-encoded JavaScript body reconstructed from the obfuscated string array. The command name, `-e` flag, `stdio` value, and payload are all hidden behind the string-array decoder. Because validator.js is reachable via `require()` in this widely-used generator, loading the module launches a hidden, detached Node child process running attacker-supplied code with `fs`/`https`/`os` capabilities on the installer's machine. The obfuscation, mismatch with the file's declared validator purpose, and injection between existing functions are inconsistent with a legitimate maintainer change and match a compromised-release pattern.
## Source: ghsa-malware (5c0426c37a66378442886f4b63503a263f38e5172b7ef21b9bd129968b6bcb4b) Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.
## Source: google-open-source-security (074df24b3cee0a10eed786c44c2bbb0e21e0ede618c9686506504ec843695775) This package was compromised by the Sha1-Hulud: The Second Coming NPM worm. The malicious payload steals tokens and credentials and publishes them to GitHub. The worm will propogate itself to NPM packages the user owns and establish persistence is a GitHub action. The package may also destroy the user's home directory.
Are you affected?
Enter the version of the package you're using.
Affected packages
No fixed version published yet for @asyncapi/generator (npm). Pin to a known-safe version or switch to an alternative.
References
- https://github.com/advisories/GHSA-9658-p648-rc4q [ADVISORY]
- https://www.aikido.dev/blog/shai-hulud-strikes-again-hitting-zapier-ensdomains [WEB]
- https://www.wiz.io/blog/shai-hulud-2-0-ongoing-supply-chain-attack [WEB]
- https://www.stepsecurity.io/blog/sha1-hulud-the-second-coming-zapier-ens-domains-and-other-prominent-npm-packages-compromised [WEB]
- https://www.npmjs.com/package/@asyncapi/generator/v/3.3.1 [PACKAGE]