CVE-2026-104828: HtmlUnit: Mutation XSS (mXSS) in HTMLWriterFilter - TEXTAREA/TITLE entity decode without re-encode
HtmlUnit Neko is an HtmlUnit adaptation of NekoHTML. Prior to 5.4.0, HTMLWriterFilter writes decoded TEXTAREA and TITLE character content without entity encoding because both elements are treated as special content. During a parse-and-serialize round trip, entity references inside these escapable raw-text elements are decoded by the parser and then emitted as raw markup by printCharacters(), changing the document's semantics. Applications that use htmlunit-neko in an HTML sanitizer, content filter, or other parse-transform-serialize pipeline can therefore turn attacker-controlled encoded text into executable markup when the output is rendered by a browser. This issue is fixed in version 5.4.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
htmlunit-nekoto a version that resolves this vulnerability.Fixed in 5.4.0
Event History
Frequently Asked Questions
Which deployments are exposed?
Applications using htmlunit-neko in a sanitizer, content filter, or other parse-transform-serialize pipeline are exposed when they process attacker-controlled HTML and the resulting output is rendered in a browser.
What does an attacker need to exploit this issue?
An attacker needs to supply encoded text within TEXTAREA or TITLE content that passes through the affected parse-and-serialize workflow. The serialized output must then be rendered by a browser for the changed document semantics to create executable markup.
How can I determine whether my application is affected?
Check whether your application uses maven/org.htmlunit/neko-htmlunit before version 5.4.0 and serializes parsed HTML. Test workflows that accept untrusted HTML containing entity references in TEXTAREA or TITLE elements and render the serialized result.
What should be done if the vulnerable component is in use?
Upgrade htmlunit-neko to version 5.4.0, which fixes the issue. Until upgrading, avoid rendering serialized output from attacker-controlled HTML processed through affected parse-transform-serialize workflows.