Malicious code in baileys-mbuilder (npm)
Description
The baileys-mbuilder npm package contains heavily obfuscated malicious code executed both during installation and runtime. The package's postinstall script runs a large JSFuck-encoded payload that downloads and dynamically updates remote JavaScript code without transparent integrity verification. This behavior effectively gives an attacker full control over any system where the package is installed. Removal of the package does not guarantee elimination of all malicious components, and all secrets on affected systems should be considered compromised and rotated immediately.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The baileys-mbuilder npm package includes a postinstall script executing a ~6.3 MB JSFuck-style obfuscated JavaScript payload that reconstructs and runs code via eval. This payload downloads a remote MessageBuilder.js module and periodically fetches updates, dynamically importing new code if hashes differ. The obfuscation hides the fetch destination and integrity checks, preventing static analysis. Both installation and runtime require executing this malicious code, effectively compromising the host system. The package's design allows an attacker to maintain persistent, dynamic code execution on affected machines.
Potential Impact
Any system with this package installed or running is considered fully compromised. Attackers potentially gain full control over the machine, enabling theft or manipulation of secrets, credentials, and keys. Because the package dynamically fetches and executes remote code, the attacker can update payloads post-installation. Removing the package alone may not remove all malicious artifacts, so all secrets on the system should be rotated from a clean environment.
Mitigation Recommendations
Immediate removal of the baileys-mbuilder package is recommended. However, due to the high likelihood of full system compromise, all secrets and keys stored on the affected machine must be rotated from a separate, trusted system. Monitor for any signs of persistent malicious activity. No official patch or fix is available; the package itself is malicious and should be avoided entirely.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-14529
- Osv Schema Version
- 1.7.4
- Aliases
- ["GHSA-8m87-xx52-4rjw"]
- Ecosystems
- ["npm"]
Threat ID: 6a8effd3acd9273b490771bd
Added to database: 08/26/2026, 15:01:39 UTC
Last enriched: 09/10/2026, 11:25:24 UTC
Last updated: 10/02/2026, 14:27:38 UTC
Views: 25
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.