Malicious code in mham-js (npm)
Description
The mham-js npm package version 1.0.4 contains malicious code that executes arbitrary attacker-controlled code upon import. It reads and decrypts an external encrypted payload using a hardcoded DES key, then runs this payload in a detached Node.js subprocess. The package's README falsely claims no action occurs on import, masking the malicious behavior.
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 mham-js package (version 1.0.4) includes a backdoor in src/api/session-api.js that triggers on import. It reads a file located outside the package directory (../../../../public/logo.ico), decrypts it with CryptoJS.DES using a hardcoded password 'bf497c0b9cee', and executes the decrypted bytes as code in a detached Node.js subprocess. The malicious loader uses misleading function names to disguise its purpose. The payload is attacker-controlled, encrypted outside the package tarball, and executed without verification or documentation, enabling arbitrary code execution.
Potential Impact
This vulnerability allows an attacker to execute arbitrary code on any system that imports the affected mham-js package version 1.0.4. Because the payload is external and encrypted, it can be changed dynamically by the attacker, leading to potentially severe compromise including remote code execution and system takeover.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately stop using mham-js version 1.0.4 and remove it from their projects. Avoid importing this package until a trusted, verified version is released. Monitor for updates from the package maintainer or npm security advisories for remediation.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-14478
- Osv Schema Version
- 1.7.4
- Ecosystems
- ["npm"]
Threat ID: 6a8d9ae8acd9273b493e17a1
Added to database: 08/25/2026, 13:38:48 UTC
Last enriched: 09/10/2026, 18:48:09 UTC
Last updated: 10/02/2026, 14:22:09 UTC
Views: 32
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.