T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:231
- Finding
- Unpinned Global CLI Installation Creates a Supply-Chain Code Execution Risk## Vulnerability Details **File Location**: `SKILL.md:231-234` **Vulnerability Type**: Unpinned third-party package installed globally **Risk Level**: Medium ### Vulnerable Code ```bash npm install -g @larksuite/cli lark-cli config init ``` ### Technical Analysis The installation instructions retrieve the latest available version of `@larksuite/cli` from the user's configured npm registry and install it globally. No exact version, lockfile, or package-integrity verification is specified. npm packages may execute lifecycle scripts during installation. A compromised maintainer account, registry response, package release, or registry configuration could therefore cause arbitrary code to execute with the privileges of the user running the installation. Global installation also exposes the package beyond this Skill's project directory and is not necessary for the declared reaction functionality because the repository already includes a direct HTTPS implementation. This finding does not indicate that the named package is currently malicious. It identifies an unsafe, mutable dependency acquisition process. ### Attack Path 1. An attacker compromises the upstream package, a maintainer account, or the npm registry path used by the victim. 2. The attacker publishes or serves a malicious release under the expected package name. 3. A user follows the Skill instructions and runs `npm install -g @larksuite/cli`. 4. npm downloads the mutable latest release and may execute malicious lifecycle scripts. 5. The installed CLI is subsequently invoked through `lark-cli config init`, providing another opportunity for attacker-controlled code to run. 6. The payload executes as the installing user and may access files, environment variables, network resources, and user-level configuration available to that account. ### Impact Assessment Successful exploitation could provide arbitrary code execution with the current user's privileges. Th ...[truncated 355 chars]
- Remediation
- ## Remediation Suggestions - Avoid global installation and prefer a project-local dependency. - Pin the dependency to an exact, reviewed version rather than accepting the latest release. - Declare the dependency in `package.json` and commit a lockfile with integrity hashes. - In documented workflows, use `npm ci` against the committed lockfile. - Verify that the configured registry is the expected trusted registry before installation. - Review package provenance, signatures, published contents, and lifecycle scripts before approving upgrades. - Prefer the included direct Feishu API implementation when a separate CLI is unnecessary. - If the CLI remains optional, clearly warn users that installation executes third-party code with their account privileges.
