T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:26
- Finding
- Unpinned Global Installation of a Credential-Handling Third-Party CLI<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 26–30 **Vulnerability Type**: `T08: Insecure Dependencies` **Risk Level**: Medium ### Vulnerable Code ```markdown If the CLI is not installed, install it: ```bash npm install -g tiktok-ads-cli ``` ``` ### Technical Analysis The Skill instructs users to install the latest available version of `tiktok-ads-cli` globally from npm. The dependency is not pinned to a reviewed version, and the installation instruction supplies no integrity hash, lockfile, provenance verification, or publisher-validation procedure. This CLI is subsequently entrusted with a TikTok OAuth access token and access to advertising account information. npm installation may also execute package lifecycle scripts with the invoking user's local privileges. Consequently, compromise of the package, publisher account, or a future package release could introduce arbitrary code after the Skill itself has been audited. Global installation expands the exposure because the executable is placed in a system-wide or user-wide command path and may remain available across later sessions. ### Attack Path 1. An attacker compromises the npm package, its publisher account, or its release pipeline. 2. The attacker publishes a malicious version of `tiktok-ads-cli`. 3. A user follows the Skill instruction and runs `npm install -g tiktok-ads-cli`. 4. npm retrieves the current malicious release and may execute its lifecycle scripts during installation. 5. The malicious package executes with the installing user's privileges. 6. When invoked, the CLI can access the configured TikTok OAuth token through the environment, the `--credentials` argument, or `~/.config/tiktok-ads-cli/credentials.json`. 7. The package can exfiltrate credentials or advertising data, modify local user files, or perform other actions permitted to the user. ### Impact Assessment Successful exploitation could result in: - Theft of TikTok OAuth access tokens and option ...[truncated 618 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the CLI to an explicitly reviewed version, for example: ```bash npm install --global tiktok-ads-cli@<reviewed-version> ``` 2. Document the expected npm publisher, source repository, package version, and integrity checksum so users can verify package provenance before installation. 3. Prefer a project-local installation governed by a committed lockfile instead of a global installation: ```bash npm install --save-exact tiktok-ads-cli@<reviewed-version> ``` 4. Use npm provenance and integrity verification where supported, and periodically audit the pinned package and its transitive dependencies. 5. Disable lifecycle scripts during installation where compatible: ```bash npm install --ignore-scripts --save-exact tiktok-ads-cli@<reviewed-version> ``` 6. Run the CLI in a restricted environment with minimal filesystem and network access. 7. Use short-lived, least-privilege TikTok tokens restricted to only the advertiser accounts and read operations required for the task. 8. Protect credential files with restrictive permissions and avoid passing secrets through command-line arguments where they may be exposed through process listings or shell history. ]]>
