T09 · Insecure Skill Coding Practices
- Location
scripts/enhanced_report_generator.py:408- Finding
Stored HTML Injection in Generated Usability Reports
- Content
View full analysis
📄 Page Analysis: {page_analysis.get('title', 'Unknown')}
Purpose: {page_analysis.get('purpose', 'Not analyzed')}
Navigation: {', '.join(page_analysis.get('navigation', ['None found']))}
""" ``` The same unsafe rendering pattern is used for Nova Act responses: ```python if observations_list: notes = '; '.join(str(o) for o in observations_list) elif raw_response: notes = f"Response: {raw_response}" elif error_msg: notes = f"Error: {error_msg}" else: notes = "No observations recorded" html += f"""{"⚠️ " if is_issue else ""}Observation: {notes}""" ``` ### Technical Analysis The report generator inserts website-derived and model-derived values directly into an HTML document without applying contextual HTML escaping. Affected values include: - Page titles, purposes, and navigation entries extracted from the tested website - Raw Nova Act responses - Persona names and test-case descriptions - Actions, expected outcomes, errors, and observations - Trace filenames and paths used in HTML attributes Because the tested website is an untrusted input source, an attacker can place HTML or script-bearing markup in visible page content. If Nova Act preserves that content in a title, navigation result, page description, or raw response, the report generator writes it verbatim into `nova_act_usability_report.html`. The vulnerability is stored rather than reflected: the malicious payload is first collecte ...[truncated 1782 chars]- Remediation
View remediation
``` 6. Avoid enabling scripts in the report. If scripting is later required, use a nonce-based CSP and never permit inline event handlers. 7. Add regression tests using payloads in every dynamic field, including: - `` - `` - `" onmouseover="alert(1)` - `javascript:alert(1)` 8. Apply the correction consistently to all dynamic interpolation sites, not only the primary page-analysis section. ]]>
