T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:52
- Finding
- Unpinned Remote Installer Scripts Are Executed Directly## Vulnerability Details **File Location**: `SKILL.md`, lines 52-57 **Vulnerability Type**: Remote payload retrieval and execution without integrity verification **Risk Level**: High ### Vulnerable Code ```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 download scripts from the mutable `main` branch of an external GitHub repository and immediately execute them using `sh` or PowerShell `Invoke-Expression`. No version, commit, cryptographic digest, or signature is pinned or verified. Although the comments tell users to review the scripts, piping the downloaded response directly into an interpreter does not provide a meaningful review step. The content executed can differ from content reviewed earlier because the `main` branch is mutable. Installation of the external `dws` binary is necessary for the declared DingTalk integration, but direct execution of mutable remote source is not the minimum privilege or minimum-risk mechanism required. The same document already offers safer alternatives, including downloading a release artifact or building from source. This finding does not establish that the current upstream installer is malicious. The vulnerability is that control of the effective payload remains with an external, changeable source after this skill has been reviewed. ### Attack Path 1. An attacker compromises the upstream GitHub organization, repository, maintainer account, release workflow, or another mechanism capable of modifying the installer on the `main` branch. 2. The attacker replaces `install.sh` or `install.ps1` with a malicious payload. 3. A user or agent follows the d ...[truncated 1270 chars]
- Remediation
- ## Remediation Suggestions 1. Remove all `curl | sh` and `irm | iex` installation instructions. 2. Pin installation artifacts to a specific immutable release version or commit rather than the `main` branch. 3. Publish expected SHA-256 checksums through a separately protected release channel and require verification before execution. 4. Prefer signed release artifacts and verify the publisher signature or provenance before installation. 5. Separate download, inspection, verification, and execution into explicit commands. For example: ```bash version="vX.Y.Z" curl -fL -o install.sh \ "https://raw.githubusercontent.com/DingTalk-Real-AI/dingtalk-workspace-cli/${version}/scripts/install.sh" printf '%s %s\n' 'EXPECTED_SHA256' install.sh | sha256sum --check - less install.sh sh install.sh ``` 6. Provide an equivalent Windows workflow using `Invoke-WebRequest -OutFile`, `Get-FileHash`, signature validation, local inspection, and only then explicit execution. 7. Recommend running installation as an unprivileged user and prohibit `sudo`, administrator shells, or elevation unless a documented operation strictly requires it. 8. Keep credentials unset during installation so a compromised installer cannot inherit `DWS_CLIENT_ID`, `DWS_CLIENT_SECRET`, or active tokens. 9. Prefer verified package-manager distribution or reproducible builds from a pinned source revision.
