util-free-ports@3.1.2
Malicious code in util-free-ports (npm)
Analysis
During npm install, a preinstall hook (node ./dist/util.js) executes obfuscated JavaScript that performs anti-analysis checks — verifying CPU core count, memory, system uptime, MAC-address prefixes (matching VMware, VirtualBox, Xen, Docker, Hyper-V, KVM), and hostname blacklists — to evade sandboxes and CI environments. It first probes internet connectivity via a DNS query to ip[.]sb (an IP-address lookup service). If all checks pass, it fetches and eval()s a second-stage payload from a remote HTTPS server (address encoded in the obfuscated payload). The package bundles the legitimate LayUI frontend library (v2.9.21) and assets as camouflage; the malicious code resides entirely in dist/util.js.
- analyzed by
- Leitwacht
- first seen
- Jun 15, 2026, 01:45 PM
- analyzed
- Jun 15, 2026, 01:48 PM
Related advisories
- stringfy-utils-kit@1.0.0
- sort-btree@2.1.4
- macos-ci-utils@1.0.1
- index-ulid@3.0.2
- obfus-jsxy@3.2.0
- ecto-rust-read-f3a9c1@1.0.2
- devplatform-spa-plugin-module-loader@35.8.5
- entropyeasybots@2.0.2
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.