T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:119
- Finding
- Execution of a Mutable Remotely Hosted Binary<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 119–145 **Vulnerability Type**: Remote payload retrieval and execution without an independent trust anchor **Risk Level**: High ### Vulnerable Code ```bash # Option A: Download from Alibaba Cloud OSS curl -L -o c4c https://c4c.oss-accelerate.aliyuncs.com/releases/latest/c4c-$(uname -s)-$(uname -m) # Option B: Download from GitHub Release # curl -L -o c4c https://github.com/bianjieai/claw4claw-cli/releases/latest/download/c4c-$(uname -s)-$(uname -m) ``` ```bash # Download checksum file curl -L -o checksums.txt https://c4c.oss-accelerate.aliyuncs.com/releases/latest/checksums.txt # Perform verification for the downloaded file # If downloading from GitHub, the checksum can also be obtained from GitHub: # curl -L -o checksums.txt https://github.com/bianjieai/claw4claw-cli/releases/latest/download/checksums.txt if grep "c4c-$(uname -s)-$(uname -m)" checksums.txt | sha256sum --check --status; then echo "Checksum verification passed" chmod +x c4c ./c4c --version else echo "Checksum verification failed" rm c4c checksums.txt exit 1 fi ``` ### Technical Analysis The installation procedure downloads an executable from a mutable `latest` URL and then executes it. Although a SHA-256 checksum is checked, the checksum file is downloaded from the same mutable release location as the executable. This does not provide an independent authenticity guarantee. An attacker who compromises the distribution origin, release account, DNS resolution, storage configuration, or publishing pipeline can replace both the executable and its checksum. The modified executable will pass the documented verification and run when `./c4c --version` is invoked. This behavior is best classified as remote payload retrieval and execution because the effective executable can change after the Skill package has been reviewed. ### Attack Path 1. An attacker compromises the OSS bucket, GitHub release acco ...[truncated 1087 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin downloads to a specific immutable release version rather than `latest`. 2. Publish the expected SHA-256 digest through an independently trusted channel, or embed the expected digest in the reviewed Skill release. 3. Prefer signed release artifacts and verify their signatures against a pinned, documented publisher public key. 4. Treat a checksum downloaded beside the binary only as an integrity check, not an authenticity check. 5. Download into a newly created private temporary directory and reject symbolic links or pre-existing output paths. 6. Use strict transfer options such as `curl --fail --show-error --location`. 7. Verify the operating-system and architecture values against an explicit allowlist before constructing the artifact name. 8. Do not execute the binary until its version, digest, signature, source, and requested permissions have been displayed to and approved by the user. ]]>
