T03 · Remote Payload Retrieval and Execution
- Location
- SKILL.md:20
- Finding
- Unpinned Remote Installer Downloaded and Executed Without Verification<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:20-23` and `SKILL.md:343-344` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: Critical ### Vulnerable Code ```text - Linux/macOS (`curl`): `curl -fsSL https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.sh | sh` - Linux/macOS (`wget`): `wget -qO- https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.sh | sh` - Windows PowerShell: `irm https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.ps1 | iex` - Windows CMD: `powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.ps1 | iex"` ``` The unsafe installation commands are repeated in the intent defaults: ```text - If user asks generic "install zerodha cli": - Linux/macOS: `curl -fsSL https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.sh | sh` - Windows: `irm https://raw.githubusercontent.com/jatinbansal1998/zerodha-kite-cli/main/scripts/install.ps1 | iex` ``` ### Technical Analysis The Skill instructs the Agent to download installation scripts from a personal GitHub repository and immediately execute them through `sh` or PowerShell `Invoke-Expression`. The URLs reference the mutable `main` branch rather than an immutable commit or signed release. There is no checksum verification, digital-signature validation, content inspection, or version pinning. Consequently, the code ultimately executed is not the code reviewed in this project. It can change whenever the remote repository changes. The Windows CMD variant additionally uses `-ExecutionPolicy Bypass`, deliberately disabling a local PowerShell execution safeguard for that process. Installing the underlying CLI is related to the Skill's bootstrap function. However, executing an unverified network response directly in a shell is n ...[truncated 1543 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove all `curl | sh`, `wget | sh`, `irm | iex`, and `ExecutionPolicy Bypass` instructions. 2. Prefer a trusted operating-system package manager or an official, signed release channel. 3. Pin downloads to an immutable release version or commit rather than the mutable `main` branch. 4. Download the installer to a local file without executing it: - Inspect the file before execution. - Verify its expected origin. - Reject redirects to unexpected domains. 5. Publish and verify a SHA-256 checksum over the installer. Prefer a cryptographic signature whose verification key is distributed through a separate trusted channel. 6. Run the installer with ordinary user privileges unless a documented step strictly requires elevation. 7. Display the exact version, source URL, expected checksum, and verification procedure to the user. 8. Where possible, vendor reviewed installation logic in the audited package instead of retrieving mutable executable content at runtime. ]]>
