Skip to content

Commit d1bc75f

Browse files
committed
DOC-3147: Update migration guide and security documentation for DOMPurify changes, and fix for ref numbers.
1 parent 9217fd2 commit d1bc75f

File tree

2 files changed

+70
-37
lines changed

2 files changed

+70
-37
lines changed

modules/ROOT/pages/migration-from-7x.adoc

Lines changed: 64 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ When migrating to TinyMCE {release-version} with a commercial license, the licen
103103
----
104104
your-site/
105105
├── tinymce/
106-
└── plugins/
107-
├── licensekeymanager/ # Add this folder
108-
│ ├── plugin.min.js
109-
│ └── index.js
110-
└── ... other plugins
106+
│ └── plugins/
107+
│ ├── licensekeymanager/ # Add this folder
108+
│ │ ├── plugin.min.js
109+
│ │ └── index.js
110+
│ └── ... other plugins
111111
----
112112

113113
. *NPM/Module Bundler:*
@@ -179,6 +179,50 @@ For complete details on license key manager setup and troubleshooting, see xref:
179179
* [ ] Test editor functionality with new license
180180
* [ ] Verify all premium features are working
181181

182+
[[dompurify-update-breaking-change]]
183+
=== DOMPurify Update and Stricter Sanitization (Breaking Change)
184+
// #TINY-12056
185+
186+
{productname} {release-version} updates the DOMPurify dependency to version 3.2.6 and enables the `SAFE_FOR_XML` flag by default. This is a breaking change: content that previously passed sanitization in {productname} 7 may now be stripped or altered during the sanitization process.
187+
188+
[IMPORTANT]
189+
====
190+
This change improves security and aligns with DOMPurify's recommended defaults. However, existing content and integrations that relied on the previous, less strict sanitization behavior may be impacted.
191+
====
192+
193+
==== Key Changes
194+
195+
* **DOMPurify upgraded to 3.2.6** — The custom patch is now included upstream; maintaining a forked patch is no longer required.
196+
* **`SAFE_FOR_XML` enabled** — This setting enforces stricter handling of comments and attribute values, preventing certain XSS vectors.
197+
* **Content Impact** — HTML comments containing tags, Internet Explorer conditional comments, and attributes with HTML-like values may now be removed during sanitization. Content that was previously allowed may be stripped.
198+
199+
==== Migration Guidance
200+
201+
* Review workflows and test content that previously relied on relaxed sanitization.
202+
* If custom comment handling is required, consider using DOMPurify hooks as recommended by the maintainers.
203+
204+
.Example: Content Differences
205+
|===
206+
|Content |{productname} 7 Output |{productname} {release-version} Output
207+
208+
|`<div><!-- <p>Hello World</p> --></div>`
209+
|`<div><!-- <p>Hello World</p> --></div>`
210+
|`<div></div>`
211+
212+
|`<iframe><!-- Hello World --></iframe>`
213+
|`<p><iframe sandbox=""><!-- Hello World --></iframe></p>`
214+
|``
215+
216+
|`<script><!-- Hello World --></script>`
217+
|`<script><!-- Hello World --></script>`
218+
|``
219+
|===
220+
221+
[NOTE]
222+
====
223+
For information on disabling DOMPurify sanitization (not recommended), see xref:security.adoc#xss_sanitization-option[xss_sanitization option].
224+
====
225+
182226
== Core API Changes
183227

184228
[discrete]
@@ -218,7 +262,7 @@ editor.insertContent('<p>New content</p>');
218262
[[editor-documentbaseurl-removal]]
219263
==== editor.documentBaseUrl
220264
[.discrete]
221-
// #TINY-12236
265+
// #TINY-12182
222266

223267
The undocumented `editor.documentBaseUrl` property has been removed.
224268

@@ -270,7 +314,7 @@ editor.execCommand('ToggleToolbarDrawer', false, { skipFocus: true });
270314

271315
[[fire-method-deprecation]]
272316
==== `fire()`
273-
// #TINY-11692
317+
// #TINY-12012, ref TINY-8102
274318

275319
The `fire()` method has been replaced by `dispatch()` for event handling. The `fire()` method will be removed in {productname} 9 to avoid confusion with its name.
276320

@@ -325,7 +369,7 @@ language_url: '/langs/en-GB.js'
325369
Support for the underscore format will be removed in {productname} 9. Early migration is recommended.
326370

327371
==== Update to Image and Accessibility Checker Plugins
328-
// #TINY-12235
372+
// #TINY-12226
329373

330374
The Image and Accessibility Checker plugins now follow the latest W3C standards for decorative images, requiring an empty alt attribute rather than a `+role="presentation"+` attribute. This change helps improve accessibility support.
331375

@@ -338,46 +382,29 @@ The Image and Accessibility Checker plugins now follow the latest W3C standards
338382
* [ ] Update image plugin configuration if customized
339383
* [ ] Test accessibility checker with updated content
340384

385+
For more information on the changes, see: xref:a11ychecker.adoc##image-rules[Accessibility Checker: Image rules].
341386

