T03 · Remote Payload Retrieval and Execution
- Location
claude-code.py:26- Finding
Unverified Remote Installation Scripts Piped Directly to Shell Interpreters
- Content
View full analysis
Vulnerability Details
File Location:
claude-code.py, lines 26-33
Vulnerability Type: Remote payload retrieval and execution
Risk Level: HighVulnerable Code
python ### macOS/Linux (curl): ```bash curl -fsSL https://claude.ai/install.sh | bashWindows (PowerShell):
powershell irm https://claude.ai/install.ps1 | iextext ### Technical Analysis The embedded quickstart documentation instructs users or an AI agent to download scripts from remote URLs and immediately pass their contents to `bash` or PowerShell's `Invoke-Expression`. The downloaded payload is not pinned to an immutable version and is not inspected or verified using a cryptographic signature or checksum before execution. Although the URLs use HTTPS and appear to belong to the expected vendor, HTTPS only protects the connection in transit. It does not protect against compromise of the vendor endpoint, DNS or certificate infrastructure, deployment pipeline, or upstream account. The effective code executed by these commands can also change after this Skill has been reviewed. The local Python implementation only displays these commands and does not automatically execute them. Exploitation therefore depends on a user or agent following the displayed installation instructions. ### Attack Path 1. A user or agent invokes `claude-code query quickstart`. 2. The Skill displays the `curl | bash` or `irm | iex` installation command. 3. The user or agent executes the suggested command. 4. The remote endpoint returns a script that has changed since the Skill was audited, whether through legitimate updates or compromise. 5. The shell interpreter immediately executes the response without inspection or integrity verification. 6. A malicious response can perform arbitrary actions permitted to the invoking account. ### Impact Assessment A compromised remote script would obtain arbitrary command execution with the privileg ...[truncated 467 chars]- Remediation
View remediation
Remediation Suggestions
- Remove direct
curl | bashandirm | iexpipelines from the embedded documentation. - Prefer linking users to the vendor's official installation documentation without automatically proposing executable shell pipelines.
- If command-line installation guidance is required, separate download and execution:
- Download the installer to a local file.
- Pin an immutable release version.
- Verify a vendor-published cryptographic signature or SHA-256 checksum.
- Allow the user to inspect the downloaded file.
- Execute it only after explicit confirmation.
- Document the expected filesystem changes, network destinations, and required privileges before execution.
- Avoid running the installer as root or through
sudounless a specific operation demonstrably requires elevation. - Update both Unix and Windows instructions so they provide equivalent verification and review safeguards.
- Remove direct
