T03 · Remote Payload Retrieval and Execution
Error
- Location
- README.md:5
- Finding
- Unpinned Remote Payload Retrieval and Execution<![CDATA[ ## Vulnerability Details **File Location**: `README.md:5-12`; execution guidance in `SKILL.md:66-74` **Vulnerability Type**: Mutable external code is downloaded and executed without integrity verification **Risk Level**: High ### Vulnerable Code `README.md:5-12`: ```bash ## Installation ```bash # Clone to your skills directory git clone https://github.com/jeffaf/breweries-skill.git ~/clawd/skills/breweries # Make executable chmod +x ~/clawd/skills/breweries/breweries chmod +x ~/clawd/skills/breweries/scripts/breweries ``` `SKILL.md:66-74`: ```markdown ## Agent Implementation Notes **Script location:** `{skill_folder}/breweries` (wrapper) → `scripts/breweries` **When user asks about breweries:** 1. Run `./breweries search "name"` to find by name 2. Run `./breweries city "city"` for location-based search 3. Run `./breweries state "state"` for state-wide search 4. Run `./breweries type brewpub` for specific types ``` ### Technical Analysis The installation instructions clone a mutable external Git repository without pinning a reviewed commit, verifying a cryptographic checksum, or validating a release signature. They then make the downloaded scripts executable. The skill instructions subsequently direct the agent to invoke those scripts. Only `README.md` and `SKILL.md` are present in the audited artifact. The referenced `breweries` wrapper and `scripts/breweries` implementation are absent, so their behavior cannot be reviewed or shown to be limited to brewery API queries. Because the repository's default branch can change after this artifact is reviewed, the effective executable payload can also change without modifying the audited files. ### Attack Path 1. An attacker compromises the referenced GitHub account or repository, or otherwise gains permission to modify its default branch. 2. The attacker replaces or modifies `breweries` or `scripts/breweries` with a malicious payload. 3. A user follows the documented installation command and clon ...[truncated 934 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Include the complete `breweries` wrapper and `scripts/breweries` implementation in the audited skill package. 2. Pin installation to a specific reviewed commit hash or immutable, versioned release rather than cloning a mutable default branch. 3. Publish and verify a cryptographic SHA-256 or stronger checksum before making downloaded files executable. 4. Prefer signed releases or signed Git commits/tags, and document signature verification steps. 5. Fail closed if the expected commit, signature, or checksum does not match. 6. Review the included scripts for command injection, unsafe shell expansion, unexpected filesystem access, credential access, and undeclared network destinations. 7. Run the skill with least privilege and restrict its network access to the documented Open Brewery DB endpoint where the execution environment supports such controls. ]]>
