Supply-chain threat intelligence

Incident detail

criticalnpm·malware·osv

Malicious code in test-pkg-x0 (npm)

test-pkg-x0

Risk score

92

AI summary

Indexed incident for test-pkg-x0 (npm).

Description

Package declares scripts.postinstall pointing at shim.js, a script that runs unconditionally on npm install. shim.js branches on uname -s (Darwin/MINGW/Linux) and executes OS-native commands on the installer's machine, including launching the Calculator application and opening https://github.com/X3r0Day/BunnyHijack in the installer's default browser via open / cmd /c start / xdg-open. Additionally, package.json registers a bin entry named node mapped to shim.js. Under package managers that resolve node from node_modules/.bin (notably bun), any dependency postinstall that invokes node will execute this shim instead of the real Node.js runtime; the declared dependency protoc-gen-grpc-web is used as the trigger. The combined effect is arbitrary command execution on the installer at install time, both directly via the package's own postinstall and indirectly by hijacking the node command for sibling dependencies' install scripts. The Calculator launch and browser navigation are a proof-of-concept payload; the underlying execution primitive is fully attacker-controlled.

Technical details

Affected versions

=1.0.4=1.0.3=1.0.0=1.0.2=1.0.1

Indicators

  • affected version=1.0.475%
  • affected version=1.0.375%
  • affected version=1.0.075%
  • affected version=1.0.275%
  • affected version=1.0.175%

Timeline

  1. Advisory published
  2. Indexed by ThreatPkg

Related incidents