T08 · Insecure Dependencies
Warning
- Location
- INSTALL.md:4
- Finding
- Unpinned npm and npx Dependencies Permit Supply-Chain Code Execution<![CDATA[ ## Vulnerability Details **File Location**: `INSTALL.md:4`, `INSTALL.md:13`, and `INSTALL.md:28` **Vulnerability Type**: Unpinned executable third-party dependencies **Risk Level**: Medium ### Vulnerable Code ```sh npx clawhub install gougoubi-arena-trade ``` ```sh npx clawhub install gougoubi-agent-register ``` ```sh npm install @gougoubi-ai/agent-sdk ``` ### Technical Analysis The installation instructions do not specify reviewed package versions or integrity values. The two `npx clawhub` commands may retrieve and execute the version of `clawhub` currently supplied by the configured npm registry. The SDK installation similarly resolves the current package release and its transitive dependency graph rather than a known, audited dependency set. This makes the effective installation payload mutable after the skill has been reviewed. If the `clawhub` package, SDK package, a transitive dependency, maintainer account, or relevant registry entry is compromised, users following these instructions could receive attacker-controlled code. The `npx` commands pose the most direct risk because they invoke downloaded package code. The `npm install` command may also execute package lifecycle scripts during installation, while the installed SDK code will execute when imported by the application. This finding does not establish that any current package is malicious. It identifies an unsafe dependency acquisition process that depends on mutable external registry state. ### Attack Path 1. An attacker compromises the npm account, registry entry, or release pipeline for `clawhub`, `@gougoubi-ai/agent-sdk`, or one of their transitive dependencies. 2. The attacker publishes a malicious release or replaces a dependency with a compromised version. 3. A user follows `INSTALL.md` without specifying an audited version. 4. `npx` or npm resolves and downloads the attacker-controlled release. 5. Malicious code executes through the `npx` command, an npm lifecycle script ...[truncated 931 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every directly invoked package to an exact reviewed version: ```sh npx --package=clawhub@<reviewed-version> clawhub install gougoubi-arena-trade npx --package=clawhub@<reviewed-version> clawhub install gougoubi-agent-register npm install --save-exact @gougoubi-ai/agent-sdk@<reviewed-version> ``` 2. Commit a generated lockfile and use `npm ci` in CI and production installation workflows so the complete transitive dependency graph is reproducible. 3. Verify package provenance, publisher identity, registry source, signatures where supported, and lockfile integrity before installation. 4. Audit whether the packages require lifecycle scripts. If they do not, install with lifecycle scripts disabled: ```sh npm ci --ignore-scripts ``` If scripts are required, review and explicitly allow only the necessary scripts. 5. Configure npm to use a trusted registry explicitly and prevent dependency-confusion resolution through unintended public or internal registries. 6. Run installation in an isolated, least-privileged environment without production secrets. Inject `GGB_AGENT_API_KEY` only at runtime rather than exposing it during dependency installation. 7. Add automated dependency scanning and update pinned versions only after reviewing release changes and regenerated lockfile differences. ]]>
