T09 · Insecure Skill Coding Practices
- Location
scripts/password_auditor.py:591- Finding
Stored HTML Injection in Generated Dashboard
- Content
View full analysis
{f['entry']}{sev}" f"{kind}{f['title']} " f"{tagcls}" f"{f['action']}") prows = "".join( f"{p['priority']}#{p['entry']} {p['title']}" f"{p['dimension']}{p['action']}" for p in res["plan"][:15]) return HTML_TEMPLATE.format( date=datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M UTC"), entries=res["total_entries"], score=res["score"], ``` ### Technical Analysis The HTML report generator directly interpolates vault-controlled entry titles into HTML without contextual escaping. Entry titles originate from CSV or JSON vault exports and therefore cannot be assumed to be trusted. A malicious title containing HTML elements or event-handler attributes is preserved in the generated dashboard. When the user opens the report in a browser, that content is parsed as active markup rather than displayed as text. For example, a crafted title could contain an image element with an `onerror` handler. Depending on browser restrictions and the payload used, injected JavaScript could: - Modify or conceal legitimate audit findings. - Display deceptive remediation instructions or phishing content. - Create outbound requests containing report information. - Read other information rendered in the dashboard. - Redirect the user to an attacker-controlled page. The report is described as self-contained and safe to open, which increases the likelihood that users will trust and open it without treating it as attacker-controlled content. ### Attack Path 1. An attacker causes a crafted title to be stored in a password-vault entry, or supplies ...[truncated 1070 chars]- Remediation
View remediation
``` 5. Avoid inline scripts and event handlers so that a strict `script-src 'none'` policy remains viable. 6. Add regression tests using payloads containing: - `
