Skip to content

Commit 5252e58

Browse files
DOC-3355: Prevent valid iframe and script elements from being removed by DOMPurify (#4083)
* Docs: DOC-3355 - Prevent valid iframe and script elements from being removed by DOMPurify * Update modules/ROOT/pages/8.5.0-release-notes.adoc Co-authored-by: Mitchell Crompton <mitchell.crompton@tiny.cloud> * Update modules/ROOT/pages/8.5.0-release-notes.adoc Co-authored-by: Mitchell Crompton <mitchell.crompton@tiny.cloud> --------- Co-authored-by: Mitchell Crompton <mitchell.crompton@tiny.cloud>
1 parent d411b30 commit 5252e58

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

modules/ROOT/pages/8.5.0-release-notes.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,20 @@ For information on using Enhanced Skins & Icon Packs, see: xref:enhanced-skins-a
141141

142142
// CCFR here.
143143

144+
=== Script and style elements would incorrectly be removed by DOMPurify when considered valid in the schema
145+
// #TINY-9655
146+
147+
Previously, `script` and `style` elements that were explicitly allowed through xref:content-filtering.adoc#valid_elements[`+valid_elements+`] or xref:content-filtering.adoc#extended_valid_elements[`+extended_valid_elements+`] were removed during the sanitization process when xref:content-filtering.adoc#xss_sanitization[`+xss_sanitization+`] was enabled. DOMPurify flagged these elements as potential mXSS vectors and removed them entirely, even when the schema configuration indicated they were valid.
148+
149+
In {productname} {release-version}, `script` and `style` elements that are considered valid in the schema are retained during sanitization. The sanitization process still removes unsafe attributes and content, but no longer removes the entire element when the schema explicitly allows it.
150+
151+
=== Iframe elements with children would incorrectly be removed by DOMPurify
152+
// #TINY-9655
153+
154+
Previously, `iframe` elements that contained child nodes were removed entirely during the sanitization process. DOMPurify treated the presence of child nodes within an `iframe` as a potential mXSS risk and stripped the entire element from the content.
155+
156+
In {productname} {release-version}, `iframe` elements are preserved during sanitization. Any child nodes and unsafe or invalid attributes are removed, but the `iframe` element itself remains in the editor content.
157+
144158

145159
[[security-fixes]]
146160
== Security fixes

modules/ROOT/pages/fullpagehtml.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ include::partial$misc/bundling-guide-link.adoc[]
4141
[WARNING]
4242
====
4343
**Certain elements may be removed by XSS sanitization**
44-
By default, {productname} sanitizes HTML content to protect against XSS attacks. Elements outside the HTML5 specification, such as `<script>`, are removed. Standard `<meta>` tags are preserved, but attributes not defined in the HTML5 spec (for example, the RDFa `property` attribute) require explicit configuration to be retained.
44+
By default, {productname} sanitizes HTML content to protect against XSS attacks. Elements outside the HTML5 specification, such as `<script>`, are removed unless explicitly allowed through xref:content-filtering.adoc#valid_elements[`+valid_elements+`] or xref:content-filtering.adoc#extended_valid_elements[`+extended_valid_elements+`]. Standard `<meta>` tags are preserved, but attributes not defined in the HTML5 spec (for example, the RDFa `property` attribute) require explicit configuration to be retained.
4545
4646
If integrators encounter issues with required elements being removed, the following configuration options are available. These options reduce security and should be used with caution:
4747

0 commit comments

Comments
 (0)