{"id":"CVE-2022-21680","aliases":["CVE-2022-21680","GHSA-rrrm-qjm4-v8hf"],"related":[],"kind":"vulnerability","state":"published","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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\n\n_What kind of vulnerability is it?_\n\nDenial of service.\n\nThe regular expression `block.def` may cause catastrophic backtracking against some strings.\nPoC is the following.\n\n```javascript\nimport * as marked from \"marked\";\n\nmarked.parse(`[x]:${' '.repeat(1500)}x ${' '.repeat(1500)} x`);\n```\n\n_Who is impacted?_\n\nAnyone who runs untrusted markdown through marked and does not use a worker with a time limit.\n\n### Patches\n\n_Has the problem been patched?_\n\nYes\n\n_What versions should users upgrade to?_\n\n4.0.10\n\n### Workarounds\n\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\nDo not run untrusted markdown through marked or run marked on a [worker](https://marked.js.org/using_advanced#workers) thread and set a reasonable time limit to prevent draining resources.\n\n### References\n\n_Are there any links users can visit to find out more?_\n\n- https://marked.js.org/using_advanced#workers\n- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n* Open an issue in [marked](https://github.com/markedjs/marked)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Marked es un analizador y compilador de markdown. En versiones anteriores a 4.0.10, la expresión regular \"block.def\" podía causar un retroceso catastrófico contra algunas cadenas y conllevar a una denegación de servicio por expresión regular (ReDoS). Cualquiera que ejecute markdown no confiable mediante una versión vulnerable de marked y no use un trabajador con límite de tiempo puede verse afectado. Este problema está parcheado en la versión 4.0.10. Como medida de mitigación, evite ejecutar markdown no confiable mediante marked o ejecute marked en un hilo de trabajo y establezca un límite de tiempo razonable para evitar el agotamiento de los recursos","source":"nvd"}],"published":"2022-01-14T00:00:00.000Z","modified":"2026-09-10T03:49:11.241Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:N/I:N/A:P","score":5,"rating":"MEDIUM"}],"cwes":["CWE-400","CWE-1333"],"affected":[{"ranges":[{"version":"< 4.0.10","status":"affected"}],"vendor":"markedjs","product":"marked","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"4.0.10"}],"ecosystem":"npm","package":"marked","purl":"pkg:npm/marked","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"4.0.10"}],"vendor":"marked_project","product":"marked","cpe":"cpe:2.3:a:marked_project:marked:*:*:*:*:*:node.js:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"36"}],"vendor":"fedoraproject","product":"fedora","cpe":"cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/markedjs/marked/security/advisories/GHSA-rrrm-qjm4-v8hf","tags":["exploit","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/markedjs/marked/commit/c4a3ccd344b6929afa8a1d50ac54a721e57012c0","tags":["patch","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/markedjs/marked/releases/tag/v4.0.10","tags":["release-notes","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AIXDMC3CSHYW3YWVSQOXAWLUYQHAO5UX/","tags":["vendor-advisory","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-21680","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/markedjs/marked","tags":["package"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AIXDMC3CSHYW3YWVSQOXAWLUYQHAO5UX","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2025-04-22T15:42:24.798Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-21680","url":"https://www.cve.org/CVERecord?id=CVE-2022-21680","licence":"CVE Terms of Use","modified":"2025-04-22T18:33:37.402Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-rrrm-qjm4-v8hf","url":"https://github.com/advisories/GHSA-rrrm-qjm4-v8hf","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:11.241Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-21680","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-21680","licence":"Public domain","modified":"2026-06-17T04:26:44.973Z"}],"updatedAt":"2026-11-25T22:58:09.247Z","epss":{"score":0.02983,"percentile":0.87655,"date":"2026-12-01T12:00:22.000Z"}}