From d48f06e20e6d844dbbd9eef31ef5f198eeea9b49 Mon Sep 17 00:00:00 2001 From: Adam Moussa Date: Mon, 20 Jul 2026 14:53:17 -0400 Subject: [PATCH] test: lock attribute-context quote escaping in web_ui hostile-field test The escaping regression lock asserted only the element-context vector (raw " not in body # never reflected raw assert "<script>alert(1)</script>" in body # escaped form present + + # attribute context: the id flows through json.dumps into + # onclick="window.location={esc(..., quote=True)}", so the JSON string's + # opening quote must render as " -- a raw " right after the = means + # quote-escaping regressed and the attribute is breakable + assert "window.location="" in body + assert 'window.location="' not in body + + # the payload's own quote characters appear only entity-escaped + assert """ in body + assert "'" in body + assert _HOSTILE not in body