T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/provision.sh:18
- Finding
- Mutable Remote Installation Scripts Are Executed Directly by a Shell## Vulnerability Details **File Location**: `scripts/provision.sh`, lines 18-42 **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: Critical ### Vulnerable Code ```bash # 2. Docker if ! command -v docker >/dev/null 2>&1; then log "Installing Docker..." curl -fsSL https://get.docker.com | sh usermod -aG docker $SUDO_USER else log "Docker already installed." fi # 3. Node/NPM (via Volta for stability) if ! command -v node >/dev/null 2>&1; then log "Installing Node.js via Volta..." curl https://get.volta.sh | bash export VOLTA_HOME="$HOME/.volta" export PATH="$VOLTA_HOME/bin:$PATH" volta install node@22 else log "Node.js already installed." fi # 4. Tailscale if ! command -v tailscale >/dev/null 2>&1; then log "Installing Tailscale..." curl -fsSL https://tailscale.com/install.sh | sh else log "Tailscale already installed." fi ``` ### Technical Analysis The provisioning script downloads executable content from three mutable external URLs and sends it directly to `sh` or `bash`. No version pinning, cryptographic checksum, signature validation, or opportunity for local inspection is provided. The effective code executed by the Skill can therefore change after the audited package has been published. HTTPS protects transport under ordinary conditions but does not protect against a compromised upstream server, compromised distribution infrastructure, DNS or trust-store compromise, or an upstream script being changed maliciously. The Docker and Tailscale installers are particularly sensitive because this provisioning script already expects administrative privileges for `apt-get` and `usermod`. A remotely supplied script can consequently inherit root privileges. The Volta installer executes as the invoking user and can alter that user's files and development environment. Although installing Docker, Node.js, and Tailsc ...[truncated 1307 chars]
- Remediation
- ## Remediation Suggestions - Do not pipe network responses directly into a shell. - Prefer distribution repositories whose packages are verified through the operating system's package-signing mechanism. - If an upstream installer is unavoidable: 1. Download it to a newly created, permission-restricted temporary file. 2. Pin an immutable release or commit rather than a moving installer URL. 3. Verify a vendor signature or a checksum stored independently in this repository. 4. Display the source and intended changes to the operator. 5. Require explicit confirmation before execution. 6. Execute only the installation steps that require elevation. 7. Delete the temporary file after use. - Use `curl --fail --show-error --location --proto '=https' --tlsv1.2` and enforce redirects only to approved hosts. These options improve transport handling but do not replace signature verification. - Pin Docker, Volta, Node.js, and Tailscale to reviewed versions. - Separate root-level system provisioning from user-level setup so that the Volta installer and other user tools never inherit unnecessary administrative privileges.
