T03 · Remote Payload Retrieval and Execution
- Location
scripts/bootstrap.sh:48- Finding
Mutable Remote Script Executed with Root Privileges
- Content
View full analysis
Vulnerability Details
File Location:
scripts/bootstrap.sh:48-54
Vulnerability Type: Remote code retrieval and privileged execution
Risk Level: CriticalVulnerable Code
bash else log "Installing Node.js ${NODE_MAJOR}..." curl -fsSL https://deb.nodesource.com/setup_${NODE_MAJOR}.x | sudo -E bash - 2>/dev/null sudo apt-get install -y -qq nodejs 2>/dev/null log "Node.js $(node --version) installed" fiTechnical Analysis
The script downloads a mutable shell script from an external URL and pipes it directly into
sudo bash. The downloaded content is not pinned to a known version, authenticated with a package-signing key by this script, or checked against an expected digest before execution.TLS protects the connection in transit but does not protect against compromise of the upstream server, distribution account, DNS or certificate trust chain, or an unintended upstream content change. Because the response is immediately interpreted by a root shell, a compromised response can run arbitrary commands before any local validation is possible.
Attack Path
- An attacker compromises the NodeSource distribution endpoint, its publishing credentials, or a trusted network component.
- The attacker modifies the response returned for
setup_${NODE_MAJOR}.x. - An administrator runs
bootstrap.sh. curlretrieves the altered response.- The response is passed directly to
sudo -E bash. - The attacker-controlled script executes as root and can install services, alter SSH configuration, create users, or access all local data.
Impact Assessment
Successful exploitation provides arbitrary root-level code execution over the entire VPS. The attacker could obtain persistent administrative access, steal OpenClaw credentials and restored secrets, modify firewall or SSH settings, replace system binaries, and compromise all users and services on the host.
- Remediation
View remediation
Remediation Suggestions
- Do not pipe network responses directly into a shell, especially a privileged shell.
- Configure the repository through locally maintained, version-controlled commands.
- Download any required setup artifact to a temporary file created with
mktemp. - Verify a pinned cryptographic digest or a signature made by a pre-established trusted key.
- Pin the repository and Node.js major or exact version to an approved release.
- Display the verified artifact and require administrative confirmation before privileged execution.
- Remove
sudo -Eunless preservation of the caller's environment is demonstrably required, because inherited environment variables expand the privileged execution surface.
