T03 · Remote Payload Retrieval and Execution
Error
- Location
- install.sh:6
- Finding
- Unpinned Remote Installer Is Downloaded and Executed Directly<![CDATA[ ## Vulnerability Details **File Location**: `install.sh:6-11`; also documented in `SKILL.md:42-46` and `AGENT_INSTRUCTIONS.md:7-11` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High ### Vulnerable Code `install.sh:6-11`: ```bash # 1. Install DCG binary if missing if ! command -v dcg &>/dev/null; then echo "[1/3] Installing DCG binary..." curl -sSL https://raw.githubusercontent.com/Dicklesworthstone/destructive_command_guard/master/install.sh | bash echo "" else ``` `SKILL.md:42-46`: ```bash # 1. Install DCG binary curl -sSL https://raw.githubusercontent.com/Dicklesworthstone/destructive_command_guard/master/install.sh | bash ``` `AGENT_INSTRUCTIONS.md:7-11`: ```bash # Install DCG binary curl -sSL https://raw.githubusercontent.com/Dicklesworthstone/destructive_command_guard/master/install.sh | bash ``` ### Technical Analysis The installer retrieves a shell script from the mutable `master` branch of a personal GitHub repository and immediately sends the response to Bash. It does not pin an immutable commit or release, verify a cryptographic checksum or signature, save the payload for review, or validate its expected contents. Consequently, the effective code executed during installation can differ from the code that existed when this Skill was reviewed. Compromise of the upstream account or repository, a malicious upstream change, or compromise of the delivery trust chain could turn installation into arbitrary code execution. This behavior exceeds the minimum privileges required for the core functionality because `SKILL.md` states that the built-in rules operate without the DCG executable and that DCG is optional. ### Attack Path 1. An attacker compromises the upstream repository, its owner account, or the mutable `master` branch. 2. The attacker modifies the remote `install.sh` to contain malicious shell commands. 3. A user or agent runs this project's `install.sh` or follows either documented manual ...[truncated 865 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove all `curl | bash` instructions and make the optional DCG installation explicitly opt-in. 2. Fetch a versioned release artifact from an immutable release or commit rather than `master`. 3. Download the artifact to a local file before executing or installing it. 4. Publish and verify a SHA-256 digest or, preferably, a signature tied to a documented trusted key. 5. Abort installation if integrity verification fails. 6. Display the source, version, destination, and expected checksum before installation. 7. Prefer a trusted package manager with locked versions and integrity metadata where available. 8. Update `install.sh`, `SKILL.md`, and `AGENT_INSTRUCTIONS.md` consistently so users are not directed to the unsafe command through documentation. A safer sequence should follow this model: ```bash curl --fail --location --output /tmp/dcg-installer.sh \ "https://example.invalid/dcg/releases/download/vX.Y.Z/install.sh" printf '%s %s\n' "$EXPECTED_SHA256" /tmp/dcg-installer.sh | sha256sum --check - less /tmp/dcg-installer.sh bash /tmp/dcg-installer.sh ``` The URL, release version, and checksum must be real, immutable, and maintained by the project. ]]>
