Malicious code in mini-hardhat (npm)
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (fbdfc97da008f90f11ae03963e75237c8bb746cf93f9cdc5da43ba5807ed6c1e) mini-hardhat@1.1.4 presents itself as a pino-like JSON logger, but its main entry exports a middleware factory that, on instantiation, spawns lib/caller.js as a detached, stdio-ignored, unref'd child process so execution survives the parent. lib/caller.js base64-decodes a hardcoded URL (stored under decoy keys named DEV_API_KEY/DEV_SECRET_KEY/DEV_SECRET_VALUE) resolving to https://ipinfo-encrypted-v1.vercel.app/api/auth/f1f097d93c318c92f0c5, POSTs to it via axios, and passes the response body directly to new Function.constructor("require", s)(require), granting the remote endpoint arbitrary code execution inside the consumer's Node.js process with full require access. The fetch is retried up to 5 times. The declared purpose (logger/vulnerability-management document) does not match the shipped code, the destination URL and headers are base64-obfuscated, and the delivery is engineered to persist beyond the parent process — the shape of an intentional remote-code-execution dropper.
MAL-2026-17236
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: osv:MAL-2026-17236
mini-hardhat
Source reference: /affected/0/package/name
- Affected versions
- 1.1.4
Source reference:
/affected/0/versions - Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"package": {
"name": "mini-hardhat",
"purl": "pkg:npm/mini-hardhat",
"ecosystem": "npm"
},
"versions": [
"1.1.4"
],
"database_specific": {
"cwes": [
{
"name": "Embedded Malicious Code",
"cweId": "CWE-506",
"description": "The product contains code that appears to be malicious in nature."
}
],
"source": "https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/mini-hardhat/MAL-2026-17236.json",
"indicators": {
"evidence_files": [
{
"path": "lib/caller.js",
"tlsh": "d001bd8a61fc141c016522ea171fa03250a1e46b3909d9c0378c87824fb96be2a93adf",
"sha256": "907c5279529f4522f6f298f80b6786b461b9b41e74a5025306eefddbb1e073d0"
},
{
"path": "index.js",
"tlsh": "5d213c81b9f11188065cd9c8b569e53a38e3c4377207b9b0e9ec87862bcf2080272ad7",
"sha256": "2956b023858d706a5e241cd28b845088e5f414c5f70bd5d8cb73cb427d081065"
}
],
"package_integrity": [
{
"hashes": {
"sha1": "e35bad83737308b4bc8fa7402f14805f51876190",
"sha512_sri": "sha512-pG74FZey+jnqQgbqrfQaLVwg0kXTjhsoKh29KkkvYoU2SPyy7Z6wf/vrFENyF3Na2tJ/oKy9kolsD6pMvwv0LQ=="
},
"filename": "mini-hardhat-1.1.4.tgz"
}
]
}
}
}
]Publisher severity
No explicit severity was provided.
- Event
- #23704 · Revision 1
- Added to Heist Feed
- Publisher date