T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/setup.py:473
- Finding
- Unverified Remote Docker Installer Is Piped Directly into a Shell<![CDATA[ ## Vulnerability Details **File Location**: `scripts/setup.py:473-483` **Vulnerability Type**: Remote payload retrieval and execution with privilege escalation **Risk Level**: Critical ### Vulnerable Code ```python if system == "linux": if not yes and input(" Install Docker via get.docker.com? [y/n] ").lower() != "y": return False if subprocess.run("curl -fsSL https://get.docker.com | sh", shell=True).returncode != 0: err("Docker install failed"); return False subprocess.run(["sudo","systemctl","enable","--now","docker"], capture_output=True) user = os.environ.get("USER","") if user: subprocess.run(["sudo","usermod","-aG","docker",user], capture_output=True) warn(f"Added {user} to docker group — re-login for this to take effect") ``` ### Technical Analysis The setup wizard downloads the current response from `https://get.docker.com` and immediately executes it through a shell. The downloaded content is not pinned to a version, inspected, or verified with a cryptographic digest or signature. Consequently, the effective code executed by the reviewed package can change after publication. The risk depends on the security of the remote host, its delivery infrastructure, DNS, TLS trust chain, and the downloaded script itself. Compromise of any applicable delivery component could turn installation into arbitrary code execution. The setup then invokes `sudo` and adds the current user to the Docker group. Docker group membership is generally root-equivalent because a member can mount the host filesystem or start a privileged container. This permission substantially exceeds ordinary database client requirements. Interactive execution requires confirmation, but `--yes` accepts installation defaults without the inner confirmation. User consent reduces accidental activation but does not provide payload integrity. ### Attack Path 1. Docker is unavailable on the target Linux host. 2. The user selects automatic Doc ...[truncated 949 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Remove `curl | sh` installation from the Skill. - Direct users to the platform's official, documented package installation procedure. - If automated installation is indispensable: 1. Download a versioned artifact to a temporary file. 2. Restrict redirects and validate the final origin. 3. Verify a pinned SHA-256 digest or a trusted publisher signature. 4. Display the artifact and exact privileged operations before execution. 5. Execute it without `shell=True`. - Do not automatically add users to the Docker group. Explain that it is root-equivalent and require a separate, explicit confirmation. - Do not enable a system service automatically unless the user separately opts in. - Make `--yes` skip privileged installation rather than implicitly authorize it. - Prefer connecting to an existing PostgreSQL service or generate container configuration without installing host-level software. ]]>
