T08 · Insecure Dependencies
- Location
SKILL.md:35- Finding
Unpinned Global Installation of an External CLI Dependency
- Content
View full analysis
"The `gitai` CLI tool is not installed. Please install it globally (e.g., `npm install -g @notyped/gitai`) and configure it before using this skill." ``` The README also presents installation scripts that are not included in the audited project: ```markdown ### Installation **MacOS / Linux:** ```bash chmod +x scripts/install.sh ./scripts/install.sh ``` **Windows (PowerShell):** ```powershell .\scripts\install.ps1 ``` ``` ### Technical Analysis The documented npm command installs the latest available release of `@notyped/gitai` globally without pinning a reviewed version or verifying package integrity. Consequently, the dependency resolved at installation time may differ from the implementation that was originally reviewed. A global npm package may execute lifecycle scripts during installation and subsequently runs as a CLI with the permissions of the invoking user. The CLI's intended functions also require access to repository changes and Git operations. A malicious or compromised package release could therefore read source code, inspect accessible credentials, alter repository content, or execute arbitrary commands. The README separately refers to `scripts/install.sh` and `scripts/install.ps1`, but those files do not exist in the supplied project. Their content and security properties therefore cannot be audited. The skill appropriately tells the agent not to perform installation itself, which limits automated exploitation, but users are still directed toward an unpinned external installation. ### Attack Path 1. An attacker compromis ...[truncated 1407 chars]- Remediation
View remediation
``` 2. Publish and verify the expected package digest or npm integrity metadata through a trusted release channel. 3. Prefer a project-local or isolated installation over a global installation to reduce scope and avoid elevated installation privileges. 4. Document the authoritative npm registry and package ownership so users can detect dependency-confusion or registry-substitution attempts. 5. Review the package's lifecycle scripts, transitive dependencies, and CLI source before recommending a release. 6. Use lockfiles or an equivalent reproducible dependency mechanism where possible. 7. Include the referenced installation scripts in the repository so they can be audited, or remove those instructions. 8. Advise users not to use `sudo` or an administrator shell for installation unless strictly necessary. ]]>
