@tqm-mfe/mainnpm
Malicious code in @tqm-mfe/main (npm) Remove it immediately and rotate any exposed credentials.
What this malware does
scripts/postinstall.js is a heavily obfuscated (obfuscator.io-style: 270+ entry rotated string array, RC4+base64 decoders, hex-encoded dispatchers) lifecycle script that runs automatically on npm install. On execution it (1) checks process.argv, process.env.NODE_OPTIONS, and process.execPath against decoded debug/inspector markers plus a wall-clock timing loop to skip the malicious branch under sandboxes and analyzers, then (2) performs an HTTPS fetch of a remote binary payload to a destination assembled at runtime from RC4/base64 fragments, (3) XOR-decrypts the response with a keyed buffer, (4) writes the decrypted files into a per-platform persistent app-data directory (Windows %APPDATA%/%LOCALAPPDATA%, macOS/Linux equivalents) via fs-extra copy/rename, (5) marks them executable, and (6) spawns them detached with stdio:'ignore' and windowsHide:true, unref'd from the installer process to survive after npm exits. In parallel, a beacon posts JSON containing the package name/version, an ISO timestamp, and a system object built from os.homedir(), os.type(), os.platform(), os.hostname(), and os.arch() to a runtime-decoded URL. The package's public metadata (author [email protected], repository github.tqm-mfe.io, homepage docs.tqm-mfe.io, README framing as an internal corporate mirror) does not correspond to a real public project and is consistent with a dependency-confusion lure targeting organizations that might resolve the @tqm-mfe scope from the public registry. All URLs, filenames, keys, and paths are decoded at runtime and none of this behavior is required by the advertised 'API mocking middleware' functionality.
Malicious versions
Indicators of compromise (SHA-256)
Detection & response playbook
Backdoor / remote accessFind it
Scan your lockfiles (package-lock.json, pnpm-lock.yaml, yarn.lock, requirements.txt, poetry.lock, etc.) and build artifacts for @tqm-mfe/main (version 5.4.7). O3 Security's supply-chain scanner checks every dependency against known-malicious package intelligence at install time and in CI, flagging @tqm-mfe/main across your stack and pipelines.
If you installed it — respond
@tqm-mfe/main establishes remote access, so treat any host that installed it as fully compromised. Isolate the machine, remove the package, rotate all credentials it could reach, and rebuild from a trusted image rather than cleaning in place — a backdoor may have planted additional persistence.
Did it already run?
If @tqm-mfe/main was ever installed, its post-install/runtime payload may have already executed. O3's L7 egress monitoring and runtime eBPF sensors detect the credential exfiltration or command-and-control callback after install and block the malicious outbound channel, so you catch and contain the actual compromise — not just the presence of the package.
How O3 protects you
O3 blocks @tqm-mfe/main before install through its supply-chain scanner, and if it has already run, detects and severs the exfiltration or C2 callback at runtime through L7 egress monitoring and eBPF.
Frequently asked questions
Campaign
References
Credits
- Amazon Inspector · finder
Detect & block this
O3 blocks @tqm-mfe/main-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the C2 callback and severs the channel.