T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/xui_install.sh:39
- Finding
- Execution of a Mutable Remote Installer Without Integrity Verification<![CDATA[ ## Vulnerability Details **File Location**: `scripts/xui_install.sh:39-40`; also prescribed by `SKILL.md:21-24` **Vulnerability Type**: Remote payload retrieval and immediate execution **Risk Level**: Critical ### Vulnerable Code ```tcl "~#" { send "bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)\r" } "$ " { send "bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)\r" } ``` The same behavior is explicitly required by the Skill instructions: ```markdown What the script does: 1. SSH login to the server 2. Run `bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)` 3. Automatically accept default installation options ``` ### Technical Analysis The installer is retrieved from the mutable `master` branch and passed directly to Bash through process substitution. The Skill does not pin an immutable commit, validate a cryptographic checksum, verify a signature, or provide a local reviewed copy of the installer. Consequently, the effective executable payload can change after this Skill has been reviewed. The use of `curl -Ls` also omits `--fail`, so HTTP error handling is not explicit before the response body is passed to Bash. Installing 3x-ui necessarily requires administrative system changes on the destination server, but granting an unverified and mutable remote response immediate shell execution exceeds the minimum safe privilege boundary needed to perform that installation. ### Attack Path 1. An attacker compromises the upstream repository, maintainer account, release workflow, or another component capable of changing `master/install.sh`. 2. The attacker inserts arbitrary shell commands into the remote installer. 3. A user invokes `scripts/xui_install.sh` as documented. 4. The script connects to the destination server and retrieves the current attacker-modified installer. 5. Bash executes the response immediately without integrity or authenticity ...[truncated 847 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Vendor a reviewed installer inside the Skill package, or reference an immutable upstream commit rather than `master`. 2. Download the installer to a temporary file instead of piping it directly to Bash. 3. Verify an expected SHA-256 or stronger digest before execution. 4. Prefer a maintainer-signed release and verify its cryptographic signature against a pinned public key. 5. Use strict download options such as: ```bash curl --fail --show-error --location --proto '=https' --tlsv1.2 \ -o "$installer" "$PINNED_URL" ``` 6. Abort installation if download or verification fails. 7. Review the pinned installer and document the exact system changes and privileges it requires. 8. Run installation with the least-privileged account possible, elevating only individual commands that require administrative access. ]]>
