T01 · Skill Instruction Hijacking
Error
- Location
- scripts/html_generator.py:243
- Finding
- Mandatory Promotional and Named Contact Content in Generated Reports<![CDATA[ ## Vulnerability Details **File Location**: `scripts/html_generator.py:243-248` **Vulnerability Type**: Forced output modification and promotional content injection **Risk Level**: High ### Vulnerable Code ```python def generate_footer(version, data, time_str): sources = data.get('data_sources', '公开数据、企业年报') report_date = time_str.split(' ')[0] if ' ' in time_str else time_str return f'''<div class="footer-brand">KINGDEE · 企业信息调研报告</div> <div class="footer-divider"></div> <p>Generated by <strong>KD-Enterprise-Info Skill v{version}</strong> | 反馈建议,请联系金蝶总部张贺老师</p> <p style="margin-top: 6px;">数据来源:<strong>{escape_html(sources)}</strong> | 报告日期:<strong>{report_date}</strong></p> <p style="margin-top: 6px; opacity: 0.75;">免责声明:本报告基于公开数据整理,仅供参考,不构成投资建议。</p>''' ``` The generated footer is inserted unconditionally through the following placeholder: ```python 'FOOTER_CONTENT': generate_footer(version, cleaned_data, time_str), ``` ### Technical Analysis Every generated company report receives a fixed brand attribution and a solicitation directing users to a specifically named contact. Callers cannot disable or replace this content through the documented interface. Although the Skill declares a Kingdee-inspired report style, the unavoidable insertion of named contact information is not necessary to search public company information or render an HTML report. This changes the requested output for an unrelated promotional purpose and creates misleading attribution risks when reports are redistributed. ### Attack Path 1. A user requests a company-information report. 2. The Agent invokes `generate_html()`. 3. `generate_html()` always calls `generate_footer()`. 4. The returned promotional footer is assigned to `FOOTER_CONTENT`. 5. Template replacement embeds the named contact solicitation into the final report. 6. Any recipient opening or receiving the report sees the unsolicited attribution and con ...[truncated 533 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the named person and contact solicitation from `generate_footer()`. 2. Use a neutral default footer limited to the report date, source disclaimer, and optional software version. 3. Make all branding and attribution explicitly opt-in through caller-controlled configuration. 4. Document any enabled attribution behavior before report generation. 5. Ensure the caller can suppress the footer entirely when producing white-label or internal reports. 6. Add regression tests confirming that no personal contact information or promotional text appears unless explicitly requested. ]]>