342-
==== Page Break plugin update for Export PDF/Word Compatibility
343-
// #TINY-12013
344-
345-
The Page Break plugin has been updated to work out-of-the-box with the xref:exportpdf.adoc[Export to PDF] and xref:exportword.adoc[Export to Word] plugins, addressing a common pain point for developers.
346-
347-
**Impact**: This change improves the export experience by providing more predictable page break behavior.
348-
349-
**Migration steps:**
350-
351-
* If the old behavior is preferred, explicitly set the `pagebreak_separator` option:
352-
353-
[source, javascript]
354-
----
355-
pagebreak_separator: '<!-- my page break -->'
356-
----
357-
358-
The default value has been changed to produce a page break in both the xref:exportpdf.adoc[Export to PDF] and xref:exportword.adoc[Export to Word] service, such as:
387+
==== Page Break Plugin: Export PDF/Word Compatibility and Option Updates
388+
// #TINY-12013, #TINY-12462
359389

360-
.Example
361-
[source, javascript]
362-
----
363-
pagebreak_separator: '<div style="break-after: page"></div>'
364-
----
390+
The Page Break plugin has been updated to work out-of-the-box with the xref:exportpdf.adoc[Export to PDF] and xref:exportword.adoc[Export to Word] plugins, addressing a common pain point for developers. As part of this update:
365391

366-
==== `pagebreak_split_block` plugin option defualt has been updated
367-
// #TINY-12462
392+
* The default value of the xref:pagebreak.adoc#pagebreak_separator[`pagebreak_separator`] option now uses a block tag (`<div style="break-after: page
393+
* The default value of the xref:pagebreak.adoc#pagebreak_split_block[`pagebreak_split_block`] option has changed from `false` to `true`.
368394

369-
The default value of the xref:pagebreak.adoc#pagebreak_split_block[`pagebreak_split_block`] option has changed from `false` to `true`. This means that by default, inserting a page break will now automatically split block elements (such as paragraphs, lists, or tables) at the cursor position.
395+
This means that by default, inserting a page break will now automatically split block elements (such as paragraphs, lists, or tables) at the cursor position, and the separator will be compatible with both export services.
370396

371-
**Impact**: This change affects how page breaks interact with block elements, providing a more intuitive editing experience.
397+
**Impact**: These changes improve the export experience and provide a more intuitive editing experience.
372398

373399
**Migration steps:**
374400

375-
* If you want to maintain the previous behavior where page breaks do not automatically split block elements, add the following to your configuration:
401+
* If you want to restore the previous (v7) behavior, where page breaks do not automatically split block elements and use a comment tag as the separator, set both options explicitly in your configuration:
376402

377403
[source, javascript]
378404
----
379405
tinymce.init({
380406
// ...other configuration options...
407+
pagebreak_separator: '<!-- my page break -->',
381408
pagebreak_split_block: false
382409
});
383410
----
@@ -395,7 +422,7 @@ When upgrading to {productname} 8, you will need to review and possibly update h
395422
+
396423
* Ensure your script tag includes both required attributes:
397424
+
398-
[source, html]
425+
[source,html,subs="attributes+"]
399426
----
400427
<script src="{cdnurl}" referrerpolicy="origin" crossorigin="anonymous"></script>
401428
----
@@ -466,7 +493,7 @@ The handling of `<div>` elements during cut operations has been improved to prev
466493
=== Service and Configuration Changes
467494

468495
==== Discontinuation of Medical English (UK)
469-
// #TINY-12255
496+
// #EPIC-255
470497

471498
[WARNING]
472499
The "Medical English (UK)" dictionary has been removed due to licensing constraints. Customers using this feature must update their configurations accordingly.

modules/ROOT/partials/security/sanitizing-html-input-and-protecting-against-xss-attacks-dom-parser-and-dom-purify.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ As of {productname} 6.4, however, it is possible to turn DOMPurify off using the
4848

4949
NOTE: `xss_sanitization` is set to `true` by default. That is, {productname} specifically sets the `xss_sanitization` option to `true`, even if this option is not declared in a {productname} configuration.
5050

51+
[[xss_sanitization-option]]
5152
*Type:* `+Boolean+`
5253

5354
*Default value:* `+true+`
@@ -65,3 +66,8 @@ tinymce.init({
6566
----
6667

6768
WARNING: Turning DomPurify off leaves {productname}, and any application using {productname}, extremely vulnerable to XSS attacks. Only turn DomPurify off if alternative and equivalently capable HTML and XML sanitization and XSS protections are in place.
69+
70+
[NOTE]
71+
====
72+
{productname} {release-version} upgrades DOMPurify to version 3.2.6 and enables the `SAFE_FOR_XML` flag by default. This enforces stricter sanitization, which may remove or alter content that previously passed in {productname} 7. For more information see xref:migration-from-7x.adoc#dompurify-update-breaking-change[Migration Guide]
73+
====

0 commit comments

Comments
 (0)