MAL-2026-10162: Malicious code in @bcryptln/becryptjs (npm)
The npm package @bcryptln/becryptjs impersonates the legitimate bcryptjs library but contains malicious code hidden in its ESM entrypoint. This code uses obfuscation and dynamic function construction to execute a payload with full CommonJS capabilities, enabling access to filesystem and network modules. The malicious payload is only present in the ESM import path, while the CommonJS entrypoint remains clean to evade detection. This behavior is consistent with a supply-chain trojan targeting modern JavaScript module consumers.
AI Analysis
Technical Summary
The package @bcryptln/becryptjs, which mimics the widely-used bcryptjs library, includes a malicious payload appended after legitimate code in its ESM entrypoint (index.js). The payload uses custom string-shuffle decoders to hide the use of the JavaScript Function constructor, which is dynamically created and invoked. It re-exposes CommonJS primitives such as require, module, __dirname, and __filename as globals, allowing the payload to access powerful Node.js modules like fs, child_process, http, and net. The CommonJS/UMD entrypoint (umd/index.js) is a clean copy of the upstream library, making the malicious code only active when the package is imported as an ESM module. This split and obfuscation strategy indicates an intentional supply-chain trojan designed to evade code review and detection.
Potential Impact
Consumers importing @bcryptln/becryptjs as an ESM module risk executing malicious code with full CommonJS module access, potentially allowing arbitrary code execution, filesystem manipulation, network communication, and process spawning. This compromises the security and integrity of applications using this package version.
Mitigation Recommendations
No official patch or remediation guidance is currently available. Users should avoid using the affected versions of @bcryptln/becryptjs (=3.0.8, =3.0.10, =3.0.11). Instead, they should switch to the legitimate bcryptjs package or verify package authenticity before use. Monitor vendor advisories for updates or official fixes. Patch status is not yet confirmed — check the vendor advisory for current remediation guidance.
MAL-2026-10162: Malicious code in @bcryptln/becryptjs (npm)
Description
The npm package @bcryptln/becryptjs impersonates the legitimate bcryptjs library but contains malicious code hidden in its ESM entrypoint. This code uses obfuscation and dynamic function construction to execute a payload with full CommonJS capabilities, enabling access to filesystem and network modules. The malicious payload is only present in the ESM import path, while the CommonJS entrypoint remains clean to evade detection. This behavior is consistent with a supply-chain trojan targeting modern JavaScript module consumers.
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 package @bcryptln/becryptjs, which mimics the widely-used bcryptjs library, includes a malicious payload appended after legitimate code in its ESM entrypoint (index.js). The payload uses custom string-shuffle decoders to hide the use of the JavaScript Function constructor, which is dynamically created and invoked. It re-exposes CommonJS primitives such as require, module, __dirname, and __filename as globals, allowing the payload to access powerful Node.js modules like fs, child_process, http, and net. The CommonJS/UMD entrypoint (umd/index.js) is a clean copy of the upstream library, making the malicious code only active when the package is imported as an ESM module. This split and obfuscation strategy indicates an intentional supply-chain trojan designed to evade code review and detection.
Potential Impact
Consumers importing @bcryptln/becryptjs as an ESM module risk executing malicious code with full CommonJS module access, potentially allowing arbitrary code execution, filesystem manipulation, network communication, and process spawning. This compromises the security and integrity of applications using this package version.
Mitigation Recommendations
No official patch or remediation guidance is currently available. Users should avoid using the affected versions of @bcryptln/becryptjs (=3.0.8, =3.0.10, =3.0.11). Instead, they should switch to the legitimate bcryptjs package or verify package authenticity before use. Monitor vendor advisories for updates or official fixes. Patch status is not yet confirmed — check the vendor advisory for current remediation guidance.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-10162
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a520ec868715ace438f5eb6
Added to database: 07/11/2026, 09:37:12 UTC
Last enriched: 07/11/2026, 09:57:01 UTC
Last updated: 07/11/2026, 16:46:39 UTC
Views: 3
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.
External Links
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.