T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/03-install-docker.sh:12
- Finding
- Docker Installer Executes Mutable Remote Code as Root<![CDATA[ ## Vulnerability Details **File Location**: `scripts/03-install-docker.sh:12-16` **Vulnerability Type**: Remote payload retrieval and immediate execution **Risk Level**: Critical ### Vulnerable Code ```sh # Remove old versions echo "[1/4] Removing old Docker versions..." apt-get remove -y docker docker-engine docker.io containerd runc 2>/dev/null || true # Install Docker using official script echo "[2/4] Installing Docker..." curl -fsSL https://get.docker.com | sh ``` ### Technical Analysis The script is intended to run as root and pipes an HTTP response directly into `sh`. The retrieved payload is not pinned to a reviewed version and is not authenticated using a separately verified signature or checksum. Although `get.docker.com` is Docker's official convenience endpoint, the effective code can change after this Skill has been reviewed. Compromise of the upstream service, DNS resolution, TLS trust chain, or delivery infrastructure would permit arbitrary root-level payload substitution. ### Attack Path 1. An administrator invokes `03-install-docker.sh` as root. 2. The script requests the current contents of `https://get.docker.com`. 3. An upstream or network trust compromise supplies modified shell code. 4. The response is sent directly to `sh` without inspection or verification. 5. The substituted payload executes with unrestricted root privileges. ### Impact Assessment Successful exploitation provides complete control of the VPS, including the ability to read credentials, alter SSH configuration, access agent data, install persistent services, modify containers, and compromise all users. ]]>
- Remediation
- <![CDATA[ ## Remediation Suggestions - Install Docker from its signed APT repository instead of using `curl | sh`. - Pin the Docker packages to approved versions. - Install and verify the repository signing key through an authenticated process. - If a remote script is unavoidable, download it separately, verify a pinned cryptographic digest or detached signature, and inspect it before execution. - Record the exact version and checksum in the Skill so the audited artifact cannot change silently. ]]>
