@yuanjielab/cli@0.12.0
Malicious code in @yuanjielab/cli (npm)
Analysis
@yuanjielab/cli deploys and executes a platform-specific executable during npm install, outside the published tarball. Its postinstall hook scripts/postinstall.js maps the host OS/arch (darwin|linux|windows x amd64|arm64) to a download name, fetches a version-pinned manifest from hxxps://ai-ass-file[.]oss-cn-hangzhou[.]aliyuncs[.]com/yj-cli/versions/<version>.json, then downloads the binary named by that manifest and runs it. The SHA-256 it verifies is read from the same remote manifest, so the integrity anchor is the download host rather than the npm package, and the manifest "path" field alone selects which remote object is fetched (absolute URLs, a leading "/" and ".." are rejected). The distribution host and version pin can be redirected with the YJ_DOWNLOAD_BASE environment variable, and the whole download can be suppressed with YJ_SKIP_DOWNLOAD. The binary is written to vendor/yj with mode 0755 via write-temp-then-rename and executed as `yj version --json` with a 20s timeout; the wrapper bin/yj.js then spawns the vendored binary with inherited stdio and forwards its exit status and signal-derived code. The package is marked UNLICENSED and declares no repository. Nothing in the tarball verifies the provenance of the object that is downloaded and executed.
- analyzed by
- Leitwacht
- first seen
- Nov 9, 2026, 02:40 PM
- analyzed
- Nov 9, 2026, 02:41 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.11.0 same package
- @yuanjielab/cli@0.10.2 same package
- @yuanjielab/cli@0.10.1 same package
- @yuanjielab/cli@0.9.0 same package
- template-pictogram@9.1.3
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.