# CVE-2021-21254: Regular expression Denial of Service in Markdown plugin

> An attacker can cause a browser tab freeze in CKEditor 5 Markdown plugin via a regex denial of service attack.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 29 Jan 2021
- **Updated:** 3 Aug 2024
- **Also known as:** GHSA-hgmg-hhc8-g5wr

## What is CVE-2021-21254?

CVE-2021-21254 is a medium-severity denial of service vulnerability in ckeditor5, published on 29 Jan 2021. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

CKEditor 5 is an open source rich text editor framework with a modular architecture. The CKEditor 5 Markdown plugin (@ckeditor/ckeditor5-markdown-gfm) before version 25.0.0 has a regex denial of service (ReDoS) vulnerability. The vulnerability allowed to abuse link recognition regular expression, which could cause a significant performance drop resulting in browser tab freeze. It affects all users using CKEditor 5 Markdown plugin at version <= 24.0.0. The problem has been recognized and patched. The fix will be available in version 25.0.0.

Weakness: CWE-400 (Uncontrolled Resource Consumption)

## Which versions are affected by CVE-2021-21254?

2 open source packages ship an affected version, including @ckeditor/ckeditor5-markdown-gfm. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@ckeditor/ckeditor5-markdown-gfm` | npm | All versions | 25.0.0 |
| `@ckeditor/ckeditor5-markdown-gfm` | npm | All versions | 25.0.0 |

Products: Ckeditor Ckeditor5.

## How do I fix CVE-2021-21254?

Upgrade @ckeditor/ckeditor5-markdown-gfm to 25.0.0 or later.

## Is CVE-2021-21254 being exploited?

There is no known exploitation of CVE-2021-21254 in the wild and no public exploit code.

## Other vulnerabilities in ckeditor5

- [CVE-2026-28343](https://insights.sbomify.com/CVE-2026-28343/): CKEditor: Cross-site scripting (XSS) in the HTML Support package (medium 6.4)
- [CVE-2024-45613](https://insights.sbomify.com/CVE-2024-45613/): CKEditor 5 has Cross-site Scripting vulnerability in the clipboard package (medium 5.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-21254 and fix it if it is affected.

What it is: CVE-2021-21254 is a medium-severity denial of service vulnerability in ckeditor5, published on 29 Jan 2021. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2021-21254 in the wild and no public exploit code.

Affected packages and fixed versions:
- @ckeditor/ckeditor5-markdown-gfm (npm): affected all versions; fixed in 25.0.0
- @ckeditor/ckeditor5-markdown-gfm (npm): affected all versions; fixed in 25.0.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2021-21254/ (Markdown: https://insights.sbomify.com/CVE-2021-21254/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2021-21254
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2021-21254
- OSV: https://osv.dev/vulnerability/CVE-2021-21254

---
From sbomify Insights: https://insights.sbomify.com/CVE-2021-21254/
Summaries are generated and may contain mistakes; the official description above is the record.
