T08 · Insecure Dependencies
- Location
SKILL.md:24- Finding
Unpinned Third-Party Package Installation and Execution
- Content
View full analysis
``` ``` ### Technical Analysis The Skill instructs the user or Agent to install and execute `affine-cli` without specifying an exact package version or validating an integrity digest. Both `npm install -g affine-cli` and `npx affine-cli` resolve a mutable package release from the configured npm registry. Consequently, the executable code used at runtime can differ from the code that existed when this Skill was audited. Global installation also adds package-provided executables to the user's environment. Because the CLI is expected to handle an AFFINE API token and authenticated workspace data, a compromised dependency would execute in a sensitive context. No evidence shows that the current `affine-cli` package is malicious. The vulnerability is the unsafe, unpinned supply-chain trust model documented by the Skill. ### Attack Path 1. An attacker compromises the npm package, its publisher account, or the registry resolution path and publishes a malicious release. 2. A user or Agent follows the documented `npm install -g affine-cli` or `npx affine-cli` instruction. 3. npm resolves and executes the attacker-controlled release because no exact version or integrity value is enforced. 4. The package runs with the invoking user's permissions. 5. During authentication or subsequent operations, it may access the AFFINE token, configuration files, local files intentionally supplied to the CLI, and workspace data available to that token. ### Impact Assessment Successful exploitation could provide arbitrary code execution wi ...[truncated 448 chars]- Remediation
View remediation
-- affine-cli ` after validating that version. 5. Document the expected package publisher, registry URL, version, and integrity hash so package substitution can be detected. 6. Review package lifecycle scripts and consider installing with scripts disabled if the package does not require them. 7. Run the CLI with least privilege and expose only the minimum required environment variables and files. 8. Establish a controlled update process in which new versions are reviewed and tested before the pinned version is changed. ]]>
