Cross-site scripting vulnerability in TinyMCE

tinymce Updated 02 Oct 2025

Summary

28/05/2021
MODERATE
Yes i
Moderate
Not published

GHSA-5vm8-hhgr-jcjp: Cross-site scripting vulnerability in TinyMCE. Affects tinymce versions < 5.7.1. Fixed in 5.7.1. 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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

TinyMCE is a popular open-source WYSIWYG editor that allows users to easily create and edit content on websites. It provides a rich set of features for formatting text, inserting media, and managing content. However, a cross-site scripting (XSS) vulnerability has been discovered in TinyMCE version 5.7.0 and lower. This vulnerability allows an attacker to execute arbitrary JavaScript code when a specially crafted piece of content is inserted into the editor and then previewed or rendered outside of the editor.

Vulnerability Detail

The XSS vulnerability in TinyMCE is due to a flaw in the URL sanitization logic of the core parser for form elements. When a form element with a malicious URL attribute is inserted into the editor, the URL is not properly sanitized, allowing the execution of arbitrary JavaScript code. This can lead to various security risks, such as stealing user credentials, performing actions on behalf of the user, or defacing the website. The vulnerability has been patched in TinyMCE version 5.7.1 by improving the URL sanitization logic.

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.7.1

This is the first release that contains the fix.

npm install tinymce@5.7.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading or manual sanitization is not possible, another workaround is to disable form elements in the content using the 'invalid_elements' setting in TinyMCE configuration. By specifying 'form' as an invalid element, any form elements present in the content will be removed or ignored. This can help mitigate the risk of the XSS vulnerability, but it may also affect the functionality of the editor if form elements are required.

Conclusion

The cross-site scripting vulnerability in TinyMCE version 5.7.0 and lower can be mitigated by upgrading to version 5.7.1 or higher. Alternatively, manual sanitization of form URL attributes using a node filter or disabling form elements in the content can also help mitigate the risk. It is important to take action to protect your website and users from potential attacks. If you have any further questions or need assistance with vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tinymce →

Share this vulnerability

FAQ

The vulnerability allows an attacker to execute arbitrary JavaScript code when a specially crafted piece of content is inserted into TinyMCE and then previewed or rendered outside of the editor. This can lead to various security risks, such as stealing user credentials or performing actions on behalf of the user.

The vulnerability affects TinyMCE version 5.7.0 and lower. Users of these versions are advised to upgrade to version 5.7.1 or higher to mitigate the vulnerability.

To manually sanitize form URL attributes, you can use a TinyMCE node filter. This involves iterating through the form elements, sanitizing the URL attribute values, and updating the attributes accordingly. An example code snippet for sanitizing using a node filter is provided in the vulnerability details.

Yes, you can disable form elements in TinyMCE by using the 'invalid_elements' setting in the TinyMCE configuration. By specifying 'form' as an invalid element, any form elements present in the content will be removed or ignored.

The vulnerability was discovered by Mikhail Khramenkov at Solar Security Research Team. They reported the vulnerability to Tiny Technologies, who promptly patched the issue in TinyMCE version 5.7.1.

References

Related vulnerabilities

Recent vulnerabilities recorded for tinymce.

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.7.1

This is the first release that contains the fix.

npm install tinymce@5.7.1

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