DOC-3355: Prevent valid iframe and script elements from being removed by DOMPurify#4083
Open
kemister85 wants to merge 1 commit intofeature/8.5.0/DOC-3355from
Open
DOC-3355: Prevent valid iframe and script elements from being removed by DOMPurify#4083kemister85 wants to merge 1 commit intofeature/8.5.0/DOC-3355from
kemister85 wants to merge 1 commit intofeature/8.5.0/DOC-3355from
Conversation
…removed by DOMPurify
12b438e to
4358a32
Compare
MitchC1999
approved these changes
Apr 20, 2026
Comment on lines
+113
to
+118
| === Script elements would incorrectly be removed by DOMPurify when considered valid in the schema | ||
| // #TINY-9655 | ||
|
|
||
| Previously, `script` 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. | ||
|
|
||
| In {productname} {release-version}, `script` 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. |
Contributor
There was a problem hiding this comment.
Suggested change
| === Script elements would incorrectly be removed by DOMPurify when considered valid in the schema | |
| // #TINY-9655 | |
| Previously, `script` 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. | |
| In {productname} {release-version}, `script` 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. | |
| === Script and style elements would incorrectly be removed by DOMPurify when considered valid in the schema | |
| // #TINY-9655 | |
| 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. | |
| 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. |
| === Iframe elements with children would incorrectly be removed by DOMPurify | ||
| // #TINY-9655 | ||
|
|
||
| Previously, `iframe` elements that contained child nodes were removed entirely during the sanitization process, even when the editor configuration allowed iframes. DOMPurify treated the presence of child nodes within an `iframe` as a potential mXSS risk and stripped the entire element from the content. |
Contributor
There was a problem hiding this comment.
Suggested change
| Previously, `iframe` elements that contained child nodes were removed entirely during the sanitization process, even when the editor configuration allowed iframes. DOMPurify treated the presence of child nodes within an `iframe` as a potential mXSS risk and stripped the entire element from the content. | |
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket: DOC-3355
Site: Staging
Changes:
modules/ROOT/pages/8.5.0-release-notes.adoc(Bug fixes section):Pre-checks:
Branch is correctly prefixed(release-note branch)modules/ROOT/nav.adochas been updated (if applicable).Files removed have been deleted, not just excluded from the build (if applicable).Files added for New product features include arelease noteentry.Major or minor version changes have updated thesupported-versions.adoctable.