T08 · Insecure Dependencies
Error
- Location
- SKILL.md:10
- Finding
- Unpinned Global Installation of a Third-Party Package## Vulnerability Details **File Location**: `SKILL.md`, lines 10-16 **Vulnerability Type**: Supply-chain exposure through an unpinned npm dependency **Risk Level**: High ### Vulnerable Code ```markdown ## Installation If `cognary-cli` is not installed, install it first: ```bash npm install -g cognary-cli ``` ``` ### Technical Analysis The Skill instructs the agent to install `cognary-cli` globally from the npm registry without pinning a reviewed version or validating package integrity. This resolves to whichever version and associated lifecycle scripts the registry serves at installation time. Consequently, the package executed in the future may differ from the package that existed when the Skill was audited. A global npm installation may execute package lifecycle scripts with the permissions of the user running the agent. The instruction does not require publisher verification, an integrity hash, a lockfile, an isolated environment, or explicit approval immediately before installation. This is a supply-chain weakness rather than evidence that the current `cognary-cli` package is malicious. Exploitation depends on a compromised publisher account, registry compromise, malicious future release, or similarly unsafe package-source event. ### Attack Path 1. The Skill is invoked on a system where `cognary-cli` is absent. 2. An agent follows the installation instruction. 3. npm resolves the unpinned package name to the latest available release. 4. A compromised or malicious release is downloaded. 5. npm executes any applicable package installation lifecycle scripts. 6. The package or its scripts perform attacker-controlled actions with the invoking user's permissions. ### Impact Assessment Successful exploitation could allow arbitrary code execution under the account running npm. Potential scope includes reading or modifying files accessible to that account, accessing environment variables such as `COGNARY_API ...[truncated 318 chars]
- Remediation
- ## Remediation Suggestions - Pin `cognary-cli` to a specifically reviewed version rather than installing the latest release implicitly. - Verify the package publisher, source repository, release provenance, and npm integrity metadata. - Prefer a project-local dependency governed by a lockfile instead of a global installation. - Disable lifecycle scripts during installation where compatible with the package's operation. - Run the CLI in a restricted environment with minimal filesystem, environment-variable, and network access. - Require explicit user approval before installing software or executing package lifecycle scripts. - Establish a controlled update process that re-reviews new package versions before changing the pin.
