T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:82
- Finding
- Unpinned Remote Shell Script Download and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 82-99 **Vulnerability Type**: `T03: Remote Payload Retrieval and Execution` **Risk Level**: Critical ### Vulnerable Code ```bash # Download the adapter curl -sSL https://raw.githubusercontent.com/puppetcat-fire/skill-publish-adapter/main/skill-publish-adapter.sh -o skill-publish-adapter.sh chmod +x skill-publish-adapter.sh # Or install through ClawHub clawhub install @clawhub/skill-publish-adapter ``` The downloaded file is subsequently invoked as follows: ```bash # 1. Validate a skill ./skill-publish-adapter.sh validate ./my-skill # 2. Automatically fix a skill ./skill-publish-adapter.sh fix ./my-skill # 3. Publish a skill ./skill-publish-adapter.sh publish ./my-skill --slug my-skill --name "My Skill" --version 1.0.0 ``` ### Technical Analysis The installation instructions retrieve a shell script from the mutable `main` branch of a personal GitHub repository. The downloaded file is granted executable permission and subsequently used for validation, modification, and publication operations. No immutable commit reference, cryptographic checksum, digital signature, or other integrity control is provided. Consequently, the effective code executed by users can change after this Skill has been reviewed. Splitting the process into `curl`, `chmod`, and a later invocation does not materially reduce the risk compared with piping the response directly into a shell. The executable payload is not included in the audited project, so its behavior cannot be verified from the package. The remote repository owner—or an attacker who compromises the repository, account, DNS path, or delivery infrastructure—can replace the script with arbitrary shell commands. This behavior exceeds the minimum privileges necessary for the declared validation and packaging functionality. Those operations could be implemented using reviewed, locally bundled code without dynamically trusting a mutable remote executable ...[truncated 1475 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Bundle the complete, reviewed adapter script inside the Skill package instead of downloading it at runtime. 2. Ensure the package actually contains every executable referenced by its installation and usage instructions. 3. If external retrieval is unavoidable: - Pin the URL to an immutable Git commit rather than `main`. - Publish and verify a SHA-256 or stronger cryptographic digest before execution. - Prefer signed release artifacts and verify the signature against a documented trusted key. - Abort installation if any integrity or signature check fails. 4. Display download and verification failures instead of using silent retrieval that can obscure diagnostics. 5. Run validation and repair operations in a restricted environment with only the target directory mounted writable. 6. Do not expose publishing credentials during validation or repair. 7. Require explicit user confirmation before modifying files or publishing artifacts. 8. Document the exact filesystem, credential, and network access required for each operation. ]]>
