Skip to content
supplychainattack.orgSupply chain attack incident catalog
resolvedcritical

Malicious code in solidity-testing-utils (npm)

solidity-testing-utils, an npm package masquerading as a Solidity testing helper, contained malicious code that spawned a detached child process to fetch and execute arbitrary code from an attacker-controlled remote JSON storage endpoint. The package used base64-encoded URLs and hardcoded credentials to retrieve and execute payloads with full Node.js require access during installation.

ShareXLinkedInHacker News
Disclosed
Last updated
Blast radius
Any npm user who installed solidity-testing-utils
Ecosystems
Attack vectors
Affected entities
  • solidity-testing-utilsnpm package

The npm package solidity-testing-utils presented itself as a chai/Solidity testing helper and pino-style logger, but its actual behavior was malicious. When the exported middleware factory in index.js was invoked, it silently spawned a detached child process running lib/caller.js via child_process.spawn() with stdio redirected to /dev/null.

The spawned lib/caller.js process base64-decoded a hardcoded URL pointing to https://api.jsonstorage.net/v1/json/2ef8c758-a96f-459e-b036-b3b90379a165/f89e8264-86c2-4684-94da-c3f82d59370f and performed an HTTP GET request with a hardcoded 'x-secret-key' header. It then extracted the .data.cookie field from the JSON response and passed it to Function.constructor(), granting the fetched payload arbitrary code execution with full require access in the installer's Node.js process.

Because the payload was stored in a mutable attacker-controlled JSON blob, the malicious code could be swapped or updated at any time after installation. The package name and README did not correspond to its actual behavior, making detection difficult for users.

This incident was identified and credited to the OpenSSF's malicious-packages repository.

Indicators of compromise

Packages
  • solidity-testing-utils
Domains
  • api.jsonstorage.net

Remediation

  • Immediately uninstall solidity-testing-utils from all environments
  • Audit npm install logs and package-lock.json to identify when and where the package was installed
  • Assume any system that installed this package may have been compromised; rotate credentials, API keys, and secrets used in those environments
  • Review process logs and network traffic from affected systems for signs of unauthorized code execution
  • Update to a clean version if a legitimate replacement package is available, or use an alternative testing library
  • Implement npm package verification and scanning in CI/CD pipelines to detect malicious packages before installation

Sources

  1. GitHub Advisory GHSA-g5g4-w6x5-58j4 · GitHub Advisory Database

Cite this entry

"Malicious code in solidity-testing-utils (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 23, 2026; last updated August 23, 2026. https://supplychainattack.org/incident/malicious-code-in-solidity-testing-utils-npm-as3jwz

Suggest a correction

Found an error or have a newer source? Corrections to factual errors take priority over new entries.

  1. containedcritical

    Malware in svelte-dim-kit

    The npm package svelte-dim-kit was found to contain malware, potentially giving attackers full control of affected systems. All systems with this package installed should be considered compromised and secrets/keys rotated immediately from a different computer.

    npmCompromised package
  2. containedcritical

    Malicious code in @syncraft-labs/react (npm)

    The npm package @syncraft-labs/react contained obfuscated malicious code in its ESM distribution that implements the EtherHiding pattern, fetching and executing arbitrary code from an Ethereum smart contract via RPC endpoints. The tampering occurred post-build in the dist/index.js artifact.

    npmCompromised package
  3. containedcritical

    Malicious code in stillm4ddpocs-demo-sprocket (npm)

    The npm package stillm4ddpocs-demo-sprocket version 999.9.12 contains malicious code that exfiltrates system and project metadata via multiple channels (HTTPS, HTTP, and DNS) to a hardcoded callback host. The package uses a high version number to exploit dependency-confusion attacks against organizations with internal packages of the same name.

    npmCompromised packageDependency confusion
  4. resolvedcritical

    Malicious code in stillm4ddpocs-rtest-bravo (npm)

    The npm package stillm4ddpocs-rtest-bravo contained malicious code in its preinstall script that automatically executed during installation, collecting system information and internal package metadata and exfiltrating it to a third-party Interactsh collector via HTTPS and DNS tunneling.

    npmCompromised package