
Cloud Vulnerability DB
A community-led vulnerabilities database
TinyMCE adds sandbox="" to iframe elements when sandbox_iframes is enabled (the default since 7.0.0), except for iframes whose host is listed in sandbox_iframes_exclusions. The host check did not parse URLs the same way browsers do. A crafted iframe src could be matched against an excluded host (such as the default youtube.com) while the browser loads a different origin, leaving the iframe without a sandbox attribute.
Affected: TinyMCE 7.0.0 to 8.11.0. Fixed in 8.11.1.
The excluded host was extracted with a regular expression whose userinfo part accepted ? and #. For https://example.com?@youtube.com/ it read youtube.com as the host. Browsers read example.com as the host and ?@youtube.com/ as the query, so the iframe skipped sandboxing but loaded example.com.
The same regular expression matched schemeless values starting with www. or containing @, such as www.youtube.com/../path or x@youtube.com/../path. Browsers resolve these as relative URLs against the editor document, so an unsandboxed iframe could load a document from the editor's own origin.
When the document's own host was listed in sandbox_iframes_exclusions and relative_urls or remove_script_host was enabled, URL conversion kept repeated slashes in the path. With document_base_url: 'https://example.com/', the src https://example.com///attacker.example/payload was excluded from sandboxing and then rewritten to //attacker.example/payload, which browsers load from attacker.example.
The fix applies exclusions only to absolute http:// and https:// URLs and reads the host with the browser's URL parser. URL conversion no longer rewrites a URL when the original or the converted URL would point to a different origin than document_base_url.
With default options:
tinymce.init({ selector: 'textarea' }).then(([ editor ]) => {
editor.setContent('<iframe src="https://example.com?@youtube.com/"></iframe>');
console.log(editor.getContent());
// <p><iframe src="https://example.com?@youtube.com/"></iframe></p> (no sandbox attribute)
});The iframe loads https://example.com/?@youtube.com/ without a sandbox. https://example.com#@youtube.com/ behaves the same way.
With the document host excluded:
tinymce.init({
selector: 'textarea',
document_base_url: 'https://example.com/',
sandbox_iframes_exclusions: [ 'example.com' ],
relative_urls: true
}).then(([ editor ]) => {
editor.setContent('<iframe src="https://example.com///attacker.example/payload"></iframe>');
console.log(editor.getContent());
// <p><iframe src="//attacker.example/payload"></iframe></p> (no sandbox attribute)
});An attacker who can supply content to the editor (by paste, by stored content loaded into the editor, or through any API that sets content) can embed an unsandboxed iframe from an arbitrary origin. The missing sandbox attribute is kept in the content TinyMCE outputs, so it also affects pages that later display that content. The framed page can run scripts, submit forms, display deceptive content such as fake login prompts and, with user interaction, navigate the top-level page or open popups. It cannot read or modify the parent document, because it is cross-origin.
The schemeless variant loads an unsandboxed same-origin document. It only matters where the attacker can already host a document on the editor's origin, for example through file uploads.
sandbox_iframes_exclusions: [] to sandbox all iframes.sandbox_iframes_exclusions.To avoid this vulnerability: Upgrade to TinyMCE 8.11.1 or higher.
Source: NVD
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."