T03 · Remote Payload Retrieval and Execution
Error
- Location
- README.md:21
- Finding
- Mutable Remote Script Is Downloaded and Executed Without Verification<![CDATA[ ## Vulnerability Details **File Location**: `README.md:21`, `README.zh-CN.md:21`, `SKILL.md:34` **Vulnerability Type**: Unverified remote code retrieval and execution **Risk Level**: Critical ### Vulnerable Code ```bash curl -fsSL https://raw.githubusercontent.com/happydog-intj/github-passwordless-setup/master/setup.sh | bash ``` ### Technical Analysis The documented installation command retrieves a shell script from the mutable `master` branch of a personal GitHub repository and sends the response directly to Bash. It does not pin the content to an immutable commit, verify a cryptographic signature or checksum, or provide the user an opportunity to inspect the downloaded script before execution. Consequently, the effective code executed by users can differ from the locally audited `setup.sh`. The bundled script currently appears consistent with the declared SSH and GitHub CLI setup functionality, but that does not establish the integrity of future responses from the remote URL. The behavior exceeds the minimum privilege necessary for installation because executing an unverified network response is not required. The project can instead distribute and invoke its bundled script or use a verified release artifact. ### Attack Path 1. An attacker compromises the referenced GitHub account, repository, branch, or a maintainer credential, or otherwise obtains the ability to alter `master/setup.sh`. 2. The attacker replaces the remote script with arbitrary shell commands. 3. A user follows the documented quick-start command. 4. `curl` retrieves the changed content without integrity verification. 5. Bash immediately executes the response with the invoking user's privileges. 6. The payload can access the user's files and configuration and can observe or interfere with the SSH and GitHub authentication setup session. ### Impact Assessment Successful exploitation provides arbitrary code execution under the invoking user's account. This can expose or modi ...[truncated 582 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove every `curl | bash` installation instruction. 2. Prefer executing the reviewed script included with the downloaded project: ```bash git clone https://github.com/happydog-intj/github-passwordless-setup.git cd github-passwordless-setup less setup.sh chmod +x setup.sh ./setup.sh ``` 3. If direct downloads must remain supported: - Pin the URL to an immutable commit hash or signed release. - Publish a SHA-256 checksum through a separately protected channel. - Download to a local file. - Verify the checksum or signature. - Let the user inspect the file before execution. ```bash curl -fLO "https://example.invalid/releases/setup.sh" echo "EXPECTED_SHA256 setup.sh" | sha256sum --check - less setup.sh bash setup.sh ``` 4. Apply the same corrected instructions to `README.md`, `README.zh-CN.md`, and `SKILL.md`. 5. Protect release publication with multi-factor authentication, branch protection, signed commits or tags, and restricted maintainer access. ]]>
