From f13d1507ad7877531291e80d0359a62075f7498a Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Sun, 5 Jul 2026 17:20:01 +0300 Subject: [PATCH] fix: escape debug title (XSS) and make test suite order-independent Issue #13: data["html"]["title"] was embedded into the debug HTML of /post/html without escaping; title never passes through bleach, so a post whose generated title carries markup (e.g. a poll question) was a reflected XSS under ?debug=true. Escape it with html.escape, same as raw_message. Add a regression test with a " + # verbatim — it must be html-escaped before being embedded in the debug output. + msg = make_message(25, media=MessageMediaType.POLL) + msg.poll = SimpleNamespace(question="") + parser = PostParser(_make_client_returning(msg)) + html_out = await parser.get_post("testchan", 25, "html", debug=True) + + # No live