@yuanjielab/cli@0.11.0
Malicious code in @yuanjielab/cli (npm)
Analysis
This package is a thin npm wrapper that, at install time, downloads and runs a native executable from an external object-storage host instead of shipping it in the tarball. The postinstall hook scripts/postinstall.js requests hxxps://ai-ass-file[.]oss-cn-hangzhou[.]aliyuncs[.]com/yj-cli/versions/<package-version>.json, selects the <goos>_<goarch> entry for the current platform, refuses absolute or parent-relative paths, checks the declared byte size and SHA-256 from that document, writes the result to vendor/yj with mode 0755, and then executes it once as `yj version --json`, deleting it if the reported version does not match. The download location can be redirected with the YJ_DOWNLOAD_BASE environment variable and skipped entirely with YJ_SKIP_DOWNLOAD; when skipped, bin/yj.js fails with an error. bin/yj.js is a shim that re-executes vendor/yj with inherited stdio. Because the executable that is actually run on the installer's machine is fetched at install time rather than contained in the package, the code that executes is whatever the remote bucket serves; the package itself carries no repository reference and no licence. IOC: hxxps://ai-ass-file[.]oss-cn-hangzhou[.]aliyuncs[.]com/yj-cli/versions/ (manifest) and /yj-cli/bin/ (binary), configured via YJ_DOWNLOAD_BASE.
- analyzed by
- Leitwacht
- first seen
- Nov 8, 2026, 03:10 PM
- analyzed
- Nov 8, 2026, 03:11 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.10.2 same package
- @yuanjielab/cli@0.10.1 same package
- @yuanjielab/cli@0.9.0 same package
- x3r0day-bunnyhijack-poc@1.0.3
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.