/

CVE-2026-47761

Severity:

HIGH RISK

(8.7)

Stored XSS in TinyMCE Media Plugin via data-mce-* Attributes

CVE-2026-47761

Analyzed

Vulnerability type

Category:

Stored Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Client-Side Code Execution in User Browsers

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's media plugin contains a stored cross-site scripting (XSS) vulnerability where crafted data-mce-* attributes can be used to inject malicious JavaScript into editor content.

When this content is later rendered in a browser, the embedded scripts may execute in the victim's context, impacting any user who views or interacts with the compromised content.

Affected context

This vulnerability affects applications that embed TinyMCE as a rich text editor with the media plugin enabled and allow users to create or edit content that is later rendered as HTML.

It becomes relevant in contexts where:

  • User-supplied content from TinyMCE is stored (e.g., in a database, CMS, forum, blog, or comments system).
  • The stored content is rendered back into web pages viewed by other users or administrators.
  • The application relies on TinyMCE's processing of data-mce-* attributes without adding additional server-side sanitization or HTML filtering.

Exploit preconditions

  • Attack surface: Web applications that integrate TinyMCE with the media plugin.
  • Required access: Ability to submit or edit content using the affected TinyMCE instance (e.g., authenticated user in a CMS, forum poster, content editor).
  • Trigger point: Viewing or rendering of the stored TinyMCE content containing crafted data-mce-* attributes in a browser.
  • Why exploitation is possible: The media plugin does not sufficiently validate or sanitize data-mce-* attributes before saving or rendering them, allowing attacker-controlled script execution when the HTML is processed by the browser.

Why this happens

The root cause is insufficient output encoding and sanitization of HTML attributes handled by TinyMCE's media plugin, specifically data-mce-* attributes.

Instead of treating these attributes as untrusted data and escaping or filtering dangerous constructs, the plugin allows attacker-supplied values that can influence how the browser interprets the content.

This maps to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting): untrusted input is incorporated into a web page in a way that enables script execution in the client.

Potential impact

  • Execution of arbitrary JavaScript in the victim's browser when they view the affected page.
  • Theft of session tokens, CSRF tokens, or other sensitive information accessible via the DOM.
  • Impersonation of users or administrators through session hijacking.
  • Unauthorized actions performed on behalf of victims (e.g., posting content, changing settings) using their authenticated session.
  • Defacement of content or injection of malicious links and phishing forms.
  • Lateral movement within the application by pivoting from compromised user accounts.

General mitigation guidance

Mitigation focuses on hardening how user-generated HTML is processed and rendered, and on constraining what TinyMCE can output:

  • Prefer a default-deny HTML policy on the server side: strip or neutralize all but a minimal set of safe tags and attributes, especially for rich-text content.
  • Apply robust server-side HTML sanitization that removes or encodes dangerous attributes, event handlers, and protocol schemes (e.g., javascript:), regardless of what the editor allows.
  • Treat all data-* and editor-specific attributes (such as data-mce-*) as untrusted; allow only whitelisted values and patterns.
  • Enforce context-appropriate output encoding when rendering stored content: ensure content meant as text is HTML-encoded and that attributes are properly escaped.
  • Use Content Security Policy (CSP) to reduce the impact of XSS by disallowing inline scripts and limiting script sources where feasible.
  • Apply the principle of least privilege in application roles so that high-risk content creation capabilities are not broadly granted.

How teams detect issues like this

Detection can combine code-level, configuration-level, and runtime monitoring approaches:

  • Static analysis and code review:
  • Identify application paths where TinyMCE content is stored and later rendered without passing through a sanitization layer.
  • Look for direct insertion of TinyMCE HTML into templates (e.g., rendering raw HTML strings) without encoding.
  • Review TinyMCE configuration to see if the media plugin is enabled and whether its output is trusted implicitly.
  • Content policy and sanitization checks:
  • Validate that sanitization libraries (e.g., HTML filters) are configured to handle data-* and editor-specific attributes, not just standard HTML attributes.
  • Enforce coding standards requiring explicit sanitization and encoding for all rich text fields.
  • Runtime and log-based detection:
  • Monitor for suspicious patterns in stored content, such as <script> tags, javascript: URLs, or anomalous data-mce-* values.
  • Use web application firewalls (WAFs) or RASP solutions configured with XSS detection rules to flag or block suspicious payloads.
  • Automated security tools (SAST/DAST) can be integrated into CI/CD pipelines to highlight unencoded output sinks and potential XSS vectors involving rich-text content.

Sources

SourceLink
github.comgithub.com/tinymce/tinymce/security/advisories/GHSA-vg35-5wq7-3x7w
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 content through the affected TinyMCE instance and have it rendered later can attempt exploitation, while the targets are other users (including administrators) who view that content in their browsers.

The attacker typically needs the same level of access as any user who can create or edit content using TinyMCE with the media plugin enabled—often an authenticated user in a CMS, blog, forum, or similar system.

Implement a robust, server-side HTML sanitization and encoding layer that all rich-text content must pass through before storage and before rendering, with a whitelist-based policy for allowed tags and attributes (including data-* attributes), independent of the editor's configuration.

Establish a standard secure output pipeline for all user-controlled HTML; enforce output encoding by default, apply strong sanitization for rich text, restrict editor capabilities to the minimum necessary, add CSP to limit script execution, and integrate XSS-focused checks into code review and automated security testing.

Find out what's already
exploitable in your codebase.