Skip to content
Heist/ feed
Back to feed
High

Cubic catastrophic backtracking (ReDoS) in marked

Type: advisorySources: OSV

Marked is a markdown parser and compiler. Prior to version 4.0.10, the regular expression `block.def` may cause catastrophic backtracking against some strings and lead to a regular expression denial of service (ReDoS). Anyone who runs untrusted markdown through a vulnerable version of marked and does not use a worker with a time limit may be affected. This issue is patched in version 4.0.10. As a workaround, avoid running untrusted markdown through marked or run marked on a worker thread and set a reasonable time limit to prevent draining resources.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2022-21680
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 15:54 UTC · Revision 1

Source evidence

Cubic catastrophic backtracking (ReDoS) in marked

core-osv · Original source

Published 14 Jan 2022, 00:00 UTC

Marked is a markdown parser and compiler. Prior to version 4.0.10, the regular expression `block.def` may cause catastrophic backtracking against some strings and lead to a regular expression denial of service (ReDoS). Anyone who runs untrusted markdown through a vulnerable version of marked and does not use a worker with a time limit may be affected. This issue is patched in version 4.0.10. As a workaround, avoid running untrusted markdown through marked or run marked on a worker thread and set a reasonable time limit to prevent draining resources.

osv:CVE-2022-21680
Complete source record
{
  "id": "ca67a0a036fe2bb8414ef11381f64cad7ae2f0bb312c397eb3aa231104da0614",
  "url": "https://osv.dev/vulnerability/CVE-2022-21680",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Cubic catastrophic backtracking (ReDoS) in marked",
    "summary": "Marked is a markdown parser and compiler. Prior to version 4.0.10, the regular expression `block.def` may cause catastrophic backtracking against some strings and lead to a regular expression denial of service (ReDoS). Anyone who runs untrusted markdown through a vulnerable version of marked and does not use a worker with a time limit may be affected. This issue is patched in version 4.0.10. As a workaround, avoid running untrusted markdown through marked or run marked on a worker thread and set a reasonable time limit to prevent draining resources.",
    "evidence": "osv:CVE-2022-21680",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2022-21680",
      "aliases": [
        "CVE-2022-21680",
        "GHSA-rrrm-qjm4-v8hf"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/markedjs/marked",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "ae01170085e89ccd85c233547011eb88420a90cf"
                },
                {
                  "fixed": "c4a3ccd344b6929afa8a1d50ac54a721e57012c0"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:marked_project:marked:*:*:*:*:*:node.js:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "4.0.10"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "c4a3ccd344b6929afa8a1d50ac54a721e57012c0"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "ae01170085e89ccd85c233547011eb88420a90cf"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "v4.0.10"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v4.0.9",
            "v4.0.8",
            "v4.0.7",
            "v4.0.6",
            "v4.0.5",
            "v4.0.4",
            "v4.0.3",
            "v4.0.2",
            "v4.0.1",
            "v4.0.0",
            "v3.0.8",
            "v3.0.7",
            "v3.0.6",
            "v3.0.5",
            "v3.0.4",
            "v3.0.3",
            "v3.0.2",
            "v3.0.1",
            "v3.0.0",
            "v2.1.3",
            "v2.1.2",
            "v2.1.1",
            "v2.1.0",
            "v2.0.7",
            "v2.0.6",
            "v2.0.5",
            "v2.0.4",
            "v2.0.3",
            "v2.0.2",
            "v2.0.1",
            "v2.0.0",
            "v1.2.9",
            "v1.2.8",
            "v1.2.7",
            "v1.2.6",
            "v1.2.5",
            "v1.2.4",
            "v1.2.3",
            "v1.2.2",
            "v1.2.1",
            "v1.1.2",
            "v1.20",
            "v1.1.1",
            "v1.1.0",
            "v1.0.0",
            "v0.8.2",
            "v0.8.1",
            "v0.8.0",
            "v0.7.0",
            "v0.6.3",
            "v0.6.2",
            "v0.6.1",
            "v0.6.0",
            "v0.5.2",
            "v0.5.1",
            "v0.5.0",
            "0.4.0",
            "v0.3.19",
            "v0.3.18",
            "v0.3.17",
            "0.3.15",
            "0.3.14",
            "v0.3.12",
            "0.3.9",
            "v0.3.7",
            "v0.3.6",
            "v0.3.5",
            "v0.3.4",
            "v0.3.3",
            "v0.3.2",
            "v0.3.1",
            "v0.3.0",
            "v0.2.10",
            "v0.2.9",
            "v0.2.8",
            "v0.2.7",
            "v0.2.6",
            "v0.2.5",
            "v0.2.4",
            "v0.2.3",
            "v0.2.2",
            "v0.2.1",
            "v0.2.0",
            "v0.1.9",
            "v0.1.8",
            "v0.1.7",
            "v0.1.6",
            "v0.1.5",
            "v0.1.4",
            "v0.1.3",
            "v0.1.2",
            "v0.1.1",
            "v0.1.0",
            "v0.0.9",
            "v0.0.8",
            "v0.0.7",
            "v0.0.6",
            "v0.0.5",
            "v0.0.4",
            "v0.0.3",
            "v0.0.2",
            "v0.0.1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-21680.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:30.323214121Z",
      "provider": "osv",
      "references": [
        "https://github.com/markedjs/marked/releases/tag/v4.0.10",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/21xxx/CVE-2022-21680.json",
        "https://github.com/markedjs/marked/security/advisories/GHSA-rrrm-qjm4-v8hf",
        "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AIXDMC3CSHYW3YWVSQOXAWLUYQHAO5UX/",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-21680",
        "https://github.com/markedjs/marked/commit/c4a3ccd344b6929afa8a1d50ac54a721e57012c0"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-1333",
          "CWE-400"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/21xxx/CVE-2022-21680.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-21680",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 497042,
  "published_at": "2022-01-14T00:00:00+00:00"
}