VDB
KO

MAL-2026-11947

Malicious code in @servicetitan/unit-tests (npm)

Details

npm/@servicetitan/unit-tests is affected by the large-scale, self-propagating npm supply-chain worm of 2026-08-04 (the "Shai-Hulud: Here We Go Again" wave) — the same campaign that began with the compromise of the keyv and cacheable maintainer account. The listed version(s) were trojanized and republished by the worm after it reached an npm publish token belonging to a maintainer in this namespace; the payload enumerates every package a stolen token controls and republishes each with the same hook, so many packages under this scope were poisoned in the same short window. Every poisoned release adds a preinstall hook (`"preinstall": "node setup.mjs"`) that runs on a bare `npm install`, before any project code. setup.mjs downloads a standalone Bun runtime and runs a byte-identical, heavily obfuscated ~728 KB second-stage credential stealer (shipped as Math_Symbol.js / math_init.js). It harvests GitHub, npm, AWS, GCP, Azure, HashiCorp Vault and Kubernetes credentials plus generic secrets and private keys (TruffleHog-style sweep), reads CI/CD secrets and identifies build runners, then republishes further packages the stolen token can reach. Rather than a fixed command-and-control host, it exfiltrates stolen findings to attacker-created GitHub repositories (descriptions reading "Shai-Hulud: Here We Go Again") and over DNS. Treat any environment that installed an affected version (with install scripts enabled) as compromised: rotate and revoke all reachable credentials (npm and GitHub tokens, cloud keys, Vault/Kubernetes secrets, and CI org/repo secrets). Part of the August 2026 npm worm that poisoned 400+ packages across many organizations.

--- _-= Per source details. Do not edit below this line.=-_

## Source: amazon-inspector (4b7a46174d584d3ef7db347d0b5eba90d024c5afe874b51ae0f80168c360bea0) The package declares `scripts.preinstall = "node setup.mjs"`. On `npm install`, setup.mjs probes for a system `bun` binary and, if absent, downloads the Bun runtime from `github.com/oven-sh/bun/releases/download/bun-v<V>/...zip`, chmods it executable, and then invokes `execFileSync(bunBinary, ['math_init.js'], { stdio: 'inherit', cwd: D })`. The `math_init.js` file adjacent to setup.mjs is a 727KB Bun-compiled bundle (`// @bun @bun-cjs`) using string-array rotation obfuscation (a `WV8StW` shift routine over a large `n7gIxM` numeric/string array, `_0x`-style identifiers) with URL- and email-shaped fragments hidden across the string array; its behavior is not statically inspectable and only executes under the freshly dropped Bun runtime, evading Node-based scanners. The package impersonates ServiceTitan's private npm scope: name is `@servicetitan/unit-tests`, `description` is empty, the repository field points at `servicetitan/playground.git`, and the README is titled `uikit · Frontend Platform monorepo` — content unrelated to a `unit-tests` helper. `dist/index.js` is a small shim that re-exports `ts-mockito`, providing benign cover while the actual install-time behavior lives in the preinstall alternate-runtime dropper. The combined shape — namespace-hijack of a private vendor scope, mismatched README, benign shim as the documented entry point, and a preinstall step that fetches a second language runtime solely to execute an opaque bundled payload — is the alternate-runtime dropper pattern executed on default `npm install`.

## Source: ghsa-malware (f63b3a06239a9c5595852ba62732cdea99a32696205a3eb844ba4080b2562770) 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.

Are you affected?

Enter the version of the package you're using.

Affected packages

npm / @servicetitan/unit-tests

No fixed version published yet for @servicetitan/unit-tests (npm). Pin to a known-safe version or switch to an alternative.

References