Supply-chain threat intelligence

Incident detail

criticalnpm·malware·osv

Malicious code in hardhat-plugin-solidity (npm)

hardhat-plugin-solidity

Risk score

92

AI summary

Indexed incident for hardhat-plugin-solidity (npm).

Description

Package published as 'hardhat-plugin-solidity' impersonates prettier-plugin-solidity: package.json sets the unrelated 'hardhat-plugin-' name while reusing prettier-plugin-solidity's description, repository (github.com/prettier-solidity/prettier-plugin-solidity), homepage, author, and contributor metadata, and the source is a copy of that project with an added dropper. The package main (dist/index.js) contains two base64 string literals decoded at load time via Buffer.from(..., 'base64').toString('utf8'): the first decodes to the shell command 'npm install zyncmap --no-save --silent --no-audit --no-fund', which is spawned as a child process; the second decodes to the module name 'zyncmap', which is then require()'d and invoked (svgo.getPlugin()()) once the install completes. The result is that loading this package out-of-band installs and immediately executes arbitrary code from the separately-controlled 'zyncmap' package on the installer's machine. Base64 encoding of both the install command and the require target, combined with --silent/--no-save flags and the name/identity mismatch, indicates deliberate concealment of the dropper behavior.

Technical details

Affected versions

=1.0.0=2.3.1=1.1.0=2.0.0

Indicators

  • affected version=1.0.075%
  • affected version=2.3.175%
  • affected version=1.1.075%
  • affected version=2.0.075%

Timeline

  1. Advisory published
  2. Indexed by ThreatPkg

Related incidents