T08 · Insecure Dependencies
- Location
SKILL.md:21- Finding
Unpinned Global Installation of a Third-Party CLI Package
- Content
View full analysis
/dev/null 2>&1 || npm i -g @fly-ai/flyai-cli ``` The surrounding instructions require this installation to occur before any trip-planning operation and direct the agent to execute it immediately if `flyai` is unavailable. ### Technical Analysis The skill installs `@fly-ai/flyai-cli` globally without specifying a reviewed version, validating a cryptographic integrity hash, using a lockfile, or obtaining explicit user approval. Consequently, the package version and effective installation payload can change after the skill itself has been audited. An npm installation can execute package lifecycle scripts such as `preinstall`, `install`, and `postinstall`. Those scripts run with the privileges of the account executing the agent. The global `-g` installation also modifies the user's shared environment rather than an isolated project directory. Although the repository does not establish that the named package is currently malicious, the mandatory mutable installation creates a supply-chain exposure. A compromised maintainer account, malicious future release, registry compromise, or dependency-level compromise could turn an otherwise ordinary trip-planning request into arbitrary local code execution. ### Attack Path 1. An attacker compromises the npm package, one of its transitive dependencies, or the associated publishing account. 2. The attacker publishes a malicious release or modifies an installation-time dependency. 3. A user invokes this skill for a trip-planning request on a system where `flyai` is not already installed. 4. The skill instructs the agent to execute `npm i -g @fly-ai/flyai-cli`. 5. npm retrieves the mutable package release and executes any applicable lifecycle scripts. 6. Malicious code runs with the privileges of ...[truncated 785 chars]- Remediation
View remediation
``` 2. Use a project-local dependency and a committed lockfile rather than a global installation. 3. Enforce package integrity through a lockfile, verified registry metadata, and approved cryptographic hashes where the package-management workflow supports them. 4. Review the selected package version, its transitive dependencies, and all npm lifecycle scripts before approval. 5. Require explicit user consent before downloading or installing software. 6. Install the CLI in a restricted sandbox or container with minimal filesystem, credential, and network access. 7. Consider disabling lifecycle scripts with `--ignore-scripts` if the package functions correctly without them. 8. Fail safely when the reviewed dependency is unavailable instead of automatically installing the newest registry release. ]]>
