Malicious code in hatdhat-testkit (npm)
The npm package hatdhat-testkit version 3.2.14 masquerades as a pino-style logging utility but contains malicious code. Its middleware entrypoint spawns a detached Node process that fetches and executes remote code from an obfuscated URL, granting full Node.js capabilities to the attacker. This behavior is unrelated to the advertised functionality and is designed to evade inspection.
AI Analysis
Technical Summary
The hatdhat-testkit npm package version 3.2.14 includes a middleware entrypoint (index.js) that launches a detached Node process (lib/caller.js). This process contains a fake process object with environment variables holding base64-encoded strings that decode to a remote URL, a request header name, and a secret key value. The package fetches a mutable JSON blob from the remote URL and executes the 'cookie' field of the response as JavaScript code using new Function.constructor with require() access. This grants the remote payload full Node.js capabilities, enabling arbitrary code execution unrelated to the package's advertised logging functionality. The obfuscation of the URL and header is intended to evade detection.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary code with full Node.js privileges on any system running the affected package version. This can lead to complete compromise of the host environment, data theft, or further malicious activities. The malicious behavior is hidden behind legitimate package functionality, increasing the risk of unnoticed compromise.
Mitigation Recommendations
No official patch or remediation guidance is currently available. Users should immediately remove or avoid using hatdhat-testkit version 3.2.14. Monitor for updates from the package maintainer or npm registry for any official fixes or removals. Until then, do not install or deploy this package in any environment.
Malicious code in hatdhat-testkit (npm)
Description
The npm package hatdhat-testkit version 3.2.14 masquerades as a pino-style logging utility but contains malicious code. Its middleware entrypoint spawns a detached Node process that fetches and executes remote code from an obfuscated URL, granting full Node.js capabilities to the attacker. This behavior is unrelated to the advertised functionality and is designed to evade inspection.
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 hatdhat-testkit npm package version 3.2.14 includes a middleware entrypoint (index.js) that launches a detached Node process (lib/caller.js). This process contains a fake process object with environment variables holding base64-encoded strings that decode to a remote URL, a request header name, and a secret key value. The package fetches a mutable JSON blob from the remote URL and executes the 'cookie' field of the response as JavaScript code using new Function.constructor with require() access. This grants the remote payload full Node.js capabilities, enabling arbitrary code execution unrelated to the package's advertised logging functionality. The obfuscation of the URL and header is intended to evade detection.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary code with full Node.js privileges on any system running the affected package version. This can lead to complete compromise of the host environment, data theft, or further malicious activities. The malicious behavior is hidden behind legitimate package functionality, increasing the risk of unnoticed compromise.
Mitigation Recommendations
No official patch or remediation guidance is currently available. Users should immediately remove or avoid using hatdhat-testkit version 3.2.14. Monitor for updates from the package maintainer or npm registry for any official fixes or removals. Until then, do not install or deploy this package in any environment.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-14373
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a8af9a3acd9273b49f32efb
Added to database: 08/23/2026, 13:46:11 UTC
Last enriched: 08/23/2026, 13:50:31 UTC
Last updated: 08/23/2026, 23:11:10 UTC
Views: 7
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.