Skip to content
supplychainattack.orgSupply chain attack incident catalog
containedcritical

Malicious code in npm-hex-utils (npm)

The npm package npm-hex-utils contained malicious code in its postinstall script that exfiltrated system information and executed remotely-fetched Python code. The package masqueraded as a hex encoding utility but included undisclosed telemetry and remote code execution capabilities.

ShareXLinkedInHacker News
Disclosed
Last updated
Blast radius
Unknown; depends on adoption of affected versions
Ecosystems
Attack vectors
Affected entities
  • npm-hex-utilsMalicious postinstall script executing remote code

The npm package npm-hex-utils was found to contain malicious code embedded in its postinstall script. Upon installation, the package executed runtime.js, which collected sensitive host information including hostname, username, platform, architecture, Node version, and OS release, then transmitted this data to an attacker-controlled endpoint (https://steel-mere-4155.ricardorichp.workers.dev/report).

The malicious script then fetched an encrypted payload from the same attacker infrastructure (https://steel-mere-4155.ricardorichp.workers.dev/e) over a TLS connection with certificate verification disabled. The payload was decrypted using AES-256-GCM with a hardcoded key and written to ~/.cache/hex-encode-utils/modules/runtime.py, then executed as a detached Python process.

The attack included evasion mechanisms: execution was gated by an isDevMachine() check requiring Desktop/Documents/Downloads directories to exist (to avoid sandbox and CI environments) and a 24-hour cache marker to prevent repeated execution. The malicious behavior was disguised with identifier and comment strings ("TelemetrySender", "standard telemetry") to appear legitimate, despite the package's advertised purpose being only hex encoding utilities with no legitimate need for host beaconing or remote code execution.

The incident was identified and credited to the OpenSSF's malicious-packages repository.

Indicators of compromise

Packages
  • npm-hex-utils
Domains
  • steel-mere-4155.ricardorichp.workers.dev

Remediation

  • Immediately uninstall npm-hex-utils from all systems
  • Audit npm audit logs for installation of npm-hex-utils and identify affected machines
  • Inspect ~/.cache/hex-encode-utils/ for any downloaded Python payloads and remove them
  • Review system logs on affected machines for suspicious Python process execution
  • Check for any outbound connections to steel-mere-4155.ricardorichp.workers.dev and related infrastructure
  • Use a legitimate hex encoding library as a replacement
  • Consider implementing postinstall script restrictions in npm configuration to prevent arbitrary code execution during package installation

Sources

  1. GitHub Advisory GHSA-2xxj-8x4m-xxg2 · GitHub Advisory Database

Cite this entry

"Malicious code in npm-hex-utils (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 13, 2026; last updated August 13, 2026. https://supplychainattack.org/incident/malicious-code-in-npm-hex-utils-npm-op1y41

Suggest a correction

Found an error or have a newer source? Corrections to factual errors take priority over new entries.

  1. containedcritical

    Malicious code in checkout-desktop-total (npm)

    The npm package checkout-desktop-total contained malicious code that executes a hidden loader on import, downloading and running platform-specific native payloads from attacker-controlled Cloudflare Workers hosts or reconstructing them via DNS TXT records under wel1.ru. Any system that imported this package should be considered compromised.

    npmCompromised package
  2. containedcritical

    Malicious code in epic-common (npm)

    The npm package epic-common was found to contain malicious code. The package was identified by Amazon Inspector and reported through the OpenSSF malicious packages database.

    npmCompromised package
  3. resolvedcritical

    Malicious code in epic-common-node (npm)

    The npm package epic-common-node was found to contain malicious code. The package has been identified and reported through GitHub Security Advisory GHSA-m36g-mhjr-ww2c.

    npmCompromised package
  4. containedcritical

    Malware in @siwatfa/yorn

    Malware was discovered in the npm package @siwatfa/yorn. Systems with this package installed or running should be considered fully compromised, with all secrets and keys requiring immediate rotation from a different computer.

    npmCompromised package