T08 · Insecure Dependencies
Warning
- Location
- scripts/fix-whatsapp-428.sh:43
- Finding
- Unpinned npm Dependency Installation at Runtime## Vulnerability Details **File Location**: `scripts/fix-whatsapp-428.sh`, lines 43–45 **Vulnerability Type**: Supply-chain exposure through an unpinned runtime dependency **Risk Level**: Medium ```bash # 3. Install https-proxy-agent echo "[3/7] Installing https-proxy-agent..." cd "$OPENCLAW_DIR" npm list https-proxy-agent >/dev/null 2>&1 || npm install https-proxy-agent --save ``` ### Technical Analysis The script installs `https-proxy-agent` from the npm registry without specifying an exact version, enforcing a lockfile, validating package integrity, disabling lifecycle scripts, or confirming the registry from which the package will be retrieved. As a result, the code installed by the script can change after the Skill has been reviewed. The effective dependency source may also be influenced by the user's npm configuration. npm installation can execute package lifecycle scripts, so a compromised package release, registry account, registry mirror, or local npm configuration could result in arbitrary code execution. ### Attack Path 1. `https-proxy-agent` is absent from the target OpenClaw installation. 2. An attacker compromises the relevant package release, registry account, configured registry, or registry mirror. 3. The user invokes `fix-whatsapp-428.sh`. 4. The `npm list` command fails because the package is absent. 5. The script executes `npm install https-proxy-agent --save`, resolving a mutable package version from the configured registry. 6. Malicious lifecycle code may execute during installation, or malicious package code may execute when OpenClaw imports the dependency. ### Impact Assessment Exploitation could execute arbitrary code with the permissions of the user running the repair script. The attacker could modify the global OpenClaw installation, access data available to that user, alter OpenClaw runtime behavior, or establish additional user-level persistence. This script does not invoke `sudo` ...[truncated 96 chars]
- Remediation
- ## Remediation Suggestions - Pin `https-proxy-agent` to a reviewed exact version. - Maintain and enforce a lockfile with integrity hashes. - Use a controlled installation process such as `npm ci` instead of resolving dependencies dynamically on the target system. - Use `--ignore-scripts` when package lifecycle scripts are not required. - Validate that npm is using an approved HTTPS registry before installing anything. - Prefer including this dependency during a controlled OpenClaw build or deployment rather than modifying a deployed global installation. - Verify the installed package version and integrity before restarting OpenClaw.
