metrica-chain@2.4.5
Malicious code in metrica-chain (npm)
Analysis
metrica-chain masquerades as a logger by vendoring large amounts of the legitimate pino logger internals to appear benign. Its entry point exports a no-op middleware that silently spawns lib/caller.js as a detached, unref'd child process with stdio:ignore. lib/caller.js base64-decodes a URL (hxxps://jsonkeeper[.]com/b/BADC6) and fetches stage-2 code via axios.get with a custom x-secret-key header; the fetched code is passed to new Function.constructor("require", s) and invoked with the full require scope, giving arbitrary code execution in the installer's context. It retries up to 5 times and suppresses console.log output to stay hidden.
- analyzed by
- Leitwacht
- first seen
- Jun 10, 2026, 04:29 PM
- analyzed
- Jun 10, 2026, 04:31 PM
Related advisories
- martinez-polygon-clipping-tony@0.9.3
- martinez-polygon-clipping-tony@0.9.0
- cache-section-helper@1.0.7
- lucifer490-v2@1.1.65
- chai-check-error@2.1.3
- db-xorma@1.0.2
- farming-tools-12@4.68.54
- @klapp-sca/routes@99.0.1
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.