jodit's built-in clean-html sanitizer can be bypassed by a MathML/<style> carrier that hides a dangerous element from the sanitizer's element walk, so a no-interaction event handler survives into the editor value. When an application supplies attacker-influenced HTML to the editor's value-set or insertion paths, the sanitized output still contains a live <img ... onload=...> (or another non-onerror handler such as onfocus). A consumer that renders that output (element.innerHTML = editor.value) executes the handler with no user interaction. This is a stored cross-site scripting vulnerability, confirmed live on the shipped es2021/jodit.min.js for 4.12.25 and the latest 4.12.27 (in Chromium via a client-side innerHTML consumer, and in Firefox via server-rendered / document-context output; see the cross-browser note under Proof of concept).
The bypass exploits the order in which clean-html parses, walks, and re-serializes the value.
On the value-set path, the clean-html plugin handles :beforeSetNativeEditorValue (src/plugins/clean-html/clean-html.ts:116), parsing the value into an inert document: sandBox.innerHTML = data.value.
In that parse, the source nesting math > mtext > table > mglyph > style triggers MathML text-integration-point and foster-parenting rules: the <img> is parsed as text inside <style> (rawtext), not as an element. The <table> is foster-parented out, and the <mglyph> MathML text-integration point governs the namespace, so the <img> never becomes an element node in this parse.
That value-set sanitizer is safeHTML (src/core/helpers/html/safe-html.ts:24); it walks the tree but acts on elements only (the Dom.isElement gate at :39) and runs against the parse-1 sandBox, in which the <img> is rawtext, not an element. So removeAllEventAttributes (the full on* strip at safe-html.ts:76) has no element to clean and the handler passes through. The...
4.12.28Exploitability
AV:NAC:LPR:NUI:NScope
S:CImpact
C:LI:LA:N7.2/CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:NInjection
Other