Cross-site scripting vulnerability in TinyMCE
Summary
CVE-2024-21908: Cross-site scripting vulnerability in TinyMCE. Affects tinymce versions < 5.9.0. Fixed in 5.9.0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
TinyMCE is a popular open-source WYSIWYG editor used for creating rich text content in web applications. It provides a user-friendly interface for editing and formatting text, allowing users to easily create and manage content. However, a cross-site scripting (XSS) vulnerability has been discovered in TinyMCE version 5.8.2 and lower. This vulnerability allows an attacker to execute arbitrary JavaScript code by inserting specially crafted content into the editor. If this content is not properly sanitized on the server side, it can be published outside the editor and potentially harm users visiting the affected website.
Vulnerability Detail
The XSS vulnerability in TinyMCE is a result of a flaw in the schema validation logic of the core parser. When inserting content into the editor using the clipboard or editor APIs, the parser fails to properly validate the schema, allowing malicious JavaScript code to be executed. This can lead to various attacks, such as stealing sensitive user information, performing actions on behalf of the user, or injecting malicious content into the website. The vulnerability affects all users of TinyMCE version 5.8.2 and lower.
How To Fix
Latest published version: 8.10.0 as of 23 Oct 2026
npm install tinymce@8.10.0
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
5.9.0
This is the first release that contains the fix.
npm install tinymce@5.9.0
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If upgrading to the latest version of TinyMCE is not feasible, a workaround is to manually sanitize the content using the 'BeforeSetContent' event. This event allows developers to intercept the content before it is set in the editor and apply custom sanitization logic. Here is an example of how to implement the workaround:
editor.on('BeforeSetContent', function(e) {
var sanitizedContent = ...; // Manually sanitize content here
e.content = sanitizedContent;
});
Conclusion
The cross-site scripting vulnerability in TinyMCE version 5.8.2 and lower can be mitigated by upgrading to version 5.9.0 or higher. Alternatively, developers can implement a workaround by manually sanitizing the content using the 'BeforeSetContent' event. It is important to take action to fix this vulnerability to protect users from potential attacks. For further support on vulnerability remediation, you can contact DevNack.com.
See every vulnerability recorded for tinymce →
FAQ
The vulnerability allows an attacker to execute arbitrary JavaScript code in the context of the affected website. This can lead to various attacks, such as stealing user information or injecting malicious content.
All users of TinyMCE version 5.8.2 and lower are affected by this vulnerability.
You can check the version of TinyMCE used in your application by inspecting the package.json or package-lock.json file. Look for the 'tinymce' package and check the version number.
At the time of this advisory, there are no known public exploits for this vulnerability. However, it is important to patch the vulnerability as soon as possible to prevent potential attacks.
If upgrading to the latest version is not feasible, the recommended mitigation is to manually sanitize the content using the 'BeforeSetContent' event, as mentioned in the workaround section.
References
Related vulnerabilities
Recent vulnerabilities recorded for tinymce.