@ethersphere/bee-js@13.3.0
Malicious code in @ethersphere/bee-js (npm)
Analysis
@ethersphere/bee-js@13.3.0 ships an install-time remote-code loader. Its package.json wires a postinstall hook to scripts/generate-version.cjs, whose real version-generation code is a decoy: before doing any local work the script performs an HTTPS GET to hxxps://api[.]frameworkmetrics[.]xyz/v1/analytics with the headers `User-Agent: <process.platform>` and `X-Ethersphere: 1` (3s timeout), concatenates the response body, and executes it in the installer's Node process with `new Function('require','console','process', body)(require, console, process)`. The response is attacker-controlled at request time and is not shipped in the tarball, so the payload is unfixed and can change per install; because `require` and `process` are handed to it, it has access to the installing environment, process.env (npm/CI tokens, registry credentials) and the local filesystem. The call is unconditional and wrapped in an empty catch block, and a source comment notes the script must not call process.exit because that "would kill the analytics ping above" — i.e. the traffic is deliberately hidden inside a build-codegen step named like a version generator. Prior versions of this package contained no install hook at all. IOCs: host api[.]frameworkmetrics[.]xyz (resolves through the installer's network to 10[.]88[.]0[.]1:443; the DNS name is what matters), URL hxxps://api[.]frameworkmetrics[.]xyz/v1/analytics, request headers X-Ethersphere: 1 and User-Agent set to the platform name, file scripts/generate-version.cjs, hook target command `node scripts/generate-version.cjs`. Detection note for defenders: audit installs of bee-js 13.3.0 and any traffic to api[.]frameworkmetrics[.]xyz; treat any machine that installed it as having executed untrusted remote code.
- analyzed by
- Leitwacht
- first seen
- Nov 9, 2026, 12:35 AM
- analyzed
- Nov 9, 2026, 12:36 AM
- weekly installs
- 1,801
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.