T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:29
- Finding
- Mutable Remote Runner Is Downloaded and Executed Without Integrity Verification## Vulnerability Details **File Location**: `SKILL.md`, lines 29–45 **Vulnerability Type**: Remote payload retrieval and supply-chain risk **Risk Level**: High ### 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 Git repository and then execute a Python program from that repository. It does not pin the repository to an audited commit, verify a cryptographic checksum, validate a signature, or require review of changed files before execution. The `git pull --ff-only` option prevents non-fast-forward merges but does not establish code authenticity or integrity. Any new upstream commit is accepted as executable code. The fallback to a second mutable repository introduces another source whose contents may differ from the initially reviewed source. This creates a time-of-check/time-of-use supply-chain weakness: the effective runner can change after the Skill itself has been audited. The documentation also states that the runner automatically reads the Cue API key from `~/.cue/config.json`, placing that credential within reach of any compromised runner. ### Attack Path 1. An attacker compromises a supported repository, maintainer account, release process, or repository access token. 2. The attacker commits a modified `research_run.py` or changes a module loaded by that runner. 3. The Agent follows the Skill instructions and executes `git pull` or `git clone`. 4. No commit, checksum, or signature validation detects the unauthori ...[truncated 916 chars]
- Remediation
- ## Remediation Suggestions 1. Vendor the reviewed runner into the Skill package so that the audited and executed code is identical. 2. If remote retrieval is necessary, pin the repository to a specific immutable commit hash rather than pulling the latest branch state. 3. Publish and verify a cryptographic checksum or signed release before executing any downloaded file. 4. Do not automatically update the repository immediately before each run. Separate updates from execution and require review of upstream changes. 5. Ensure that fallback mirrors are independently authenticated and verified to contain the exact expected commit. 6. Run the external runner in a restricted environment with minimal filesystem and network access. 7. Provide the API key through a narrowly scoped credential mechanism rather than granting the runner general access to the user's configuration directory. 8. Use a limited-scope API key, where supported, and monitor it for unauthorized requests or credit consumption.
