@yuanjielab/cli@0.9.0
Malicious code in @yuanjielab/cli (npm)
Analysis
The package installs a CLI (`yj`) and its postinstall hook downloads and executes a platform-specific native binary that the npm tarball does not contain or pin. scripts/postinstall.js maps os.platform()/os.arch() to an artifact key, requests hxxps://ai-ass-file[.]oss-cn-hangzhou[.]aliyuncs[.]com/yj-cli/versions/0[.]9[.]0[.]json, follows manifest.platforms[<os>_<arch>].path to fetch the binary from the same OSS bucket, checks its byte length and sha256 against that manifest, writes it to vendor/yj with mode 0755, and immediately runs it (execFileSync with `version --json`). bin/yj.js is a spawnSync shim that forwards arguments to that binary. Because the integrity manifest is served from the same distribution host as the executable it validates, the checksum gives no protection against that host being compromised or repointed, and the download source can be redirected with the YJ_DOWNLOAD_BASE environment variable (YJ_SKIP_DOWNLOAD skips it). No installer credentials, tokens, shell profiles or wallet files are read, and nothing is uploaded - network activity is limited to those two downloads. The code that ends up running on the installer's machine is therefore determined entirely by the remote distribution host, not by the published package.
- analyzed by
- Leitwacht
- first seen
- Nov 6, 2026, 06:47 AM
- analyzed
- Nov 6, 2026, 06:48 AM
- weekly installs
- 1,803
Related advisories
- @yuanjielab/cli@0.15.0 same package
- @yuanjielab/cli@0.14.0 same package
- @yuanjielab/cli@0.13.0 same package
- @yuanjielab/cli@0.12.0 same package
- @yuanjielab/cli@0.11.0 same package
- @yuanjielab/cli@0.10.2 same package
- @yuanjielab/cli@0.10.1 same package
- neun-by-neun@0.1.0
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.