assertcoreutils@2.3.2
Malicious code in assertcoreutils (npm)
Analysis
assertcoreutils@2.3.2 is a trojanized clone of the Chai assertion library. The package ships the real Chai v4.3.8 source code (chai.js) but replaces the entry point with a custom index.js that, on require(), spawns a detached background Node process. That process runs a heavily obfuscated script (lib/chai/utils/addAssertion.js) which constructs a URL via query parameter, HTTP GETs the response, and executes it through new Function(..., responseBody)(require), achieving arbitrary remote code execution on the installer's machine. The attacker-controlled remote endpoint dictates the full second-stage payload. The package's homepage (assertcoreutilsutils[.]com) is a suspicious lookalike domain with no legitimate content.
- analyzed by
- Leitwacht
- first seen
- Jun 30, 2026, 08:23 AM
- analyzed
- Jun 30, 2026, 08:24 AM
Related advisories
- pino-zod@1.0.121
- zod-pino@1.0.122
- panrouter-admin@5.0.0
- hex-conv-ae7a@1.0.0
- ordered-btree@3.2.2
- check-ulid@3.0.2
- @httpactions/encode-url@1.0.0
- vitest-pro@7.0.4
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.