Replace custom HTML stripper and sanitize admin UI post rendering (M4 + M5) #43
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two related HTML-security findings from the security audit share the same root dependency fix (nh3) and should be resolved together.
M5 — Custom HTML stripping instead of battle-tested library (curated.py:44)
The hand-rolled _HTMLStripper class (subclassing html.parser.HTMLParser) is used to strip tags when producing plain-text snippets for the curated queue API. Custom HTML parsers are prone to parser-differential vulnerabilities: malformed tags, SVG namespaces, HTML entities, and CDATA sections can bypass naive stripping in ways that nh3 (Rust ammonia binding) handles correctly.
M4 — Fediverse post HTML rendered without sanitization (post_details.html:279, dashboard.html:518)
Post content fetched from external Fediverse servers is rendered in the admin UI with Jinja2's |safe filter, bypassing autoescaping. A malicious or compromised Fediverse instance can serve posts containing arbitrary HTML/JavaScript that executes in the reviewer's browser session — stored XSS with access to session state and API keys.
Findings from exploration:
Plan of attack: