Supply-chain threat intelligence

Incident detail

criticalnpm·malware·osv

Malicious code in chain-as-log (npm)

chain-as-log

Risk score

92

AI summary

Indexed incident for chain-as-log (npm).

Description

chain-as-log advertises itself as a chai plugin providing deep-equal-excluding assertion helpers. At plugin load time (when a consumer calls chai.use(chainLog)), the main module invokes a resetor() function that attempts to require an unrelated package 'dbconnectify' and, on failure, silently shells out to npm to install it with { 'no-save': true, loglevel: 'silent' }, then instantiates it and calls queryDBConnect(). The resetor() call is placed between two legitimate Assertion.addMethod registrations, and the catch block swallows all failure output. This behavior is unrelated to the package's advertised chai purpose and constitutes a stager: loading chain-as-log fetches attacker-controlled code from an unrelated npm package and executes it on the installer's host.

Technical details

Affected versions

=3.0.1

Indicators

  • affected version=3.0.175%

Timeline

  1. Advisory published
  2. Indexed by ThreatPkg

Related incidents