T09 · Insecure Skill Coding Practices
- Location
scripts/generate_html_dashboard.py:51- Finding
Stored HTML and JavaScript Injection in Generated Dashboard
- Content
View full analysis
ASIN: {{ASIN}} | Product: {{PRODUCT_NAME}} | Site: {{SITE}} | Generated: {{DATE}} ``` ### Technical Analysis The dashboard generator performs direct string replacement without HTML or attribute escaping. The affected values include: - `asin`, supplied through command-line input or parsed from a report directory name - `site`, supplied through command-line input or parsed from a report directory name - `product_name`, obtained from user-supplied product JSON, remote API data, or inferred keyword data Because these values are inserted into both HTML text and the `href` attribute, an attacker can terminate the surrounding context and inject arbitrary HTML or JavaScript. For example, a malicious product name containing: ```html``` would be embedded directly in the generated `dashboard.html`. Keyword table cells are separately escaped, but that protection does not cover these top-level template substitutions. ### Attack Path 1. An attacker controls a product-information JSON file, a Sorftime API response, or an accepted command-line value. 2. The attacker places an HTML or script payload in `product_name`, `asin`, or `site`. 3. T ...[truncated 865 chars]- Remediation
View remediation
`, quotes, event handlers, and attribute terminators. ]]>
