@yuanjielab/cli@0.10.1
Malicious code in @yuanjielab/cli (npm)
Analysis
@yuanjielab/cli installs and executes a remote native executable at install time. Its package.json postinstall hook runs scripts/postinstall.js, which maps os.platform()/os.arch() to a target key (darwin/linux/windows × amd64/arm64), fetches the manifest hxxps://ai-ass-file[.]oss-cn-hangzhou[.]aliyuncs[.]com/yj-cli/versions/0.10.1[.]json (host and path overridable via the YJ_DOWNLOAD_BASE environment variable), then downloads the binary from {BASE}/bin/<file> and writes it to vendor/yj with mode 0755. The hook then executes the downloaded file with `execFileSync(target, ['version','--json'])`. The sha256 and byte-length "verification" it performs are self-referential: the checksum is read from the same unauthenticated third-party bucket that serves the binary, so whoever controls that bucket can replace manifest and payload together and have arbitrary code run on every `npm install` of this package, and the check cannot detect a tampered or substituted binary. An escape hatch env var YJ_SKIP_DOWNLOAD suppresses the download. The declared `yj` bin entry (bin/yj.js) is a thin shim that spawnSync-forwards all arguments to the downloaded vendor/yj executable with inherited stdio. No network destination other than the aliyuncs[.]com bucket is contacted by the shipped JavaScript, and no credentials, .npmrc, SSH/AWS material or environment values are read or transmitted by it — the payload that actually runs on the host is the uninspectable downloaded binary.
- analyzed by
- Leitwacht
- first seen
- Nov 6, 2026, 02:36 PM
- analyzed
- Nov 6, 2026, 02:37 PM
- 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.9.0 same package
- @expo-probe-ff8e2b/snack-probe-c2a16@1.0.1
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.