MAL-2026-17509
Vulnerability from ossf_malicious_packages
-= Per source details. Do not edit below this line.=-
Source: amazon-inspector (25cbf03ad6014824ab078237f83b2b682145928e5effefbe3dcc5deca9ba1e26)
The package presents itself as the pino logger — README, docs/, index.d.ts and LICENSE are copied from pinojs/pino and keywords advertise 'fast, logger, stream, json' — but the package name is 'hardhat-roof', the description references unrelated vulnerability-management functionality, and the author points to jsonspack.com rather than the pino maintainers. The top of index.js executes require('./lib/config'), which loads lib/config.js: a 4,373,384-byte file containing obfuscator.io-style string-array obfuscation with a self-rotating decoder (n['push'](n['shift']()) loop gated by a parseInt sum), hex-escaped character lookups, and dozens of single-letter indirection functions. The remaining lib/ files are small and consistent with pino; only config.js is the oversized opaque blob, and the real pino has no such file. Any consumer that imports or requires this package therefore executes several megabytes of opaque code in-process at load time. The combination of a doppelganger cover story cloned from a popular logger, a mismatched package name and author, and a reachable load-time execution path into a heavily obfuscated multi-megabyte payload is the shape of a trojanized typosquat/doppelganger delivering attacker-controlled code into installer processes.
- CWE-506 - The product contains code that appears to be malicious in nature.
{
"affected": [
{
"database_specific": {
"cwes": [
{
"cweId": "CWE-506",
"description": "The product contains code that appears to be malicious in nature.",
"name": "Embedded Malicious Code"
}
],
"indicators": {
"evidence_files": [
{
"path": "lib/config.js",
"sha256": "7e4c6d76f1d845f752e37876a2d3f773996719f33c2d1c282e0a84b04444efeb",
"tlsh": "bf1694889194e02b96df1753bf052afdd13aa876d0cca747c2d4be9d29ac80be475cd0"
},
{
"path": "package.json",
"sha256": "d3bb5cea03caac3a23bcdffc83163c1663498d2c0a1c995441011e285cc45e8a",
"tlsh": "2b017620deb88e2301ed25524c2a0643b6a28c575528fc2932dba12c0f9d5ff01ff21d"
}
],
"package_integrity": [
{
"filename": "hardhat-roof-2.21.0.tgz",
"hashes": {
"sha1": "7ce872cf9079e7cec42c9b198d8a0e7215c7a9d8",
"sha512_sri": "sha512-9DlOXdeTUrWcsIBZeEvWbdoy0jLPQ12zYlRuzjXbEwmOrmZmiUMk/azE6prL9nismvmy+vrLEBD+MhMDJCKhBg=="
}
}
]
}
},
"package": {
"ecosystem": "npm",
"name": "hardhat-roof"
},
"versions": [
"2.21.0"
]
}
],
"credits": [
{
"contact": [
"inspector-research@amazon.com"
],
"name": "Amazon Inspector",
"type": "FINDER"
}
],
"database_specific": {
"malicious-packages-origins": [
{
"id": "IN-MAL-2026-020974",
"import_time": "2026-10-04T23:40:47.446760876Z",
"modified_time": "2026-10-04T23:28:31Z",
"sha256": "25cbf03ad6014824ab078237f83b2b682145928e5effefbe3dcc5deca9ba1e26",
"source": "amazon-inspector",
"versions": [
"2.21.0"
]
}
]
},
"details": "\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (25cbf03ad6014824ab078237f83b2b682145928e5effefbe3dcc5deca9ba1e26)\nThe package presents itself as the pino logger \u2014 README, docs/, index.d.ts and LICENSE are copied from pinojs/pino and keywords advertise \u0027fast, logger, stream, json\u0027 \u2014 but the package name is \u0027hardhat-roof\u0027, the description references unrelated vulnerability-management functionality, and the author points to jsonspack.com rather than the pino maintainers. The top of index.js executes `require(\u0027./lib/config\u0027)`, which loads lib/config.js: a 4,373,384-byte file containing obfuscator.io-style string-array obfuscation with a self-rotating decoder (`n[\u0027push\u0027](n[\u0027shift\u0027]())` loop gated by a parseInt sum), hex-escaped character lookups, and dozens of single-letter indirection functions. The remaining lib/ files are small and consistent with pino; only config.js is the oversized opaque blob, and the real pino has no such file. Any consumer that imports or requires this package therefore executes several megabytes of opaque code in-process at load time. The combination of a doppelganger cover story cloned from a popular logger, a mismatched package name and author, and a reachable load-time execution path into a heavily obfuscated multi-megabyte payload is the shape of a trojanized typosquat/doppelganger delivering attacker-controlled code into installer processes.\n",
"id": "MAL-2026-17509",
"modified": "2026-10-04T23:28:31Z",
"published": "2026-10-04T23:28:31Z",
"references": [
{
"type": "PACKAGE",
"url": "https://www.npmjs.com/package/hardhat-roof/v/2.21.0"
}
],
"schema_version": "1.7.4",
"summary": "Malicious code in hardhat-roof (npm)"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.