T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/install-deps.sh:205
- Finding
- Unverified Remote Installer Scripts Are Executed Directly<![CDATA[ ## Vulnerability Details **File Location**: `scripts/install-deps.sh:205-215` **Vulnerability Type**: Remote download and immediate code execution **Risk Level**: Critical ### Vulnerable Code ```bash if ! command -v uv &>/dev/null; then echo "uv not found — installing ..." case "$(uname -s)" in CYGWIN*|MINGW*|MSYS*|Windows_NT*) powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" \ || { echo "Error: uv installation failed on Windows." >&2; fail "uv_install_failed" 1; } ;; *) curl -LsSf https://astral.sh/uv/install.sh | sh \ || { echo "Error: uv installation failed." >&2; fail "uv_install_failed" 1; } ;; esac ``` ### Technical Analysis When `uv` is unavailable, the script retrieves an installer from `https://astral.sh` and passes the response directly to a command interpreter. The Unix branch uses `curl | sh`, while the Windows branch uses `irm | iex` together with an execution-policy bypass. No version pin, cryptographic checksum, digital-signature verification, or local review step is applied before execution. HTTPS protects the transport connection but does not ensure that the retrieved script is immutable or that a compromised upstream service cannot return altered commands. Although Astral is a recognized software vendor and automatic installation is convenient, immediate remote execution is not the minimum access necessary for the Skill. The installer could instead require a preinstalled `uv` binary or verify a versioned release artifact before executing it. ### Attack Path 1. A user follows the installation instructions in `SKILL.md` and invokes `scripts/install-deps.sh`. 2. The script determines that `uv` is not present in `PATH`. 3. An attacker compromises the upstream host, its deployment process, DNS or certificate trust path, or another component capable of altering the returned installer. 4. The a ...[truncated 1132 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove both direct remote-execution pipelines: - Do not use `curl ... | sh`. - Do not use `irm ... | iex`. - Do not bypass PowerShell execution policy. 2. Prefer requiring `uv` to be installed separately through a trusted operating-system package manager. If it is unavailable, terminate with explicit instructions rather than installing it automatically. 3. If automatic installation is required: - Pin a specific `uv` release. - Download a versioned artifact to a temporary file. - Verify it against a hard-coded, reviewed SHA-256 checksum or a trusted digital signature. - Abort on any verification failure. - Execute only the verified local artifact. 4. Use a securely created temporary directory with restrictive permissions and ensure cleanup through a trap. 5. Document the exact version and expected publisher so dependency updates become explicit review events. 6. Run installation with a non-administrator account and avoid requesting privileges not required to create the project-local environment. ]]>
