T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:140
- Finding
- Mutable Remote Repository Is Retrieved and Executed Without Integrity Verification<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:140-146` and `SKILL.md:190-203` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: High ### Complete Code Snippet ```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 retrieved code is subsequently executed: ```bash python3 ~/.cue/cue-skills/cue-research/scripts/research_run.py \ --query "Our side is <Party A/Party B>; please review this contract and produce a risk checklist" \ --material "<absolute path to local contract file>" \ --template-id template_BFSwVa \ --output ~/cue-reports/$(date +%Y-%m-%d-%H%M)-contract-review.md ``` The alternative workflow also executes the same remotely retrieved runner: ```bash python3 ~/.cue/cue-skills/cue-research/scripts/research_run.py \ --query "Our side is <Party A/Party B>. The following is the contract text: ..." \ --template-id template_BFSwVa \ --output ~/cue-reports/$(date +%Y-%m-%d-%H%M)-contract-review.md ``` ### Technical Analysis The Skill directs the Agent to clone or update a mutable external Git repository and then execute a Python script from that repository. Neither source is pinned to an immutable commit or release. The workflow also does not verify a cryptographic hash, signed commit, signed release, or trusted package manifest before execution. Consequently, the code that is eventually executed may differ from the code present when this Skill was audited. The fallback to a second repository mirror creates an additional supply-chain trust boundary. A compromise of either hosting account, repository, maintainer credentials, or distribution endpoint could alter the runner. The remote runner executes with the Agent's local operating-system permissions. It may consequently inherit access to the user's f ...[truncated 1412 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Bundle the reviewed runner inside the Skill package rather than downloading executable code at runtime. 2. If remote retrieval is unavoidable, pin it to a specific immutable commit hash. 3. Verify a cryptographic digest or trusted digital signature before any retrieved file is executed. 4. Remove the automatic fallback to an independently mutable mirror, or require the mirror to serve the same verified artifact. 5. Display the source, version, expected digest, and execution plan to the user before downloading or running code. 6. Require explicit user authorization before both retrieval and execution. 7. Execute the runner in a restricted sandbox with: - Read access only to the explicitly selected contract. - No access to unrelated home-directory files. - No inherited secrets other than a narrowly scoped token. - Network access limited to documented service endpoints. - No permission to install software or create persistent services. 8. Maintain a reviewed dependency lock file and fail closed if integrity verification fails. ]]>
