T09 · Insecure Skill Coding Practices
- Location
scripts/accessibility_checker.py:443- Finding
Unescaped Figma Data Allows HTML Injection in Generated Reports
- Content
View full analysis
Accessibility Report - {results['file_name']} ``` ```python for issue in results['issues']: severity_class = issue['severity'] html += f"""{issue['type'].replace('_', ' ').title()}: {issue['message']}
WCAG {issue['wcag_criterion']}Element: {issue.get('node_name', 'N/A')} (ID: {issue.get('node_id', 'N/A')})""" if 'details' in issue and issue['details']: html += "Details:" ``` The style-audit report contains the same vulnerability pattern: ```python- "
for key, value in issue['details'].items():
html += f"
- {key.replace('_', ' ').title()}: {value} " html += "
File: {audit_results.get('file_name', 'Unknown')}
``` ```python for issue in audit_results['issues']: severity_class = issue['severity'] html += f"""{issue['category'].title()}: {issue['message']}
Node: {issue.get('node_name', 'N/A')} ({issue.get('node_id', 'N/A')})
Suggestions:
-
"""
for suggestion in issue.get('suggestions', []):
html += f"
- {suggestion} \n" ``` ### Technical Analysis File names, node names, node identifiers, issue messages, detail values, and related report fields are interpolated directly into HTML without contextual output encoding. Several of these values originate in Figma documents and can therefore be controlled by a person who owns or can e ...[truncated 1371 chars]
- Remediation
View remediation
`, event-handler attributes, malformed tags, quotes, and ampersands. - Apply the correction consistently to both `accessibility_checker.py` and `style_auditor.py`. ]]>
