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. resolvedcritical

    Malicious code in sme-rko-finance-front-operations-feed-impl (npm)

    The npm package sme-rko-finance-front-operations-feed-impl contained malicious code that downloads and executes platform-specific binary payloads via Cloudflare Workers or DNS-based staging channels. The malware obfuscates child_process imports and executes on require(), making it active upon installation.

    npmCompromised package
  2. containedcritical

    Malicious code in sme-rko-finance-front-operations-overnight (npm)

    The npm package sme-rko-finance-front-operations-overnight contains malicious code that downloads and executes attacker-controlled binaries from Cloudflare Workers hosts on package require. The payload uses obfuscation techniques to evade static analysis and includes environment-based gating to reduce detection.

    npmCompromised package
  3. containedcritical

    Malicious code in sme-rko-finance-front-payment-registers-operations-domain (npm)

    The npm package sme-rko-finance-front-payment-registers-operations-domain contained malicious code that downloads and executes platform-specific binaries from attacker-controlled infrastructure. The package uses obfuscated string construction to hide command-and-control domains and implements a DNS-TXT fallback channel for payload delivery.

    npmCompromised package
  4. resolvedcritical

    Malicious code in sme-rko-finance-front-operations-providers (npm)

    The npm package sme-rko-finance-front-operations-providers contained malicious code that downloads and executes platform-specific binaries from attacker-controlled Cloudflare Workers subdomains and DNS-TXT fallback channels upon require().

    npmCompromised package