@swirls/cli@0.1.145
Malicious code in @swirls/cli (npm)
Analysis
Both published versions of this package install through a postinstall hook (scripts/install.js) that executes an unpinned remote installer with the privileges of the installing user. On macOS/Linux it runs `execSync("curl -fsSL hxxps://swirls[.]ai/install | bash")` with shell:true; on Windows it runs `powershell.exe -NoProfile -Command irm hxxps://swirls[.]ai/install[.]ps1 | iex` with SWIRLS_YES=1 injected into the environment. The hook is gated to global installs (npm_config_global or BUN_INSTALL_GLOBAL must be set) and exits early when CI is set, so it fires in the normal `npm install -g @swirls/cli` case. After fetching, it copies ~/.local/bin/swirls over the package's own bin/swirls entry point and chmods it 0755, so the shipped bin becomes a downloaded binary at install time. The fetched script is not versioned, pinned, hashed or otherwise integrity-checked; whatever the remote endpoint serves at install time executes with full user (root for -g) privileges and entirely bypasses npm tarball integrity verification. The bundled bin/swirls is a 35-line Node shim whose only action is to run ~/.local/bin/swirls.exe on Windows or print an error telling the user to run the same `curl -fsSL hxxps://wirls[.]ai/install | bash` command, and bin/README.txt documents that the tracked bin file is a placeholder to be replaced by the download. Endpoints: hxxps://swirls[.]ai/install (shell), hxxps://swirls[.]ai/install[.]ps1 (PowerShell).
- analyzed by
- Leitwacht
- first seen
- Nov 8, 2026, 05:58 PM
- analyzed
- Nov 8, 2026, 05:59 PM
- weekly installs
- 1,372
Related advisories
- @swirls/cli@0.1.149 same package
- @swirls/cli@0.1.148 same package
- @swirls/cli@0.1.146 same package
- @swirls/cli@0.1.144 same package
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.