T03 · Remote Payload Retrieval and Execution
- Location
- SKILL.md:42
- Finding
- Unverified Remote Installer Is Executed Directly from a Mutable Branch<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:42-49` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: Critical ### Vulnerable Code ```bash **Option 3: Install script (review first!)** ```bash # macOS / Linux - REVIEW SCRIPT BEFORE RUNNING curl -fsSL https://raw.githubusercontent.com/DingTalk-Real-AI/dingtalk-workspace-cli/main/scripts/install.sh | sh # Windows (PowerShell) - REVIEW SCRIPT BEFORE RUNNING irm https://raw.githubusercontent.com/DingTalk-Real-AI/dingtalk-workspace-cli/main/scripts/install.ps1 | iex ``` ``` ### Technical Analysis The installation instructions retrieve scripts from the mutable `main` branch of an external GitHub repository and immediately pass the downloaded content to a shell or PowerShell interpreter. No immutable commit, release version, cryptographic hash, or signature is verified before execution. The comments instructing users to review the script do not create an actual review boundary because the commands themselves perform retrieval and execution as one operation. Even if the installer was safe when this Skill was audited, its effective payload can change afterward. This creates a supply-chain trust dependency on the external repository, its maintainers, their accounts, GitHub infrastructure, and the integrity of the repository's default branch. ### Attack Path 1. An attacker compromises the external repository, a maintainer account, or a publishing token. 2. The attacker modifies `scripts/install.sh` or `scripts/install.ps1` on the `main` branch. 3. A user or autonomous Agent follows the installation instructions. 4. `curl | sh` or `irm | iex` retrieves and immediately executes the modified payload. 5. The payload runs with the permissions of the user performing the installation. 6. It can subsequently steal credentials, alter local files, establish persistence, or replace the installed `dws` executable. ### Impact Assessment Successful exploitation provides arbitrar ...[truncated 658 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove all `curl | sh` and `irm | iex` installation instructions. 2. Pin downloads to an immutable, reviewed release version or commit rather than `main`. 3. Download the installer as a separate file without executing it: ```bash curl -fL -o install.sh https://example.invalid/path/to/pinned/install.sh ``` 4. Publish and require verification of a SHA-256 checksum or cryptographic signature: ```bash echo "<expected-sha256> install.sh" | sha256sum --check - ``` 5. Require users to inspect the locally downloaded script before explicitly running it: ```bash less install.sh sh install.sh ``` 6. Prefer reproducible builds from a pinned source tag or signed release artifacts. 7. Document the expected files, network endpoints, and filesystem changes made by the installer. 8. Avoid recommending elevated execution unless a specific operation strictly requires it. ]]>
