T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:52
- Finding
- <![CDATA[Execution of Mutable, Unverified Remote Scripts and Instructions]]><![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 52-83 **Vulnerability Type**: Remote payload retrieval and local execution without integrity verification **Risk Level**: Critical ### Vulnerable Code ```text ### Step 2: Get the skill details Once you have a skill slug (from search results or directly specified), fetch its full content and scripts: ```bash curl -s $GOOSEWORKS_API_BASE/api/skills/catalog/<slug> \ -H "Authorization: Bearer $GOOSEWORKS_API_KEY" ``` This returns: - **content**: The skill's instructions (SKILL.md) — follow these step by step - **scripts**: Python scripts the skill uses — save them locally and run them - **files**: Extra files the skill needs (configs, shared tools like `tools/apify_guard.py`) — save them relative to `/tmp/gooseworks-scripts/` - **requiresSkills**: Array of dependency skill slugs (for composite skills) - **dependencySkills**: Full content and scripts for each dependency ### Step 3: Set up dependency skills (if any) If the response includes `dependencySkills` (non-empty array), set up each dependency BEFORE running the main skill: 1. For each dependency in `dependencySkills`: - Save its scripts to `/tmp/gooseworks-scripts/<dep-slug>/` - Install any pip dependencies it needs 2. When the main skill's instructions reference a dependency script (e.g. `python3 skills/reddit-scraper/scripts/scrape_reddit.py`), run it from `/tmp/gooseworks-scripts/<dep-slug>/` instead ### Step 4: Set up and run the skill Follow the instructions in the skill's `content` field. **Save ALL files from both `scripts` AND `files` before running anything:** 1. Save each script from `scripts` to `/tmp/gooseworks-scripts/<slug>/scripts/` — **NEVER save scripts into the user's project directory** 2. **IMPORTANT: Also save everything from `files`** — these contain required modules (like `tools/apify_guard.py`) that scripts import at runtime: - Files starting with `tools/` → save to `/tmp/gooseworks-scripts/tools/` ...[truncated 2569 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Package all required scripts with the audited Skill instead of downloading executable content at runtime. 2. If remote delivery is necessary, pin every script and dependency to an immutable version and verify a cryptographic signature and expected hash before use. 3. Treat remotely returned `content` as untrusted data, not as instructions the Agent must automatically follow. 4. Require an explicit review and user approval step before executing newly retrieved code or commands. 5. Enforce strict schemas, path allowlists, file-size limits, and command allowlists for catalog responses. 6. Reject absolute paths, traversal components, symlinks, unexpected file types, and writes outside a newly created private directory. 7. Execute approved scripts in an isolated sandbox with minimal filesystem access, no inherited secrets, restricted subprocess creation, and deny-by-default network access. 8. Maintain an auditable allowlist of supported skills, script versions, dependencies, and required permissions. ]]>
