T08 · Insecure Dependencies
- Location
SKILL.md:16- Finding
Unpinned Global Installation of an Authenticated Third-Party CLI
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 16-25
Vulnerability Type: Unpinned third-party dependency and unsafe global installation
Risk Level: MediumVulnerable Code Snippet:
bash # Install npm install -g dingtalk-workspace-cli # Authenticate dws auth login # Verify dws auth statusTechnical Analysis
The Skill instructs users to install
dingtalk-workspace-cliglobally without specifying an exact version or verifying the package's integrity, provenance, publisher, or registry source. Consequently, the installed package can vary over time even though the reviewed Skill remains unchanged.npm packages may execute lifecycle scripts during installation. A malicious or compromised release could therefore run code with the privileges of the user performing the installation. Global installation also exposes the resulting executable system-wide for that user's environment.
The risk is amplified because the newly installed
dwsexecutable is immediately used for DingTalk authentication. A compromised package could intercept authentication tokens, modify CLI requests, access data authorized through the account, or perform unauthorized DingTalk operations.Attack Path
- An attacker compromises the npm package, its publisher account, or one of its transitive dependencies.
- The attacker publishes a malicious release under the package name used by the Skill.
- A user follows the documented command, which resolves the latest available version because no exact version is pinned.
- Malicious package lifecycle code executes during the global installation, or malicious runtime code executes when
dwsis invoked. - The user runs
dws auth login, allowing the compromised CLI to observe or capture authentication material. - The attacker abuses the captured session or alters CLI operations to access or modify DingTalk resources within the user's authorized scope.
...[truncated 570 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin the CLI to an exact reviewed version, for example:
bash npm install -g dingtalk-workspace-cli@1.0.32 - Verify the selected version's publisher, provenance, release history, and integrity before recommending it.
- Explicitly use the trusted official npm registry and prevent dependency resolution from untrusted registries.
- Prefer a project-local installation with a committed lockfile over a global installation where operationally feasible.
- Disable npm lifecycle scripts during installation if the package does not require them, then validate that the CLI remains functional.
- Execute the CLI under a dedicated, least-privileged operating-system account or isolated environment.
- Authenticate using a least-privileged DingTalk account or application whose scopes are limited to the required workflows.
- Document token revocation and credential-rotation procedures for responding to a suspected package compromise.
- Periodically review pinned versions for security updates and upgrade only after validating the new release.
- Pin the CLI to an exact reviewed version, for example:
