T09 · Insecure Skill Coding Practices
- Location
scripts/generate_report.py:238- Finding
Stored HTML and JavaScript Injection in the Core Report Generator
- Content
View full analysis
{kpi['label']}{kpi['value']}{kpi['change']}""" # Section content sections_html = '' for section in sections: section_type = section.get('type', 'chart') if section_type == 'chart': sections_html += f"""""" elif section_type == 'table': sections_html += f"""{section.get('title', '')}{f'
' + section.get('insight', '') + '' if section.get('insight') else ''}""" elif section_type == 'insight': sections_html += f"""{section.get('title', '')}{section.get('content', '')}📌 {section.get('title', 'Key Insight')}""" ``` ### Technical Analysis The generator concatenates report fields directly into an HTML document without context-sensitive escaping. Affected values include KPI labels, values, changes, CSS class names, section titles, image alternative text, insights, and arbitrary table or section content. If any of these values originate from uploaded data, database query results, imported report configurations, or another untrusted source, HTML elements and event handlers remain executable. Values pla ...[truncated 1462 chars]{section.get('content', '')}
- Remediation
View remediation
