T03 · Remote Payload Retrieval and Execution
- Location
- README.md:81
- Finding
- Mutable Remote Installation Script Is Piped Directly into Bash<![CDATA[ ## Vulnerability Details **File Location**: `README.md:81-83` **Vulnerability Type**: Remote payload retrieval and immediate execution **Risk Level**: Critical ### Vulnerable Code ```bash # or script install (oh / ohmo have fully migrated to ih) curl -fsSL https://raw.githubusercontent.com/jingzhao-l/iterate-harness/main/scripts/install.sh | bash ih iterate init && ih iterate review ``` ### Technical Analysis The documented installation command retrieves a shell script from the mutable `main` branch of a separate GitHub repository and sends the response directly to `bash`. The script is neither pinned to an immutable commit nor verified using a checksum or cryptographic signature before execution. This execution model prevents the user from reviewing the downloaded content before it runs. It also bypasses the mandatory SHA-256 verification controls implemented by this project's Python and npm installers. The effective payload can change after this Skill has been reviewed or published. Although HTTPS protects the connection in transit under normal conditions, it does not protect against compromise of the referenced GitHub account, repository, branch, or release process. It also does not establish that the fetched script is the same script that was audited. ### Attack Path 1. An attacker compromises the `jingzhao-l/iterate-harness` repository, its maintainer account, or a workflow capable of modifying `main`. 2. The attacker replaces or modifies `scripts/install.sh` with commands that perform arbitrary local actions. 3. A user follows the installation command in the README. 4. `curl` retrieves the attacker-controlled script from the mutable branch. 5. The pipe sends the response directly to `bash`, without local inspection or integrity verification. 6. The malicious commands execute with the privileges of the user running the installation command. ### Impact Assessment Successful exploitation provides arbitrary command execution under the in ...[truncated 687 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the `curl | bash` installation pattern from all documentation, including translated README files. 2. Prefer the documented, versioned npm installer where its package publication and integrity controls are maintained. 3. If a shell installer remains necessary: - Publish it as a versioned release asset. - Pin the download to a specific immutable version or commit. - Download the file to disk rather than piping it into a shell. - Publish a SHA-256 digest through an independently authenticated channel. - Verify the digest before execution. - Display the script path and encourage inspection before running it. 4. Prefer cryptographic release signatures or provenance attestations in addition to SHA-256 checksums. 5. Ensure the checksum or signature is not obtained solely from the same mutable location as the payload. 6. Update the equivalent command in `README.zh-CN.md` so that all supported documentation follows the same secure installation procedure. A safer workflow should follow this sequence: ```bash curl -fL -o install.sh https://example.invalid/releases/download/vX.Y.Z/install.sh printf '%s %s\n' '<independently-published-sha256>' install.sh | sha256sum -c - less install.sh bash install.sh ``` The real URL, version, and digest must be immutable and publisher-controlled. ]]>
