T08 · Insecure Dependencies
- Location
SKILL.md:33- Finding
Unpinned Third-Party Packages and Git-Based Plugins
- Content
View full analysis
= 21 opencli doctor # run before browser-dependent work (see below) # From source git clone git@github.com:jackwener/OpenCLI.git cd OpenCLI && npm install npx tsx src/main.ts # same surface, no global install ``` At lines 128–131: ```bash opencli plugin install github:user/repo # install opencli plugin list [-f json] # see installed opencli plugin update [name] | --all # keep current opencli plugin uninstall ``` ### Technical Analysis The documented installation commands retrieve executable software without pinning it to reviewed, immutable versions or commits: - `npm install -g @jackwener/opencli` installs the package version currently selected by the registry. - `git clone` checks out the repository's current default branch rather than a reviewed commit. - `npm install` resolves and installs the dependency graph associated with the retrieved source. Package lifecycle scripts may execute during installation unless explicitly disabled. - `npx tsx` may resolve a package dynamically when it is not already installed and then executes the project entry point. - Plugin installation accepts a generic `github:user/repo` source, while plugin updates can retrieve newer code without requiring a reviewed commit hash. Consequently, the effective code installed or executed later may differ from the code that was previously audited. Exploitation would require compromise or malicious control of a selected package, transitive dependency, repository, plugin, or release channel. The file does not itself contain an embedded malicious payload, so this finding conc ...[truncated 1637 chars]- Remediation
View remediation
``` 2. Publish and verify package integrity metadata or signed release artifacts. Document the expected checksum or signature and require verification before installation. 3. Pin source installations to a reviewed commit or signed tag: ```bash git clone git@github.com:jackwener/OpenCLI.git cd OpenCLI git checkout --detach ``` 4. Commit a lockfile and use deterministic dependency installation, such as `npm ci`, rather than unconstrained resolution through `npm install`. 5. Consider disabling dependency lifecycle scripts during initial installation where compatible: ```bash npm ci --ignore-scripts ``` Any scripts that are genuinely required should be separately reviewed and run explicitly. 6. Avoid dynamic `npx` package resolution. Install a pinned `tsx` version through the lockfile and invoke the local binary. 7. Require plugins to be pinned to immutable commit hashes or signed releases. Maintain an allowlist of reviewed plugin repositories and versions. 8. Make plugin updates explicit rather than automatically tracking mutable upstream state. Display the old and new commit hashes and require review or confirmation before activation. 9. Run plugins and browser-integrated components with least privilege. Restrict access to sensitive environment variables, credentials, files, and authenticated browser sessions where practical. ]]>
