T03 · Remote Payload Retrieval and Execution
Error
- Location
- README.md:28
- Finding
- Remote installation script is streamed directly into Bash<![CDATA[ ## Vulnerability Details **File Location**: `README.md:28-32`; duplicated in `README_CN.md:28-32` **Vulnerability Type**: Remote payload retrieval and immediate execution **Risk Level**: High ### Complete Code Snippet ```markdown Use our convenient install script to download the latest pre-compiled binary for your system: ```bash curl -sSL https://raw.githubusercontent.com/scottkiss/doc-ocr-skills/main/scripts/install.sh | bash ``` ``` The Chinese README contains the same command: ```bash curl -sSL https://raw.githubusercontent.com/scottkiss/doc-ocr-skills/main/scripts/install.sh | bash ``` ### Technical Analysis The documented command retrieves a shell script from the mutable `main` branch of a personal GitHub repository and passes its contents directly to Bash. Users cannot inspect or authenticate the retrieved content before it executes. HTTPS protects the connection in transit but does not establish that the repository account, branch, or fetched script remains trustworthy. The command does not pin a commit, verify a cryptographic digest, validate a signature, or otherwise confirm that the downloaded script matches the version reviewed with this Skill. The bundled `scripts/install.sh` currently behaves as a binary downloader, but the documented command does not guarantee that the bundled version is the one that will execute. The effective payload can change after the Skill package has been reviewed. ### Attack Path 1. An attacker compromises the repository owner account, gains write access, or otherwise modifies `scripts/install.sh` on the remote `main` branch. 2. A user follows the installation instructions in either README. 3. `curl` downloads the modified script. 4. The shell begins executing the downloaded data immediately through the pipe. 5. The attacker-controlled script runs with all privileges of the invoking user. 6. It can access user-readable documents and credentials, modify files, download additional payloads, or establish ...[truncated 531 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the `curl | bash` installation method from both README files. 2. Instruct users to download a versioned installer to disk before execution: ```bash curl --fail --location --output install.sh \ https://raw.githubusercontent.com/scottkiss/doc-ocr-skills/<immutable-commit>/scripts/install.sh ``` 3. Publish an expected SHA-256 digest through a separately authenticated release channel and require verification before execution: ```bash echo "<expected-sha256> install.sh" | sha256sum --check - ``` 4. Cryptographically sign release scripts and document signature verification using a pinned maintainer key or Sigstore. 5. Pin installation URLs to an immutable release tag and commit rather than `main`. 6. Encourage users to inspect the downloaded script before invoking it explicitly with `bash install.sh`. 7. Do not recommend running the installer with `sudo` or from a privileged account. ]]>
