hardhat-jsxnpm
Advisory published Updated
hardhat-jsx is a confirmed malicious npm package (MAL-2026-17507) that typosquats a legitimate package to trick installs (malicious version 2.0.1). Do not install it — remove it immediately and rotate any exposed credentials.
Malicious code in hardhat-jsx (npm)
What this malware does
The package is published as 'hardhat-jsx' but its metadata, documentation, and lib/ layout impersonate the pino logger (keywords 'fast','logger','stream','json'; shipped docs reference pinojs/pino). The main entry index.js unconditionally requires./lib/config, which is a 4,499,968-byte single-line obfuscator.io artifact — a hex-escaped string array of ~26,234 entries with string-array rotation and control-flow flattening (22,707 decoder-wrapper inlines, 44,499 string-inline changes). A legitimate pino 'config' module is ~1-2KB; a multi-megabyte obfuscated blob auto-loaded by the main entry is a loader/dropper. The surface index.js exports a no-op Express-style middleware whose comment claims it 'triggers a background process', providing a cover story adjacent to the obfuscated require. Loading the package via require/import executes the opaque payload in the installer's process. The name/content mismatch (hardhat-jsx vs. pino impersonation), the stub façade, and the heavily obfuscated auto-loaded module together form a trojan-package shape.
Malicious versions
Indicators of compromise (SHA-256)
Detection & response playbook
TyposquatFind it
Search your lockfiles and build artifacts for hardhat-jsx (version 2.0.1).
If you installed it — respond
hardhat-jsx is a typosquat — you almost certainly intended a legitimately-named package. Remove hardhat-jsx, install the correct package, and rotate any secrets exposed during the install since post-install scripts may have already run.
Did it already run?
If hardhat-jsx was installed, its post-install payload may already have run. Removing the package does not undo that — check outbound connections and credential use from the install window onward.
Frequently asked questions
Campaign
References
Credits
- Amazon Inspector · finder
Detect & block this
O3 blocks hardhat-jsx-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the malicious outbound activity and severs the channel.