T09 · Insecure Skill Coding Practices
- Location
bin/skill-scaffold.js:108- Finding
Unescaped Metadata Injection into Generated Agent Instructions
- Content
View full analysis
`--- name: ${skillName} description: ${description} author: ${author} version: 1.0.0 keywords: - ai - automation - clawdbot ``` The description is also inserted into the Markdown body without encoding: ```javascript # ${titleCase(skillName)} ${description} ``` ### Technical Analysis The `--description` and `--author` arguments accept arbitrary strings without rejecting line breaks, YAML control syntax, Markdown directives, or instruction-like content. These values are interpolated directly into YAML frontmatter and the body of a generated `SKILL.md`. An attacker who can influence the scaffold command arguments can terminate or restructure the intended YAML value by supplying newline characters. The attacker can then add arbitrary frontmatter fields, Markdown sections, or instructions that become persistent content in the generated Skill. Because `SKILL.md` is intended to be consumed by AI agents, injected content can influence an agent when the generated Skill is later installed or loaded. The generator does not itself execute the injected content, but it creates a trusted-looking artifact containing attacker-controlled instructions. ### Attack Path 1. An attacker influences a developer, build script, wrapper, or automation system to invoke the CLI with a crafted `--description` or `--author` value. 2. The crafted value cont ...[truncated 985 chars]- Remediation
View remediation
