T09 · Insecure Skill Coding Practices
- Location
scripts/score_test.py:489- Finding
Stored HTML and Script Injection in Generated Reports
- Content
View full analysis
📅 {session.test_date} 👤 {session.tester or 'Anonymous'} 🎯 {session.difficulty.upper()} 🔬 {session.track_mode.upper()} ⏱️ {session.duration_minutes} 分钟 ``` Several result fields are also rendered without escaping: ```python for result in session.results: info = DIMENSIONS[result.dimension] diff_map = {'basic': 'diff-basic', 'advanced': 'diff-advanced', 'expert': 'diff-expert'} diff_label = {'basic': '基础', 'advanced': '进阶', 'expert': '专家'} q_short = html.escape(result.question[:45]) + ('...' if len(result.question) > 45 else '') notes_html = html.escape(result.notes[:70]) if result.notes else '-' track_class = "track-oit-badge" if info["track"]=="OIT" else "track-lli-badge" track_label = "OIT" if info["track"]=="OIT" else "LLI" html_content += f""" {info['name_cn']} {track_label} {result.question_id} {diff_label.get(result.difficulty,result.difficulty)} {q_short} {result.score}/5 {notes_html} """ ``` These values can originate from an untrusted JSON document: ```python w ...[truncated 2737 chars]- Remediation
View remediation
