Skip to content
supplychainattack.orgSupply chain attack incident catalog
containedcritical

Malicious code in nano-perf (npm)

Version 2.2.0 of the npm package nano-perf contains malicious code that installs a covert C2 beacon and task agent via a postinstall script. The malware establishes persistence, beacons to a remote Supabase endpoint, collects system fingerprints, and executes remotely assigned tasks.

ShareXLinkedInHacker News
Disclosed
Last updated
Blast radius
All npm users who installed nano-perf version 2.2.0
Ecosystems
Attack vectors
Affected entities
  • nano-perf · 2.2.0

Version 2.2.0 of nano-perf, an npm package, was found to contain malicious code embedded in a postinstall script. Upon installation, the script launches a detached daemon process (daemon.js) that survives the completion of npm install by ignoring standard streams and running as a background process.

The malware reconstructs an obfuscated Supabase endpoint from Base64-encoded fragments and establishes persistent communication with a remote command-and-control server. It collects and transmits system information including a persistent node identifier, CPU count, total memory, platform details, and periodic online heartbeats to a table named stealth_heartbeats.

After successful heartbeat registration, the daemon polls a second remote table named stealth_tasks to retrieve and execute work assigned to the compromised node. Observed task handlers perform CPU benchmarking and system probing, with results uploaded back to the attacker infrastructure. Although arbitrary shell execution was not observed in this version, the combination of hidden endpoints, installation-time persistence, periodic beaconing, system fingerprinting, and remote task polling constitutes a fully functional covert C2 beacon and task agent.

The malicious package was identified and credited to the OpenSSF's malicious-packages project.

Indicators of compromise

Packages
  • nano-perf

Remediation

  • Immediately uninstall nano-perf version 2.2.0 from all affected systems
  • Audit npm install logs to identify when nano-perf 2.2.0 was installed
  • Scan systems for the presence of daemon.js processes and stealth_heartbeats/stealth_tasks network connections
  • Review system logs for suspicious postinstall script execution and background process launches
  • Check for unauthorized outbound connections to Supabase endpoints or unknown remote servers
  • Consider full system reimaging for any systems that installed nano-perf 2.2.0 in production environments
  • Update npm package dependencies to exclude nano-perf or use only verified versions
  • Monitor for indicators of compromise including unexpected CPU usage, memory consumption, or network beaconing

Sources

  1. GitHub Advisory GHSA-4f46-w499-cvxr · GitHub Advisory Database

Cite this entry

"Malicious code in nano-perf (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed July 31, 2026; last updated July 31, 2026. https://supplychainattack.org/incident/malicious-code-in-nano-perf-npm-194joh

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 json-schema-inspector (npm)

    The npm package json-schema-inspector contained malicious code that performed remote code execution on installation. The package advertised itself as a JSON/XML schema validator but included a trigger routine that fetched and executed attacker-controlled payloads from a remote manifest.

    npmCompromised packageMalicious commit
  2. containedcritical

    Malicious code in @yancyyu/agentcli (npm)

    The npm package @yancyyu/agentcli contains malicious code that extracts OAuth credentials and API keys for Lark/Feishu from the system keychain (macOS) and credential store (Windows), then exfiltrates them to a hardcoded remote IP address over plaintext HTTP. A persistent launchd agent ensures the exfiltration loop survives reboots.

    npmAI agents & skillsCompromised packageMalicious commit
  3. resolvedcritical

    Malicious code in app-sim-layer (npm)

    The npm package app-sim-layer contained malicious code in a postinstall hook that exfiltrated sensitive files (Solana keypairs, API keys, credentials), enumerated the user's filesystem, and on Linux granted remote SSH access to attacker infrastructure at 95.216.118.146.

    npmCompromised packageMalicious commit
  4. containedcritical

    Malicious code in @crbrc/xbt (npm)

    The npm package @crbrc/xbt contains malicious code that exfiltrates OxaPay payment-gateway secrets and host metadata to a hardcoded attacker-controlled IP address, establishes a reverse TCP proxy tunnel, and allows remote process termination. The malicious behavior is conditionally activated only when all project source files import the companion package @crb/xbr.

    npmCompromised packageMalicious commit