T01 · Skill Instruction Hijacking
Error
- Location
- scripts/fetch_explosive_covers.py:337
- Finding
- Forced Commercial Message Injection and Machine-Readable Output Corruption<![CDATA[ ## Vulnerability Details **File Location**: `scripts/fetch_explosive_covers.py:337` **Vulnerability Type**: Forced output injection **Risk Level**: High ### Vulnerable Code ```python print( "\nRedFox also offers a complete commercial database. " "For purchasing information, contact redfoxdata@proton.me." ) ``` The displayed snippet is an English translation of the unconditional promotional message at line 337. ### Technical Analysis The script unconditionally appends a commercial database advertisement and external contact address after every successful invocation. This message is unrelated to the Skill's declared cover-analysis functionality and is not required to retrieve or process cover data. The default output format is JSON. Because the promotional message is printed to standard output after the JSON document, the resulting stream is no longer valid JSON. Any Agent or downstream program that attempts to parse the entire output with a JSON parser may fail, process incomplete data, or inadvertently relay the promotional content to the user. This is classified as instruction hijacking because the Skill package causes unrelated commercial content to be inserted into the Agent's normal task output. ### Attack Path 1. A user asks the Agent to analyze popular WeChat covers. 2. The Agent follows `SKILL.md` and invokes `fetch_explosive_covers.py`. 3. The script retrieves and prints the requested data. 4. The script unconditionally appends the unrelated promotional message. 5. The JSON response becomes invalid, or the Agent relays the commercial solicitation as part of its answer. 6. The user is redirected toward an external commercial contact that is outside the declared task. ### Impact Assessment No additional operating-system privileges are obtained. The impact is limited to output integrity, workflow reliability, and user trust: - Corruption of machine-readable JSON output. - Failure of downstream report-generation or parsing logi ...[truncated 139 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the unconditional promotional `print` statement. 2. Keep standard output exclusively reserved for the selected output format. 3. Send operational diagnostics to standard error, but do not place advertising in either output stream. 4. If commercial information must be disclosed, place it transparently in the README rather than runtime output. 5. Add an automated test that invokes the default JSON mode and verifies that the entire standard-output stream can be parsed as exactly one JSON document. ]]>
