Skip to content
supplychainattack.orgSupply chain attack incident catalog
resolvedcritical

Malicious code in cache-poisoning-pwn-demo (npm)

The npm package cache-poisoning-pwn-demo contains malicious code in its postinstall hook and main entry point that executes platform-specific calculator commands at install-time and import-time without user consent. The package is self-described as a supply-chain attack demonstration, but the delivery mechanism is a fully functional arbitrary-command executor.

ShareXLinkedInHacker News
Disclosed
Last updated
Blast radius
Any npm consumer installing cache-poisoning-pwn-demo or depending on it transitively; execution occurs at install-time and import-time in the installer's context.
Ecosystems
Attack vectors
Affected entities
  • cache-poisoning-pwn-demonpm package containing malicious postinstall hook and poisoned is-number module

The npm package cache-poisoning-pwn-demo was published with malicious code embedded in its postinstall hook and main entry point. The postinstall hook executes node -e \"try { require('./dist/postinstall.js'); } catch(e) {}\", which loads a bundled poisoned is-number module containing a top-level IIFE that unconditionally calls child_process.exec with platform-specific commands: open -a Calculator on macOS, calc.exe on Windows, and gnome-calculator/xcalc on Linux.\n\nThe same malicious IIFE is present in dist/index.js (the package's main entry point), meaning any consumer that requires or imports the package will also trigger arbitrary command execution. The package self-identifies as a supply-chain attack demonstration.\n\nWhile the current payload only spawns a calculator application, the underlying mechanism is a fully functional install-time and import-time arbitrary-command executor. Any installer running npm install or any downstream library that transitively requires this package will execute the hardcoded command in the installer's security context, demonstrating a real attack primitive.\n\nThe incident was identified and credited to the OpenSSF malicious-packages project.

Indicators of compromise

Packages
  • cache-poisoning-pwn-demo

Remediation

  • Remove cache-poisoning-pwn-demo from all dependencies immediately
  • Audit npm install logs and process execution history for evidence of command execution
  • Review all transitive dependencies to identify if cache-poisoning-pwn-demo was pulled in as an indirect dependency
  • Regenerate any credentials or secrets that may have been exposed during the installation window
  • Update npm to the latest version and run `npm audit` to detect similar malicious packages
  • Consider using npm package integrity verification and allowlist/denylist policies to prevent installation of known malicious packages

Sources

  1. GitHub Advisory GHSA-fg76-6277-9c5c · GitHub Advisory Database

Cite this entry

"Malicious code in cache-poisoning-pwn-demo (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed July 27, 2026; last updated July 28, 2026. https://supplychainattack.org/incident/malicious-code-in-cache-poisoning-pwn-demo-npm-1r0pmk

Suggest a correction

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

  1. activecritical

    Malware in @vaultflow/create-flow

    Malware discovered in the npm package @vaultflow/create-flow. Systems with this package installed are considered fully compromised and require immediate remediation.

    npmCompromised package
  2. activecritical

    Malware in @vaultflow/update-flow

    Malware was discovered in the npm package @vaultflow/update-flow. Systems with this package installed or running are considered fully compromised, with potential for complete system takeover.

    npmCompromised package
  3. resolvedcritical

    Malicious code in tempo-components (npm)

    The npm package tempo-components contained malicious code (poc.js) that collected host metadata and identity information and exfiltrated it to an external endpoint. The package performed system reconnaissance by capturing hostname, platform, and user identity before transmitting the data via HTTPS.

    npmCompromised package
  4. containedcritical

    Malicious code in @antv/g-webgl-compute (npm)

    The npm account `atool` was compromised and used to publish 631 malicious versions across 314 npm packages, including @antv/g-webgl-compute, as part of the "Mini Shai-Hulud" supply chain attack campaign. Each malicious version injects a preinstall hook executing an obfuscated Bun script that exfiltrates credentials and establishes persistence via CI/CD workflow injection and system daemons.

    Mini Shai HuludnpmOtherAccount takeoverCompromised packageMalicious commit