Cross-site scripting vulnerability in TinyMCE

tinymce Updated 02 Oct 2025

Summary

22/10/2021
Yes i
Moderate
6.1

CVE-2024-21908: Cross-site scripting vulnerability in TinyMCE. Affects tinymce versions < 5.9.0. Fixed in 5.9.0. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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 →

Share this vulnerability

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.

Related vulnerabilities

Recent vulnerabilities recorded for tinymce.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback