@yuanjielab/cli@0.8.2
Malicious code in @yuanjielab/cli (npm)
Analysis
The package's postinstall hook (scripts/postinstall.js, invoked as `node scripts/postinstall.js`) downloads an opaque, platform-specific executable at install time and runs it. It fetches hxxps://ai-ass-file[.]oss-cn-hangzhou[.]aliyuncs[.]com/yj-cli/versions/<version>.json, picks the entry for the current <goos>_<goarch>, downloads the referenced file from the same bucket, verifies it against a sha256 listed in that same manifest — a manifest fetched over the same unauthenticated channel from the same host, so the check cannot detect a substituted or poisoned distribution point — then writes it to vendor/yj with mode 0755 and immediately executes it (execFileSync(target, ['version','--json'])). The downloaded binary is not part of the published tarball, so its contents are publisher-controlled at install time and invisible to package review. The shipped bin entry bin/yj.js simply spawns vendor/yj with inherited stdio, so every later invocation runs the downloaded payload. Distribution endpoints: hxxps://ai-ass-file[.]oss-cn-hangzhou[.]aliyuncs[.]com/yj-cli/versions/<version>.json and hxxps://ai-ass-file[.]oss-cn-hangzhou[.]aliyuncs[.]com/yj-cli/<relative-path>.
- analyzed by
- Leitwacht
- first seen
- Nov 5, 2026, 09:20 AM
- analyzed
- Nov 5, 2026, 09:20 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
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.