@yuanjielab/cli@0.8.0
Malicious code in @yuanjielab/cli (npm)
Analysis
@yuanjielab/cli@0.8.0 is a four-file npm package (package.json, README.md, bin/yj.js, scripts/postinstall.js) whose install-time logic executes code that is not contained in the tarball. Its package.json postinstall hook runs `node scripts/postinstall.js`, which resolves the host platform via os.platform()/os.arch(), then issues a GET to hxxps://ai-ass-file[.]oss-cn-hangzhou[.]aliyuncs[.]com/yj-cli/versions/0.8.0.json, reads the platform entry from that manifest, downloads the referenced native executable from the same bucket, writes it to vendor/yj with mode 0755, and runs it with execFileSync(vendor/yj, ['version','--json']). The only integrity check is a SHA-256 value taken from the same remote manifest used to locate the download, so the hash travels with the payload and does not authenticate it against any independent source; the executable itself never ships in the npm tarball and cannot be inspected from the registry. Two environment variables alter this path: YJ_DOWNLOAD_BASE replaces the download origin, and YJ_SKIP_DOWNLOAD bypasses the download entirely. The companion bin/yj.js is a spawnSync shim that forwards all arguments and the exit status to vendor/yj.
- analyzed by
- Leitwacht
- first seen
- Nov 3, 2026, 12:54 PM
- analyzed
- Nov 3, 2026, 12:55 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.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.