MAL-2026-18377
Malicious code in spectral-core (npm)
Auswirkung
spectral-core contains no library code: where an index.js is present (e.g. 3.0.12) it only exports the package name and version. It ships a binding.gyp (and package.json sets `"gypfile": true`), so npm runs `node-gyp rebuild` on install, and the binding.gyp declares a build action ("Finalizing spectral-core setup") that runs inline JavaScript with `node -e`. Versions 3.0.3 to 3.0.12 (3.0.8 was never published) were published on 2026-10-28 between 19:42 and 21:24 UTC, each with a different collection script. Depending on the version, the script: - reads the environment of PID 1 (`/proc/1/environ`; 3.0.4, 3.0.6) and of its own process (`/proc/self/environ`; 3.0.6), greps the environment for `htb` and `flag` (3.0.4), and enumerates `process.env` with `Object.entries` (3.0.11, 3.0.12); - searches the filesystem for files named `*flag*` or `*HTB*` and for files containing `HTB{`, and prints the first lines of `/run/secrets/*` (3.0.3); recursively lists `/var/run/secrets` (3.0.5); reads `/flag.txt` (3.0.9); - reads `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` and the ECS container metadata URI variable (3.0.7), and fetches the ECS task metadata endpoint (`$ECS_CONTAINER_METADATA_URI/task`) with curl and posts the result (3.0.11); - reads `/fetch.sh`, `/run_test.sh` and `/setup_test.sh` (3.0.5) and `/opt/ph/sitecustomize.py` (3.0.12), lists `/scripts` (3.0.10) and `/opt` (3.0.11), and collects `/etc/resolv.conf`, `ip neigh` and `ip route` output (3.0.6); - sends data off the host over HTTPS. In 3.0.7 and 3.0.9 to 3.0.12 the scanned code POSTs to webhook.site (path `/d6092bdc-05c0-45da-a280-c343ea6d6156` in 3.0.7, `/f604623f-fc78-4447-9225-6772f7f12cb1` in 3.0.9 to 3.0.12). In 3.0.3 to 3.0.6 the destination is outside the scanned excerpt, but each version loads `https` and a full-file static rule for webhook/collection services matched. Version 3.0.6 also shipped a file named `CTF_HANDOFF_CURSE_DEPENDENT_v2.md`, and the strings searched for suggest the author was targeting a
Betroffene Pakete
| Ökosystem | Paket | Betroffen | Behoben in |
|---|---|---|---|
| npm | spectral-core | unbekannt | nicht erfasst |
Schwachstellenklasse
Referenzen
- https://osv.dev/vulnerability/MAL-2026-18377
- https://www.npmjs.com/package/spectral-core/v/3.0.6
- https://www.npmjs.com/package/spectral-core/v/3.0.4
- https://www.npmjs.com/package/spectral-core/v/3.0.10
- https://www.npmjs.com/package/spectral-core/v/3.0.5
- https://www.npmjs.com/package/spectral-core/v/3.0.3
- https://www.npmjs.com/package/spectral-core/v/3.0.11
- https://www.npmjs.com/package/spectral-core/v/3.0.7
- https://www.npmjs.com/package/spectral-core/v/3.0.12
- https://www.npmjs.com/package/spectral-core/v/3.0.9
- https://www.npmjs.com/package/spectral-core/v/3.0.2