MAL-2026-17509

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/hardhat-roof/MAL-2026-17509.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-17509
Published
2026-10-04T23:28:31Z
Modified
2026-10-04T23:45:19Z
Summary
Malicious code in hardhat-roof (npm)
Details

-= 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.

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"
            ]
        }
    ]
}
References
Credits

Affected packages

npm / hardhat-roof

Package

Affected ranges

Affected versions

2.*
2.21.0

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=="
            }
        }
    ]
}
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/hardhat-roof/MAL-2026-17509.json"