T03 · Remote Payload Retrieval and Execution
Error
- Location
- docs/user_guide.md:82
- Finding
- Privileged Remote Script Download and Immediate Execution<![CDATA[ ## Vulnerability Details **File Location**: `docs/user_guide.md:82-90` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: Critical ### Vulnerable Code ```bash # 1. Open a terminal # 2. Install Node.js (if not installed) curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - sudo apt-get install -y nodejs # 3. Install OpenClaw sudo npm install -g openclaw ``` ### Technical Analysis The installation guide pipes content retrieved from an external URL directly into a privileged shell. The retrieved script is not pinned by digest, saved for inspection, or verified using a cryptographic signature before execution. Although HTTPS protects the connection in transit under normal circumstances, it does not protect users if the upstream distribution service, account, DNS infrastructure, certificate authority, or hosted script is compromised. The effective code executed by this instruction can also change after the Skill package has been audited. Use of `sudo -E bash` executes the remote content as root while preserving parts of the caller's environment. This exceeds the minimum privileges needed merely to explain how to install a runtime and creates a direct root-level code-execution channel. ### Attack Path 1. An attacker compromises the remote setup-script host, its publishing credentials, or a relevant network trust dependency. 2. The attacker modifies the script returned from `https://deb.nodesource.com/setup_16.x`. 3. A user follows the documented installation procedure. 4. `curl` retrieves the attacker-controlled response. 5. The shell pipeline sends the response directly to `sudo -E bash` without local review or integrity validation. 6. The malicious commands execute with root privileges. 7. The payload can modify system files, steal credentials, install persistence, or compromise other accounts and applications on the host. ### Impact Assessment Successful exploitation provides arbitrary command execution ...[truncated 231 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the `curl | sudo bash` pipeline. 2. Prefer distribution-provided packages or manually documented repository configuration steps. 3. If an external installer is unavoidable: - Download it to a local file first. - Pin a specific immutable version. - Publish and verify a cryptographic checksum and vendor signature. - Display the expected signer identity and fingerprint. - Allow the user to inspect the script before execution. 4. Do not preserve unnecessary environment variables when invoking privileged commands. 5. Run only the specific repository-registration or package-installation operations requiring elevation. 6. Document a reproducible, versioned installation process whose effective payload cannot silently change after review. ]]>
