T08 · Insecure Dependencies
Warning
- Location
- references/troubleshooting.md:8
- Finding
- Unpinned Global Package Installation Creates Supply-Chain Risk## Vulnerability Details **File Location**: `references/troubleshooting.md`, lines 8-12 **Vulnerability Type**: Unpinned third-party package installation **Risk Level**: Medium ### Vulnerable Code ```bash ### Gateway crashes repeatedly - Check logs: `openclaw gateway logs` - Verify Node.js version: `node --version` (need v20+) - Check LaunchAgent: `launchctl list | grep openclaw` - Reinstall: `npm install -g openclaw` ``` ### Technical Analysis The troubleshooting instructions recommend installing `openclaw` globally from the configured npm registry without specifying a reviewed version or verifying package integrity. The effective code installed by this command can therefore change after the Skill has been audited. npm packages may contain lifecycle scripts that execute during installation. If the registry package, maintainer account, dependency tree, or local npm registry configuration is compromised, following this instruction could execute attacker-controlled code. The risk is increased by global installation because the package exposes commands across the user's environment and modifies a shared package location. The command does not explicitly use `sudo`, so execution is ordinarily limited to the privileges of the user running npm. If a user independently prefixes it with `sudo` or uses a privileged npm environment, package lifecycle code could run with elevated privileges. ### Attack Path 1. An attacker compromises the published `openclaw` package, one of its dependencies, a maintainer account, or a registry endpoint used by the victim. 2. A malicious package version or dependency is published under the expected package name. 3. The victim experiences repeated gateway crashes and follows the documented reinstall instruction. 4. `npm install -g openclaw` resolves the current package version rather than a specifically reviewed release. 5. npm downloads the compromised content and may execute its lifecycle sc ...[truncated 777 chars]
- Remediation
- ## Remediation Suggestions - Pin installation instructions to a specifically reviewed release, for example: ```bash npm install -g openclaw@REVIEWED_VERSION ``` - Document the expected official npm package name, publisher, and registry URL. - Verify the package version and integrity before installation. Where practical, distribute and validate signed release artifacts or documented checksums. - Review the package's lifecycle scripts and dependency tree before recommending a release. - Avoid running global package installations through `sudo`; install with the minimum privileges required. - Prefer a reproducible installation mechanism using a lockfile or an equivalent integrity-controlled dependency manifest. - Consider first offering a repair or rollback procedure that does not automatically resolve mutable package content.
