T03 · Remote Payload Retrieval and Execution
- Location
deploy/setup.sh:10- Finding
Root-Level Execution of a Mutable Remote Installation Script
- Content
View full analysis
/dev/null; then echo "Installing Node.js 22..." curl -fsSL https://deb.nodesource.com/setup_22.x | bash - apt-get install -y nodejs fi ``` ### Technical Analysis The setup script downloads content from a remote URL and passes it directly to Bash. The response is not pinned to a version, inspected, signature-verified, or checked against a known digest before execution. The surrounding commands install system packages and create directories under `/opt`, indicating that the script is intended to run with root privileges. Consequently, the remotely supplied script also executes with root authority. NodeSource is a recognizable package provider, and there is no evidence that its current script is malicious. However, the effective code executed by this project can change after the project itself has been reviewed. A compromise of the remote endpoint, upstream publication process, DNS resolution, or TLS trust chain would therefore become arbitrary root code execution. ### Attack Path 1. An administrator runs `deploy/setup.sh` with root privileges on a fresh server. 2. The script requests the current content of `https://deb.nodesource.com/setup_22.x`. 3. A compromised or unexpectedly modified response is streamed directly into Bash. 4. Bash executes the response without local review or integrity verification. 5. The remote payload gains root-level access to the host. ### Impact Assessment A successful supply-chain compromise could obtain complete control of the deployment server. The resulting privileges could include: - Reading application secrets and wallet private keys. - Replacing the inference service or its dependencies. - Modifying payment destinations or transaction logic. - Installing persistent service ...[truncated 156 chars]- Remediation
View remediation
