T01 · Skill Instruction Hijacking
Warning
- Location
- SKILL.md:28
- Finding
- User-Controlled Platform Identifier Can Load Unintended Skill Instructions## Vulnerability Details **File Location**: `SKILL.md`, lines 28-48 **Vulnerability Type**: Path traversal into instruction files **Risk Level**: Medium ### Vulnerable Code ```markdown | prompt | string | Yes | Video description/prompt | | platform | string | No | Target platform ID (see impl/), default `giggle` | ``` ```markdown Stage 2 — Submit task Load impl/{platform}.md according to the platform parameter. Invoke the implementation layer to submit a generation task and obtain task_id. ``` ### Technical Analysis The `platform` parameter is supplied by the user and is interpolated directly into the instruction-file path `impl/{platform}.md`. The skill does not require the Agent or runtime to validate the value against a fixed platform allowlist, canonicalize the resulting path, or reject path separators and traversal sequences. A platform value containing `../`, an absolute path, or platform-specific separators could therefore resolve outside the intended `impl/` directory. Because the loaded Markdown is treated as implementation instructions, loading an unintended file can alter the Agent's behavior within the current session. This is best classified as instruction hijacking rather than ordinary data-file disclosure. ### Attack Path 1. An attacker asks the Agent to generate a video and supplies a crafted platform value, such as `../SKILL` or another traversal path targeting a Markdown file. 2. The Agent follows the documented construction rule and attempts to load `impl/{platform}.md`. 3. Path normalization resolves the crafted path outside the intended implementation directory. 4. The Agent reads the targeted file as trusted implementation guidance. 5. Instructions in that file can redirect the current workflow, request additional tools, or override the intended video-generation procedure. Exploitation requires a suitable readable file to exist at a path reachable ...[truncated 643 chars]
- Remediation
- ## Remediation Suggestions - Replace path interpolation with a fixed mapping, for example `giggle -> impl/giggle.md`. - Reject unknown platform identifiers before opening any file. - Restrict identifiers to a conservative pattern such as `^[a-z0-9_-]+$`. - Explicitly reject `/`, `\`, `..`, URL schemes, absolute paths, and encoded path separators. - Resolve and canonicalize the selected path, then verify that it remains under the canonical `impl/` directory. - Treat implementation documents as package-controlled resources rather than arbitrary user-selected files.
