T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:136
- Finding
- Unverified Remote Installer Scripts Are Executed Directly by a Shell<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:136-150`; `scripts/mcpx.py:46-59` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: Critical ### Vulnerable Code From `SKILL.md:136-150`: ```bash ### Step 2: install `uv` if missing ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` ### Step 3: install the `aliyun` CLI if missing Most environments do not have it. **macOS / Linux** (auto-detects architecture): ```bash /bin/bash -c "$(curl -fsSL --connect-timeout 10 --max-time 120 https://aliyuncli.alicdn.com/setup.sh)" ``` ``` From `scripts/mcpx.py:46-59`: ```python UV_INSTALL_HINT_POSIX = "curl -LsSf https://astral.sh/uv/install.sh | sh" UV_INSTALL_HINT_WINDOWS = ( 'powershell -ExecutionPolicy ByPass -c ' '"irm https://astral.sh/uv/install.ps1 | iex"' ) ALIYUN_INSTALL_HINT_POSIX = ( '/bin/bash -c "$(curl -fsSL --connect-timeout 10 --max-time 120 ' 'https://aliyuncli.alicdn.com/setup.sh)"' ) ALIYUN_INSTALL_HINT_WINDOWS = ( 'Invoke-WebRequest -Uri ' '"https://aliyuncli.alicdn.com/aliyun-cli-windows-latest-amd64.zip" ' '-OutFile "aliyun-cli.zip"; ' 'Expand-Archive -Path aliyun-cli.zip -DestinationPath C:\\aliyun-cli' ) ``` ### Technical Analysis The POSIX installation instructions pipe mutable network responses directly into `sh` or interpolate them into a Bash command. The Windows UV instruction has the equivalent behavior through `Invoke-RestMethod | Invoke-Expression`. HTTPS and recognizable vendor domains reduce ordinary interception risk, but they do not establish artifact integrity. There is no pinned installer version, checksum, detached signature, certificate/public-key pin, or local review step. Consequently, the effective code executed on a user's system can change after this Skill has been reviewed. Installing the required dependencies is consistent with the Skill's functionality, but direct execution of an unverified response is not the minimum privilege or ...[truncated 1337 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace all `curl | sh`, command-substitution, and `irm | iex` instructions with a staged installation procedure. 2. Download a versioned artifact to a temporary file without executing it. 3. Verify a publisher-provided SHA-256 or stronger digest and, where available, a detached cryptographic signature. 4. Pin the installer or binary to an explicit release rather than a mutable “latest” endpoint. 5. Show the resolved version, source URL, checksum, and destination to the user before installation. 6. Require explicit user approval before any system modification or privilege elevation. 7. Prefer platform package managers with signature validation where supported. 8. For Windows, download the script or archive, verify it, and invoke it without `Invoke-Expression`. 9. Document the expected files, PATH changes, and required privilege level so users can assess the operation. 10. Consider making installation a user-run prerequisite instead of allowing the Agent to execute installation commands automatically. ]]>
