# TinyMCE codesample plugin regex denial of service

Source: https://junglewise.ai/threats/tinymce-codesample-plugin-regex-denial-of-service-ae7f4c47  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2021-01-06. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

Severity: info · CVSS 0 · Published 2021-01-06

TinyMCE is a widely-used rich-text editor component embedded in web applications. A regular expression denial of service (ReDoS) vulnerability in the codesample plugin can cause the browser to freeze when a user attempts to highlight poorly-formed Ruby code samples. An attacker could exploit this by crafting malicious Ruby code in a document to render the editor unresponsive and degrade user experience.

Technologies: [tinymce (npm)](https://junglewise.ai/threats/technologies/tinymce). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Informational severity, with a CVSS score of 0, published 6 January 2021.

**Which products and versions are affected?** tinymce (npm) SEMVER:introduced=0,fixed=5.6.0.

**Is there a fix for This vulnerability?** Yes. tinymce (npm): upgrade to 5.6.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked with local access, in a software library.

**Am I affected?** Check whether you run tinymce (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- tinymce (npm): upgrade to 5.6.0 or later

  ```sh
  npm install tinymce@5.6.0
  ```


## Technical details

A regex denial of service (ReDoS) vulnerability was discovered in a dependency of the codesample plugin, specifically in the syntax highlighter used for Ruby code samples. The vulnerability resides in the regex pattern matching logic used during syntax highlighting. Attack vector is local (user-initiated) with no authentication required—simply viewing or attempting to edit a document containing malformed Ruby code triggers the ReDoS condition. An attacker can craft poorly-formed Ruby code that causes the regex engine to perform excessive backtracking, freezing the browser and rendering the editor unusable. The vulnerability affects TinyMCE versions prior to 5.6.0 and was fixed in version 5.6.0 by upgrading the underlying syntax highlighting dependency. Workarounds include disabling the codesample plugin or upgrading to PrismJS 1.21.0 or higher.

## Affected products

- Tiny Technologies TinyMCE < 5.6.0

## Timeline

- 2021-01-06: disclosed

## References

- [https://github.com/tinymce/tinymce/security/advisories/GHSA-h96f-fc7c-9r55](https://github.com/tinymce/tinymce/security/advisories/GHSA-h96f-fc7c-9r55)
- [https://www.npmjs.com/package/tinymce](https://www.npmjs.com/package/tinymce)

## Related threats

- [TinyMCE media plugin stored cross-site scripting](https://junglewise.ai/threats/cve-2026-116675-tinymce-is-an-open-source-rich-text-editor-from-7-9-3-until-7-9)
- [PYSEC-2026-1301 - TinyMCE Cross-Site Scripting (XSS) vulnerability using noneditable_regexp option](https://junglewise.ai/threats/cve-2024-38356-tinymce-cross-site-scripting-in-noneditable-regexp)
- [PYSEC-2026-1302 - TinyMCE Cross-Site Scripting (XSS) vulnerability using noscript elements](https://junglewise.ai/threats/cve-2024-38357-tinymce-cross-site-scripting-in-noscript-element-parsing)
- [PYSEC-2026-632 - Cross-site scripting vulnerability in TinyMCE plugins](https://junglewise.ai/threats/cve-2024-21910-tinymce-cross-site-scripting-in-image-and-link-plugins)
- [Tiny Technologies TinyMCE stored XSS via forged mce:protected comments](https://junglewise.ai/threats/cve-2026-47762-tiny-technologies-tinymce-stored-xss-via-forged-mce-protected)
