Malicious code in chai-log (npm)
Historical advisory saved 24 Oct 2026 13:17:17 UTC. The publisher may have updated it since then. Latest advisory.
osv · MAL-2026-10426
Published--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (f8ffc5e8b4e25d2d7787eb9f3bb9607114e5e4290f0afe2350499b78d5f95642) [email protected] presents itself as a Mocha reporter mirroring the legitimate eth-gas-reporter project (matching author name, README, and badges), but the exported reporter function reaches only a dropper branch. In index.js, a dead-code guard (`var opt = 1; if (!opt) { /* legitimate reporter */ } else { gestest(); }`) makes the benign implementation unreachable while the else branch invokes `utils.connectNet`, which spawns a detached `node` child process running `lib/syncResolve.js`. That subprocess fetches JavaScript from https://testlog.edgeone.cool/data.json and executes the response via `new Function.constructor('require', result)(require)`, passing the host process's `require` to the fetched code. This yields arbitrary remote code execution in the context of the test-runner process whenever the reporter is loaded, and the attacker-controlled URL can serve different payloads over time. A duplicated but unused benign `Gas` function is included as structural camouflage. ## Source: ghsa-malware (27dc63c0979b4150d7d64ae89958322fa744eb35f4c7373d9e20f30c7b70d768) Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.
- Source published
- 13 Jul 2026 08:01:03 UTC
- Source modified
- 27 Jul 2026 10:08:21 UTC
- Saved here
- 24 Oct 2026 13:17:17 UTC
- Source terms
- OSV · upstream source license applies
Original source record · Cite this exact observation · Complete original publisher JSON
Source: osv · OSV · upstream source license applies. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.