T09 · Insecure Skill Coding Practices
- Location
scripts/fetch_xhs_hot_articles.py:225- Finding
Stored HTML Injection in Generated Reports
- Content
View full analysis
{idx + 1}. {title}{scores_html} ''' ``` The user-supplied keyword is also inserted directly into the report: ```python关键词:{keyword} | 时间范围:{time_range}``` ### Technical Analysis The generated HTML interpolates values from two untrusted sources: 1. The command-line keyword supplied by the user or calling Agent. 2. Fields returned by the remote Redfox API, including `authorNickname` and `shareInfoLink`. These values are inserted into HTML text and attribute contexts without context-aware escaping. In particular: - `keyword` and `author_name` can inject HTML elements or event handlers. - `note_link` is placed in an `href` at ...[truncated 1529 chars]- Remediation
View remediation
``` 6. Add tests using payloads containing quotation marks, angle brackets, event handlers, and dangerous URL schemes. ]]>
