Supply-chain threat intelligence

Incident detail

criticalnpm·maintainer compromise·osv

Malicious code in coral-wraith (npm)

coral-wraith

Risk score

92

AI summary

Indexed incident for coral-wraith (npm).

Description

The package's postinstall.js runs at install time and performs a credential-harvest + host-tampering chain against the installer. It enumerates npm credentials by calling npm config get for keys including _authToken, _auth, registry, //registry.spectral-corsair.htb:1337/:_authToken, //registry.spectral-corsair.htb/:_authToken, and //154.57.164.64:32271/:_authToken, dumps the full npm config list --json, and reads /usr/lib/node_modules/npm/.npmrc, /etc/hosts, /app/.bowerrc, /root/.bowerrc, and source files under /app (Cargo.toml, main.rs) plus filesystem-wide flag/secret greps. The collected output is base64-encoded and HTTP PUT to a hardcoded bare IP http://154.57.164.64:32271/api/modules/.... Separately, postinstall.js appends 154.57.164.64 registry.spectral-corsair.htb to /etc/hosts when not already present, then queries the spoofed registry via curl and npm view — install-time host-file tampering that redirects a registry hostname to an attacker-controlled IP and enables later package substitution / MITM. Execution is gated by an anti-analysis shouldRun() that bypasses CI environments (GITHUB_ACTIONS, RUNNER_OS, CI), Chinese registry mirrors (npmmirror, tencent, cnpm, taobao), and /tmp working dirs, and only fires when the hostname matches a 12-hex Docker short-id pattern and cwd contains /app — narrow targeting that confirms intent while shipping the malicious code unconditionally.

Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.

The OpenSSF Package Analysis project identified 'coral-wraith' @ 6.0.0 (npm) as malicious.

It is considered malicious because:

  • The package executes one or more commands associated with malicious behavior.

Technical details

Affected versions

=6.0.0=19.0.0=7.0.0=11.0.0=1.0.4=1.0.9=1.0.5=7.0.1=5.0.3=15.0.0=1.0.2=4.0.0=1.0.8=1.0.0=1.0.7=1.0.6=14.0.0=1.0.12=1.0.14=9.0.0=12.0.1=13.0.0=5.0.2=1.0.11=12.0.0=2.0.1=2.0.4=7.0.2=2.0.2=5.0.1=17.0.0=2.0.3=1.0.10=22.0.0=21.0.0=10.0.0=20.0.0=1.0.3=8.0.0=1.0.1=3.0.0=16.0.0=19.0.1=7.0.3=1.0.13=2.0.0>=0

Indicators

  • Advisory IDs
    90%
  • affected version=6.0.075%
  • affected version=19.0.075%
  • affected version=7.0.075%
  • affected version=11.0.075%
  • affected version=1.0.475%
  • affected version=1.0.975%
  • affected version=1.0.575%
  • affected version=7.0.175%
  • affected version=5.0.375%
  • affected version=15.0.075%
  • affected version=1.0.275%
  • affected version=4.0.075%
  • affected version=1.0.875%
  • affected version=1.0.075%
  • affected version=1.0.775%
  • affected version=1.0.675%
  • affected version=14.0.075%
  • affected version=1.0.1275%
  • affected version=1.0.1475%
  • affected version=9.0.075%
  • affected version=12.0.175%
  • affected version=13.0.075%
  • affected version=5.0.275%
  • affected version=1.0.1175%
  • affected version=12.0.075%
  • affected version=2.0.175%
  • affected version=2.0.475%
  • affected version=7.0.275%
  • affected version=2.0.275%
  • affected version=5.0.175%
  • affected version=17.0.075%
  • affected version=2.0.375%
  • affected version=1.0.1075%
  • affected version=22.0.075%
  • affected version=21.0.075%
  • affected version=10.0.075%
  • affected version=20.0.075%
  • affected version=1.0.375%
  • affected version=8.0.075%
  • affected version=1.0.175%
  • affected version=3.0.075%
  • affected version=16.0.075%
  • affected version=19.0.175%
  • affected version=7.0.375%
  • affected version=1.0.1375%
  • affected version=2.0.075%
  • affected version>=075%

Timeline

  1. Advisory published
  2. Indexed by ThreatPkg

Related incidents