T08 · Insecure Dependencies
Warning
- Location
- references/install.md:5
- Finding
- Unpinned Third-Party CLI Installation and Execution## Vulnerability Details **File Location**: `references/install.md`, lines 5–26 **Vulnerability Type**: `T08: Insecure Dependencies` **Risk Level**: Medium ### Vulnerable Code ```markdown ## Install Global install (preferred): ``` npm i -g postking-cli ``` ## Ephemeral invocation (no global install) If the global install fails with permission errors (common in sandboxed agent terminals), invoke via `npx` without installing: ``` npx -p postking-cli@latest pking --version ``` Use `npx -p postking-cli@latest pking <command>` for all subsequent calls when running ephemerally. ## Upgrade To upgrade to the latest version: ``` npm i -g postking-cli@latest ``` ``` ### Technical Analysis The installation instructions download and execute `postking-cli` without pinning an exact, audited version or verifying its integrity. Both the unversioned global installation and the explicit `@latest` commands allow the retrieved package contents to change after this Skill has been reviewed. npm package installation may execute package lifecycle scripts. The `npx` workflow also downloads and runs the selected package immediately. The implementation of `postking-cli` is not included in the audited project, so its code, transitive dependencies, and lifecycle behavior could not be verified during this audit. This is particularly sensitive because the documented CLI is subsequently trusted to perform authenticated operations, store local credentials, read user-selected files, upload assets, publish content, initiate billing workflows, and manage API keys. The finding does not establish that the current package is malicious; it identifies an avoidable supply-chain trust boundary. ### Attack Path 1. An attacker compromises the `postking-cli` npm package, a maintainer account, the package publication pipeline, or a transitive dependency. 2. The attacker publishes a malicious release that becomes the package vers ...[truncated 1495 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `postking-cli` to an exact reviewed version rather than using an unversioned package or `@latest`, for example: ```sh npm install --global postking-cli@1.0.3 npx --package=postking-cli@1.0.3 -- pking --version ``` 2. Publish and verify a cryptographic checksum, npm integrity value, signed release, or package provenance attestation before execution. 3. Audit the pinned package, its lifecycle scripts, and its complete transitive dependency tree. Repeat this review before changing the pinned version. 4. Prefer a project-local installation governed by a committed lockfile over a global installation. 5. Where compatible with the verified package, disable installation lifecycle scripts with `--ignore-scripts`; otherwise, explicitly audit every required lifecycle script. 6. Run the CLI as an unprivileged user in a restricted environment. Do not use `sudo` for global installation. 7. Limit filesystem visibility, environment variables, and PostKing API scopes to those required for the requested operation. 8. Require explicit user confirmation before file uploads, publishing, deletion, billing, API-key creation, or other consequential operations. 9. Consider vendoring the reviewed CLI implementation or linking installation instructions to a reproducible, signed release artifact.
