Skip to content

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
feature/8.5.0/DOC-3355_TINY-9655
Open

DOC-3355: Prevent valid iframe and script elements from being removed by DOMPurify#4083
kemister85 wants to merge 1 commit intofeature/8.5.0/DOC-3355from
feature/8.5.0/DOC-3355_TINY-9655

Conversation

@kemister85
Copy link
Copy Markdown
Contributor

@kemister85 kemister85 commented Apr 20, 2026

Ticket: DOC-3355

Site: Staging

Changes:

  • Added two release note entries for TINY-9655 to modules/ROOT/pages/8.5.0-release-notes.adoc (Bug fixes section):
    • Script elements would incorrectly be removed by DOMPurify when considered valid in the schema.
    • Iframe elements with children would incorrectly be removed by DOMPurify.

Pre-checks:

  • Branch is correctly prefixed (release-note branch)
  • modules/ROOT/nav.adoc has been updated (if applicable).
  • Files have been included where required (if applicable).
  • Files removed have been deleted, not just excluded from the build (if applicable).
  • Files added for New product features include a release note entry.
  • Major or minor version changes have updated the supported-versions.adoc table.
  • Build passes without console errors, warnings, or issues.

@kemister85 kemister85 requested review from a team and soritaheng as code owners April 20, 2026 09:36
@kemister85 kemister85 requested review from EkimChau, ShiridiGandham and tiny-james and removed request for a team April 20, 2026 09:36
@kemister85 kemister85 added the upcoming release Documentation for features currently under development/QA label Apr 20, 2026
@kemister85 kemister85 added this to the TinyMCE 8.5.0 milestone Apr 20, 2026
@kemister85 kemister85 requested a review from MitchC1999 April 20, 2026 09:37
@kemister85 kemister85 force-pushed the feature/8.5.0/DOC-3355_TINY-9655 branch from 12b438e to 4358a32 Compare April 20, 2026 09:38
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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upcoming release Documentation for features currently under development/QA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants