T08 · Insecure Dependencies
- Location
setup.sh:8- Finding
Unpinned Third-Party CLI Installed Globally
- Content
View full analysis
Vulnerability Details
File Location:
setup.sh, lines 8–13
Vulnerability Type: T08: Insecure Dependencies
Risk Level: MediumVulnerable Code
bash if command -v sightglass &>/dev/null; then echo "✅ sightglass CLI installed ($(sightglass --version 2>/dev/null || echo 'unknown version'))" else echo "📦 Installing @sightglass/cli..." npm i -g @sightglass/cli echo "✅ Installed" fiTechnical Analysis
The setup script globally installs the mutable latest release of
@sightglass/cli. It does not specify an exact version, enforce a lockfile, verify an integrity hash, or validate package provenance. The CLI source is not included in the audited project, but subsequent scripts trust the installedsightglassexecutable to monitor projects, analyze agent activity, authenticate users, and optionally transmit analysis results.Consequently, the effective code executed by this skill can change after review. A compromised npm publisher account, malicious package release, or package ownership takeover could cause a future setup operation to install attacker-controlled code. Global installation also makes the executable available outside this project and executes package installation lifecycle scripts with the invoking user's privileges.
Attack Path
- An attacker compromises the npm publisher account or otherwise gains control over a release of
@sightglass/cli. - The attacker publishes a malicious version under the legitimate package name.
- A user follows the documented setup procedure and runs
setup.sh. npm i -g @sightglass/cliresolves and installs the attacker-controlled latest release without version or integrity verification.- npm lifecycle scripts may execute during installation, and the setup script subsequently invokes the installed
sightglasscommand. - The pre-session hook can later launch that executable as a detached watcher with access to the ...[truncated 703 chars]
- An attacker compromises the npm publisher account or otherwise gains control over a release of
- Remediation
View remediation
Remediation Suggestions
- Pin
@sightglass/clito a specific, audited version rather than installing the latest release. - Verify the downloaded artifact using a trusted integrity digest or signed provenance before execution.
- Commit and enforce an appropriate lockfile where feasible.
- Prefer a project-local installation over
npm -gto limit scope and make dependency resolution reproducible. - Use npm provenance and signature verification controls where supported.
- Review and restrict installation lifecycle scripts, including using
--ignore-scriptswhen compatible with the package. - Vendor or publish the CLI source so its executed behavior can be included in security review.
- Run the watcher with restricted filesystem and network permissions, exposing only the project data required for its documented purpose.
- Document the pinned version and establish a controlled process for reviewing and approving upgrades.
- Pin
