/

CVE-2026-47762

Severity:

HIGH RISK

(8.7)

XSS in TinyMCE Protected Comments Feature

CVE-2026-47762

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Stored Cross-Site Scripting and Session Compromise

Severity:

HIGH RISK

(8.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

TinyMCE contained a stored cross-site scripting vulnerability in the mce:protected comments mechanism that allowed crafted content to bypass sanitization.

An attacker who can save malicious protected content could inject scripts that later execute when the editor content is restored, affecting users who rely on the protect option.

Affected context

The vulnerability appears in TinyMCE deployments that:

  • Enable and actively use the "protect" option or related mce:protected comments feature
  • Allow users to create or edit content that is stored and later reloaded into the editor
  • Rely on TinyMCE's built-in sanitization to prevent execution of untrusted scripts

It is most relevant in multi-user environments where untrusted or semi-trusted content authors can submit rich text that is viewed or edited by others.

Exploit preconditions

  • Attack surface: Web applications embedding TinyMCE with the protect option enabled.
  • Required access: Ability to create or modify content that is saved and later restored into TinyMCE (e.g., as an authenticated user, content editor, or any role with edit permissions).
  • Trigger point: When the stored content containing forged mce:protected comments is reloaded or restored in TinyMCE, causing the malicious script to execute in the victim's browser.
  • Why exploitation is possible: The special mce:protected comments are treated differently by the sanitization logic, allowing attacker-crafted comments to bypass normal filtering and re-emerge as executable script when the content is restored.

Why this happens

This issue stems from incomplete and context-aware sanitization of specially handled editor markup, specifically the mce:protected comments used by TinyMCE to preserve content.

The sanitization and restoration pipeline trusted data wrapped in, or formatted as, protected comments and did not fully re-validate it when reconstructing the DOM.

This maps to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting), where user-controlled input is stored and later inserted into the page without adequate escaping or filtering in the execution context of the browser.

Potential impact

  • Execution of arbitrary JavaScript in the context of the victim's browser session
  • Theft of session tokens, CSRF tokens, or other sensitive data accessible via the DOM
  • Unauthorized actions performed on behalf of the victim (e.g., modifying content, changing settings)
  • Defacement of content, injection of phishing prompts, or drive-by malware links within the editor content
  • Lateral movement to other parts of the application that trust authenticated browser state

General mitigation guidance

Effective mitigation focuses on hardening content processing pipelines and reducing trust in any special markup channels:

  • Treat all user-supplied content, including special editor constructs like mce:protected comments, as untrusted and subject to consistent sanitization and context-appropriate escaping.
  • Ensure that content is sanitized both on input (when stored) and on output (when rendered or restored to the editor), using a robust, well-maintained HTML/JS sanitization library.
  • Limit the power and expressiveness of protected or "raw" content features to only what is strictly required, and avoid mechanisms that attempt to preserve arbitrary markup without re-validation.
  • Enforce least-privilege roles for content authors, separating high-trust editors (who might be allowed more powerful markup) from general users.
  • Where feasible, apply Content Security Policy (CSP) to reduce the impact of injected scripts, for example by disallowing inline script execution.

How teams detect issues like this

Organizations can look for this class of issue through a combination of review and testing:

  • Static analysis & code review:
  • Inspect integration points where TinyMCE content is stored and later reloaded, checking that content passes through a consistent sanitization step.
  • Flag code paths that treat mce:protected or similar special comments as implicitly trusted or bypass normal filtering.
  • Review configuration of TinyMCE, especially the "protect" option and any custom callbacks that reinject raw HTML into the page.
  • Dynamic analysis & testing:
  • Use security testing tools or manual penetration testing to inject benign XSS test payloads into protected comments and verify whether they execute upon reload.
  • Incorporate automated browser-based tests that validate no script execution occurs when restoring previously saved content.
  • Policy enforcement:
  • Establish coding standards that forbid unreviewed "raw HTML" or "protected content" bypass channels.
  • Integrate automated scanning of content handling routines into CI pipelines using SAST/DAST tools that understand common XSS patterns.

Sources

SourceLink
github.comgithub.com/tinymce/tinymce/security/advisories/GHSA-v98h-vmpc-fpqv
tiny.cloudtiny.cloud/docs/tinymce/7/7.9.3-release-notes/#overview
tiny.cloudtiny.cloud/docs/tinymce/8/8.5.1-release-notes/#overview

Frequently asked

questions

Yes. Any user who can submit or modify content that is stored by the application and later viewed or edited by others through TinyMCE can attempt to exploit this issue, typically via the normal web interface.

The attacker generally needs the ability to create or edit content in a context where TinyMCE is used with the protect option. This often corresponds to an authenticated role such as a contributor, editor, or any user permitted to save rich text that others will later load.

Apply consistent, context-aware sanitization to all user-controlled content, including special editor constructs like protected comments, and ensure that any restoration or transformation step does not reintroduce unsanitized HTML or script execution paths.

Standardize on a robust content handling architecture: treat all stored content as untrusted, run it through vetted sanitization libraries on both input and output, keep rich text editor configurations minimal and secure-by-default, and regularly review these integrations as part of security-focused code review and automated testing.

Find out what's already
exploitable in your codebase.