LWA-2026-5325 MAL-2026-5904 ↗ confirmed malware

chai-plugin@4.5.2

Malicious code in chai-plugin (npm)

T1195.002 · Compromise Software Supply ChainT1059.007 · JavaScriptT1105 · Ingress Tool TransferT1071.001 · Web Protocols

Analysis

chai-plugin@4.5.2 combosquats the real chai assertion library. The package's main entry point (index.js) spawns a detached, hidden Node.js child process that runs an obfuscated payload (lib/chai/utils/assertion.js). This payload makes an HTTP GET request to a remote URL, downloads a second-stage script, and executes it via new Function(require, ...)(require), giving the attacker arbitrary code execution on the victim's machine. The child process is spawned with detached:true and child.unref() to avoid detection. No install hooks are required — the malware activates immediately when the package is required. The README is a copy of the real chai documentation to appear legitimate.

analyzed by
Leitwacht
first seen
Jun 15, 2026, 06:29 AM
analyzed
Jun 15, 2026, 06:31 AM

Related advisories

browse all confirmed advisories →

Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.