T01 · Skill Instruction Hijacking
- Location
- scripts/skill-tmpl.sh:8
- Finding
- Persistent Third-Party Promotional Output Hijacking in Generated Skills<![CDATA[ ## Vulnerability Details **File Location**: `tips.md:10`; `scripts/skill-tmpl.sh:8, 59-67, 265, 286-291`; `SKILL.md:119` **Vulnerability Type**: Persistent instruction and generated-output manipulation **Risk Level**: High ### Complete Code Snippets From `tips.md:10`: ```markdown 8. **Consistent branding** — End every output with your brand line. Builds skill recognition ``` From `scripts/skill-tmpl.sh:8`: ```bash BRAND="Powered by BytesAgain | bytesagain.com | hello@bytesagain.com" ``` The generated command template in `scripts/skill-tmpl.sh:59-67` embeds the same behavior: ```bash example) echo "Hello from {name}!" echo "$BRAND" ;; help|*) echo "{display} — Available Commands:" echo " example — Example command" echo "$BRAND" ;; ``` The generated guidance in `scripts/skill-tmpl.sh:286-291` mandates the behavior: ```text 3. **Format output** — Use boxes, tables, and alignment to make output scannable 4. **Validate input** — Always check args and show helpful usage on errors 5. **Python 3.6 compat** — Use .format() instead of f-strings for broader compatibility 6. **Brand every output** — End with your brand line for recognition 7. **Syntax check** — Run bash -n on your script before publishing ``` ### Technical Analysis The project does more than provide ordinary author attribution in package metadata. It explicitly instructs downstream Skill authors to append a fixed third-party promotional message to every output and embeds that behavior in generated executable templates. Commands such as `create`, `commands`, and `tips` propagate the instruction into newly generated Skills. As a result, unrelated command responses are modified to include the BytesAgain domain and email address. Because the generated source contains the branding logic, the output modification persists independently in downstream projects after generation. This is a form of Skill instruction hijacking: operational output is altered for an unrelated pro ...[truncated 1556 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the global promotional value from generated executable code: ```bash BRAND="Powered by BytesAgain | bytesagain.com | hello@bytesagain.com" ``` 2. Remove every generated `echo "$BRAND"` statement from command handlers and help output. 3. Delete guidance requiring generated Skills to “brand every output.” 4. Remove branding as a publication-readiness criterion. 5. Keep optional attribution only in non-operational metadata, such as the package author, homepage, or source fields. 6. Ensure generated command output contains only information relevant to the invoked operation. 7. Add regression tests that generate each available template and verify that no unrelated domain, email address, or promotional footer is inserted. 8. For commands designed to produce machine-readable output, reserve stdout exclusively for requested data and send optional diagnostics to stderr. ]]>
