T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/openclaw-generator-template.sh:39
- Finding
- Unsafe Remote Installer Execution Through curl-to-Bash Instruction<![CDATA[ ## Vulnerability Details **File Location**: `scripts/openclaw-generator-template.sh:39-42` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High ### Vulnerable Code ```bash if ! command -v openclaw &> /dev/null; then err "OpenClaw not found. Install: curl -fsSL https://openclaw.ai/install.sh | bash" exit 1 fi ``` ### Technical Analysis When OpenClaw is unavailable, the generated deployment script instructs the user to pipe a remotely downloaded script directly into Bash: ```bash curl -fsSL https://openclaw.ai/install.sh | bash ``` The command does not pin a release, validate a cryptographic signature, or verify a checksum. It also prevents the user from inspecting the complete downloaded artifact before execution. The effective code can change after this Skill has been reviewed. The deployment script only prints the command and does not execute it automatically. Nevertheless, it presents the command as the prescribed installation procedure, creating a direct remote-code-execution channel if the user follows the instruction. This behavior is not necessary for the Skill's declared plugin-publishing functionality. A safer installation workflow can direct users to official documentation or download and verify a fixed release artifact before execution. ### Attack Path 1. A user runs a generated `openclaw-install.sh` without OpenClaw installed. 2. The prerequisite check displays the curl-to-Bash installation command. 3. The user executes the recommended command. 4. `curl` retrieves the current contents of `https://openclaw.ai/install.sh`. 5. Bash executes those contents immediately without integrity or provenance verification. 6. If the domain, hosting service, DNS resolution, TLS endpoint, or upstream installer is compromised, attacker-controlled commands execute with the user's privileges. ### Impact Assessment A malicious remote installer could perform arbitrary actions available to the invoking user, in ...[truncated 544 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the curl-to-Bash recommendation. 2. Direct users to official installation documentation and require manual review of installation steps. 3. Prefer a trusted package manager or a version-pinned release artifact. 4. If a script must be downloaded: - Download it to a local file rather than piping it into a shell. - Pin an immutable version or release URL. - Publish and verify a SHA-256 checksum. - Prefer cryptographic signature verification with a pinned public key. - Let the user inspect the file before executing it. 5. Avoid recommending elevated execution unless a documented installation step strictly requires it. A safer pattern is: ```bash version="PINNED_VERSION" url="https://example.invalid/releases/${version}/install.sh" expected_sha256="PINNED_SHA256" curl --fail --show-error --location "$url" --output openclaw-install.sh printf '%s %s\n' "$expected_sha256" openclaw-install.sh | sha256sum --check - less openclaw-install.sh bash openclaw-install.sh ``` The actual URL, version, checksum, and verification mechanism must come from a trusted and independently verifiable release process. ]]>
