Cross-site scripting in Discourse - #VU166159
Published: November 13, 2026
Vulnerability details
The vulnerability allows a remote user to inject arbitrary HTML into posts.
The vulnerability exists due to unsafe reparsing of sanitized HTML in Discourse's code-block highlighting component when highlighting Unicode bidirectional characters with Nokogiri 1.19.4 or earlier. A remote user can craft a post containing bidirectional characters in attribute values that become HTML during reparsing to bypass sanitization and inject arbitrary markup.