baileys-mbuildernpm
Advisory published Updated
baileys-mbuilder is a confirmed malicious npm package (MAL-2026-14529) that executes malicious code on install (malicious versions 4.5.0, 4.5.0-beta, 4.5.0-cjs…). Do not install it — remove it immediately and rotate any exposed credentials.
Malicious code in baileys-mbuilder (npm)
What this malware does
package.json declares "postinstall": "node lib/index.js --install", and lib/index.js is a single ~6.3 MB JSFuck-style eval() expression that reconstructs its source character-by-character from boolean/array coercions and %-unescape. The same file is the package's main, and lib/index.mjs re-requires it, so both npm install and any subsequent require/import of the package execute the obfuscated payload. The README documents that the postinstall step downloads MessageBuilder.js from a remote repository and that MB.enableAutoUpdate(ms, cb) periodically re-fetches remote JavaScript, hash-compares it, and on mismatch dynamic-import()s the new module, rebinding the default export via a Proxy so consumers transparently run the newly fetched code. The fetch destination, pinning, and any integrity checks are hidden inside the JSFuck blob and are not visible to static review. The obfuscation scale (6 MB of JSFuck for a message-builder library) has no legitimate purpose and defeats scanner and reviewer inspection of what actually executes on installer machines.
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.
Malicious versions
Indicators of compromise (SHA-256)
Detection & response playbook
Malicious packageFind it
Search your lockfiles and build artifacts for baileys-mbuilder (10 malicious versions).
If you installed it — respond
Remove baileys-mbuilder from your project and lockfile, then assume any secrets accessible to the build or runtime were exposed: rotate API keys, tokens, and credentials, and audit for unexpected outbound activity or persistence.
Did it already run?
If baileys-mbuilder was installed, its post-install payload may already have run. Removing the package does not undo that — check outbound connections and credential use from the install window onward.
Frequently asked questions
Campaign
References
Credits
- Amazon Inspector · finder
Detect & block this
O3 blocks baileys-mbuilder-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the malicious outbound activity and severs the channel.