T03 · Remote Payload Retrieval and Execution
Warning
- Location
- SKILL.md:29
- Finding
- Mutable Remote Runner Is Retrieved and Executed Without Integrity Verification<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 29–39 and 46 **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: Medium ### Vulnerable Code ```bash if [ -d ~/.cue/cue-skills/.git ]; then git -C ~/.cue/cue-skills pull --ff-only else git clone https://github.com/sensedeal/cue-skills ~/.cue/cue-skills \ || git clone https://gitee.com/sensedeal/cue-skills ~/.cue/cue-skills fi ``` The downloaded runner is subsequently executed: ```bash python3 ~/.cue/cue-skills/cue-research/scripts/research_run.py --query "<user subject/question>" --template-id <template_id> ``` ### Technical Analysis The Skill instructs the Agent to clone or update a remote repository and then execute a Python file obtained from that repository. It does not pin the repository to a reviewed commit, verify a cryptographic checksum, require a signed release, or otherwise validate the downloaded code before execution. The effective code executed by the Skill can therefore change after the Skill itself has been reviewed. The `git pull --ff-only` option prevents non-fast-forward merges but does not establish authenticity or prevent a compromised upstream account from publishing malicious commits. The fallback to a separate Gitee repository expands the trust boundary. There is no verification that the GitHub and Gitee repositories contain identical, independently authenticated artifacts. The documentation also states that the runner automatically reads the Cue API key from `~/.cue/config.json`. Consequently, remotely supplied code executes in a process with access to the Agent user's files, environment, network connectivity, and potentially the Cue credential. ### Attack Path 1. An attacker compromises the upstream GitHub or Gitee repository, a maintainer account, or the branch referenced by the default clone operation. 2. The attacker adds malicious behavior to `cue-research/scripts/research_run.py` or one of its imported components. 3 ...[truncated 1192 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the runner to a specific, reviewed commit hash or immutable release rather than cloning or pulling a moving default branch. 2. Publish and verify a SHA-256 or stronger digest for every executable artifact before invocation. 3. Prefer signed releases or signed commits and validate signatures against a documented, trusted maintainer key. 4. Remove automatic `git pull` behavior. Updates should require an explicit review and approval step. 5. Verify fallback mirrors independently. Do not assume the Gitee repository is equivalent to the GitHub repository without matching signed checksums. 6. Vendor the reviewed runner into the Skill package when practical so the audited package contains the code it executes. 7. Execute the runner in a sandbox with restricted filesystem access, outbound network access, and process-creation permissions. 8. Avoid giving downloaded code direct access to the complete Cue configuration file. Supply a narrowly scoped, short-lived credential through a protected channel where supported. 9. Display and verify the resolved commit hash before every execution, and record it in audit logs. ]]>
