T03 · Remote Payload Retrieval and Execution
Error
- Location
- references/ci-cd-workflows.md:45
- Finding
- Mutable TFLint Installation Script Is Downloaded and Executed Directly<![CDATA[ ## Vulnerability Details **File Location**: `references/ci-cd-workflows.md:45-50` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: Critical ### Vulnerable Code ```yaml - name: TFLint run: | curl -s https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash tflint --init tflint ``` ### Technical Analysis The workflow downloads a shell script from the mutable `master` branch and immediately pipes it into Bash. It does not pin an immutable commit or release, verify a checksum or signature, save the script for review, or fail explicitly on all HTTP errors. Consequently, the effective code executed by the workflow can change after this Skill has been reviewed. Trust is placed not only in the current script, but also in the upstream repository, maintainer accounts, source-hosting infrastructure, DNS and TLS path, and every future modification to the branch. The command is unnecessary for the Skill's declared guidance functionality. A package from a fixed release or a verified binary would provide TFLint without granting a mutable remote response immediate shell execution. ### Attack Path 1. An attacker compromises the upstream repository, a maintainer account, or another part of the script-delivery chain. 2. The attacker modifies `install_linux.sh` on the referenced `master` branch. 3. A user or Agent adopts the supplied CI template. 4. The CI runner downloads the changed script and passes it directly to Bash. 5. The payload executes with the runner's permissions and can inspect the checked-out repository, environment variables, CI tokens, filesystem, network, and any cloud credentials available to the job. 6. The payload can then alter build output, steal credentials, modify infrastructure code, or compromise downstream artifacts. ### Impact Assessment Successful exploitation provides arbitrary command execution as the CI runner or developer executing the command. The pract ...[truncated 256 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Remove the `curl | bash` installation pattern. - Install TFLint through a trusted package manager or download a fixed release artifact. - Pin the release version and immutable source commit. - Verify a vendor-published SHA-256 checksum and, where available, a cryptographic signature before execution. - Download the file separately and terminate on HTTP errors rather than executing a response stream. - Run installation in an isolated, unprivileged environment. - Restrict CI job permissions and do not expose cloud credentials to the validation job. - Cache only verified tool binaries and update them through a reviewed dependency-update process. ]]>
