@sql-trigger/nodesqlnpm
Malicious code in @sql-trigger/nodesql (npm) Remove it immediately and rotate any exposed credentials.
What this malware does
The package advertises itself as a simple SQL helper but its main entry index.js is heavily obfuscated (obfuscator.io string-array + RC4 + base64, 218-entry shuffled literal array, two RC4 decoders) with no human-readable logic. After deobfuscation, the top-level IIFE requires os/fs/path/child_process/axios, installs uncaughtException and unhandledRejection handlers to suppress errors, then assembles an IPv4 address at runtime by concatenating four numeric octets with '.', issues an axios HTTP GET to that host, writes the response body into os.tmpdir() with flag 'w+', and invokes child_process exec/spawn on the written file with windowsHide:true and cwd set to the tmp directory. This is a generic remote-binary dropper: the destination is mutable, the payload is opaque and unverified, the URL is built at runtime to evade static scanners, and the fetched file is unrelated to any SQL functionality. The dropper fires the moment any consumer require()s the package, so installing this dependency results in attacker-controlled code being downloaded to and executed from the consumer's temp directory.
Malicious versions
Indicators of compromise (SHA-256)
Frequently asked questions
Campaign
References
Credits
- Amazon Inspector · finder
Scan your dependencies
O3 Security blocks malicious packages like this at install time and in CI.
Supply-chain protection