T03 · Remote Payload Retrieval and Execution
- Location
scripts/install.sh:43- Finding
Privileged Execution of an Unverified Remote NodeSource Script
- Content
View full analysis
/dev/null; then NODE_VER=$(node --version) warn "Node.js 已安装: $NODE_VER" else curl -fsSL https://deb.nodesource.com/setup_20.x | bash - apt install -y nodejs log "Node.js 版本: $(node --version)" fi log "npm 版本: $(npm --version)" } ``` The README documents the same installation technique: ```bash # 安装 Node.js install_nodejs() { curl -fsSL https://deb.nodesource.com/setup_20.x | bash - apt install -y nodejs node --version npm --version } ``` ### Technical Analysis The installer downloads mutable content from `https://deb.nodesource.com/setup_20.x` and immediately passes the response to Bash. It does not save the artifact for review, pin its contents by cryptographic digest, or verify a detached signature. The documented invocation is `sudo ./install.sh`, meaning the downloaded response is normally executed with root privileges. HTTPS authenticates the connection according to the host's trust store, but it does not provide content pinning or protect against a compromised upstream server, compromised publishing infrastructure, or malicious changes made after this skill was audited. Installing Node.js may legitimately require limited package-manager privileges. However, granting an unverified remote response unrestricted root shell execution exceeds the minimum privilege required for that operation. ### Attack Path 1. A user follows the README and invokes `sudo ./install.sh`. 2. The script requests the mutable NodeSource setup endpoint. 3. An attacker compromises the endpoint, its publishing infrastructure, or another relevant trust component and causes it to return malicious shell commands. 4. The respo ...[truncated 579 chars]- Remediation
View remediation
