# GHSA-GRMC-R4MM-H22M: Malicious code in hardhat-option (npm)

- Database: GitHub
- Malicious package: yes
- Published: 2026-10-08
- Modified: 2026-10-12

## Affected versions

- hardhat-option (npm): 2.0.1

## Description

## Source: amazon-inspector (2d460f6c739361d793fbc66b2aa32d1d9ab6fe0df4caefe13c590f40d05d5277)
The package's declared main index.js immediately requires./lib/config, which is a single-line ~4.5MB obfuscator.io-style bundle (26,234-entry hex-escaped string array, rotated decoder wrappers, control-flow flattening) whose top-level IIFE executes as soon as the module is loaded. The exported middleware is a no-op, so the sole effect of require('hardhat-option') is to run the opaque payload with the installer's privileges. The package also presents a false identity: the name is hardhat-option but README, index.d.ts and lib/* are copied from pinojs/pino and index.js re-exports module.exports.pino = middleware to satisfy consumers expecting pino's API, while package.json attributes authorship to 'Robert King <hello@jsonspack.com>' with an unrelated bugs URL at jsonspack.com. A multi-megabyte, fully obfuscated module body that auto-executes on import inside a package falsely wrapped in another project's identity is the canonical loader/dropper shape.

---

Credit: [OpenSSF](https://github.com/ossf/malicious-packages) ([source](https://github.com/ossf/malicious-packages/blob/1f0efa038b4952b6f39151f24f216b7f464d67c4/osv/malicious/npm/hardhat-option/MAL-2026-17660.json))

## References

- https://github.com/ossf/malicious-packages/blob/1f0efa038b4952b6f39151f24f216b7f464d67c4/osv/malicious/npm/hardhat-option/MAL-2026-17660.json
- https://www.npmjs.com/package/hardhat-option/v/2.0.1
- https://github.com/ossf/malicious-packages/blob/75435437028f0877f271cae3489fdaddc8968d78/osv/malicious/npm/hardhat-option/MAL-2026-17660.json
- https://github.com/advisories/GHSA-grmc-r4mm-h22m

Page: https://cve.now/GHSA-GRMC-R4MM-H22M

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
