CVE-2021-21254: @ckeditor/ckeditor5 markdown gfm Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-hgmg-hhc8-g5wr
CVSS 6.5
CWE-400
Published
Advisory Summary

CVE-2021-21254 is a MODERATE (CVSS 6.5) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting @ckeditor/ckeditor5 markdown gfm libraries in the npm ecosystem. The issue involves ckeditor 5 markdown plugin regular expression denial of service. Remediation is available by upgrading affected packages to version 25.0.0.

CVE-2021-21254 at a Glance

CVE Identifier CVE-2021-21254
GHSA Identifier GHSA-hgmg-hhc8-g5wr
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product @ckeditor/ckeditor5 markdown gfm
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2021-21254

To remediate this vulnerability, upgrade all affected @ckeditor/ckeditor5 markdown gfm dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@ckeditor/ckeditor5-markdown-gfm fixed: 25.0.0
npm install @ckeditor/ckeditor5-markdown-gfm@25.0.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @ckeditor/ckeditor5-markdown-gfm

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2021-21254, inspect your project dependencies using npm:

npm ls @ckeditor/ckeditor5-markdown-gfm

Analyze the terminal output to locate any version of @ckeditor/ckeditor5 markdown gfm in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 25.0.0), your application is affected.

Note: The npm ls @ckeditor/ckeditor5-markdown-gfm command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In @ckeditor/ckeditor5 markdown gfm, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact A regular expression denial of service (ReDoS) vulnerability has been discovered in the CKEditor 5 Markdown plugin code. The vulnerability allowed to abuse a link recognition regular expression, which could cause a significant performance drop resulting in a browser tab freeze. It affects all users using the CKEditor 5 Markdown plugin at version <= 24.0.0. ### Patches The problem has been recognized and patched. The fix will be available in version 25.0.0. ### Workarounds The user can work around the issue by: - Upgrading CKEditor 5 to version 25.0.0. - Disabling the Markdown plugin. ### More information If you have any questions or comments about this advisory: * Email us at [security@cksource.com](mailto:security@cksource.com) ### Acknowledgements The CKEditor 5 team would like to thank Erik Krogh Kristensen from the GitHub team for recognizing this vulnerability and Alvaro Muñoz from GitHub for reporting it.

CVE-2021-21254 Affected @ckeditor/ckeditor5 markdown gfm Versions

1 component(s)
Fixed Versions:
25.0.0
Product / Package Ecosystem Affected Versions Fixed Version
@ckeditor/ckeditor5-markdown-gfm
npm
< 25.0.0
25.0.0

References

Frequently Asked Questions

What is CVE-2021-21254?
CVE-2021-21254 is a security vulnerability in @ckeditor/ckeditor5 markdown gfm involving CKEditor 5 Markdown plugin Regular expression Denial of Service under CWE-400: Uncontrolled Resource Consumption.
Which @ckeditor/ckeditor5 markdown gfm versions are affected?
Affected versions include releases prior to 25.0.0 across affected packages: @ckeditor/ckeditor5-markdown-gfm.
What version fixes CVE-2021-21254?
Upgrading to 25.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @ckeditor/ckeditor5-markdown-gfm affected?
Yes, @ckeditor/ckeditor5-markdown-gfm is affected in releases prior to 25.0.0. Upgrade your dependency to 25.0.0 or later.
What is the CVSS score of CVE-2021-21254?
CVE-2021-21254 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2021-21254?
CVE-2021-21254 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for CVE-2021-21254?
Run the dependency tree command: 'npm ls @ckeditor/ckeditor5-markdown-gfm'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hgmg-hhc8-g5wr",
  "modified" : "2022-08-11T18:16:15Z",
  "published" : "2021-01-29T21:51:22Z",
  "aliases" : [ "CVE-2021-21254" ],
  "summary" : "CKEditor 5 Markdown plugin Regular expression Denial of Service",
  "details" : "### Impact\nA regular expression denial of service (ReDoS) vulnerability has been discovered in the CKEditor 5 Markdown plugin code. The vulnerability allowed to abuse a link recognition regular expression, which could cause a significant performance drop resulting in a browser tab freeze. It affects all users using the CKEditor 5 Markdown plugin at version <= 24.0.0. \n\n### Patches\nThe problem has been recognized and patched. The fix will be available in version 25.0.0.\n\n### Workarounds\nThe user can work around the issue by:\n- Upgrading CKEditor 5 to version 25.0.0.\n- Disabling the Markdown plugin.\n\n### More information\nIf you have any questions or comments about this advisory:\n* Email us at [security@cksource.com](mailto:security@cksource.com)\n\n### Acknowledgements\nThe CKEditor 5 team would like to thank Erik Krogh Kristensen from the GitHub team for recognizing this vulnerability and \nAlvaro Muñoz from GitHub for reporting it.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@ckeditor/ckeditor5-markdown-gfm"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "25.0.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 24.0.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ckeditor/ckeditor5/security/advisories/GHSA-hgmg-hhc8-g5wr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-21254"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ckeditor/ckeditor5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ckeditor/ckeditor5/releases/tag/v25.0.0"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/@ckeditor/ckeditor5-markdown-gfm"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-01-29T21:50:43Z",
    "nvd_published_at" : "2021-01-29T22:15:00Z"
  }
}