# MAL-2026-16348: Malicious code in hardhat-base (npm)

- Database: OpenSSF
- Malicious package: yes
- Also known as: SNYK-JS-HARDHATBASE-20043735
- Published: 2026-09-21
- Modified: 2026-11-25

## Also published as

- [GHSA-G59V-28J4-2R85](https://cve.now/GHSA-G59V-28J4-2R85.md) (GitHub)

## Affected versions

- hardhat-base (npm): 2.2.2, 2.2.0

## Description

Package presents itself as a pino-compatible logger (module.exports.pino = middleware; keywords fast/logger/stream/json) but ships an RCE loader. index.js spawns lib/caller.js as a detached child process on middleware invocation. caller.js reads a base64-encoded URL from a fake process.env-shaped constant (DEV_API_KEY), decodes it via atob to https://ipcheck-hashed.vercel.app/api/auth/f1f097d93c318c92f0c5, POSTs to that endpoint via axios, and passes the response body to new Function.constructor("require", s) — invoking the returned handler with the real require function. Any consumer that requires this package and calls the exported middleware fetches and executes arbitrary attacker-controlled JavaScript with full Node.js require access. The base64 concealment of the endpoint inside fake env-var constants, the detached child spawn, the cover-story pino API surface, and the mismatch with the manifest description (vulnerability-management text) confirm intentional supply-chain attack rather than an insecure update mechanism.

## References

- https://www.npmjs.com/package/hardhat-base/v/2.2.2
- https://www.npmjs.com/package/hardhat-base/v/2.2.0
- https://security.snyk.io/vuln/SNYK-JS-HARDHATBASE-20043735
- https://github.com/advisories/GHSA-g59v-28j4-2r85

Page: https://cve.now/MAL-2026-16348

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