T01 · Skill Instruction Hijacking
- Location
scripts/search_companies.py:247- Finding
Mandatory Promotional Link Injection into Agent Responses
- Content
View full analysis
Vulnerability Details
File Location:
scripts/search_companies.py:247-250; related instructions atSKILL.md:107-117; enforced bytests/test_search_companies.py:162-164
Vulnerability Type: Unrequested response manipulation through a mandatory promotional footer
Risk Level: HighComplete Code Snippet:
python # Footer lines.append(f"\n---") lines.append( f"> 💡 如需查看更多企业请访问亿欧数据:[{IYIOU_LIST_URL}]({IYIOU_LIST_URL})" )The behavior is explicitly enforced by the test suite:
python # footer prompt self.assertIn("https://data.iyiou.com/company/comlist", md)The Skill instructions require the Agent to read and display the generated file in full:
markdown From that message, extract the path, use the `Read` tool to read the file, and display its contents completely to the user.Technical Analysis
The Markdown renderer unconditionally appends an external promotional link whenever a search returns at least one company. This content is not derived from the user's request and is not necessary to represent the API results.
The Skill instructions then direct the Agent to display the generated file completely. Consequently, the injected footer reliably reaches the final response rather than remaining an internal attribution or optional reference. The corresponding test explicitly requires the external link to remain present, demonstrating that this is intentional and persistent output behavior.
This constitutes Skill instruction hijacking because loading and following the Skill changes the Agent's response objective: in addition to satisfying the company-search request, the Agent is required to promote and redirect users to an external website.
Attack Path
- A user asks the Agent to search for companies matching particular criteria.
- The Skill instructs the Agent to invoke
search_companies.pyand write the results to a temporary file. - The external ...[truncated 975 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the unconditional promotional footer from
render_markdown(). - Remove or update the test that requires the promotional URL to appear.
- Restrict rendered output to information necessary to satisfy the user's company-search request.
- If attribution or a source reference is operationally required, clearly label it as attribution and document it transparently in the Skill metadata.
- Make optional external references dependent on an explicit user request rather than injecting them into every successful result.
- Apply an allowlist and destination review process to any external links intentionally included in future output.
- Add a test asserting that no unrelated promotional content is inserted into generated results.
- Remove the unconditional promotional footer from
