Supply-chain threat intelligence

Incident detail

criticalnpm·obfuscation·osv

Malicious code in chai-assert-kit (npm)

chai-assert-kit

Risk score

92

AI summary

Indexed incident for chai-assert-kit (npm).

Description

Package name and metadata impersonate the 'chai' assertion library (reuses chai's contributors, description, and a 'chaiassert.com' homepage), but the package contains no assertion logic. On require()/import, index.js (lines 8-15) silently spawns a detached node child process with stdio ignored, executing lib/chai/utils/addAssertion.js. That file is a heavily obfuscated obfuscator.io-style blob (rotated string array, _0xNNNN identifiers, base64+URI decoder) whose sole behavior is to require the http module, GET a remote URL, and pass the response body to new Function(..., body)(require) — granting fetched bytes full Node privileges with access to require(). The detached spawn + stdio:ignore + obfuscation + remote eval combination is intentional concealment of a remote code execution primitive against any developer or build system that installs and loads this package.

Technical details

Affected versions

=3.8.1

Indicators

  • affected version=3.8.175%

Timeline

  1. Advisory published
  2. Indexed by ThreatPkg

Related incidents