{"id":2299,"cve":"CVE-2026-80206","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2026-80206\/","cwe":"CWE-1333","cwe_number":1333,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/1333","cvss_score":8.2,"published":"2026-08-26","owasp":"A04 Insecure Design","odc":"Timing\/Serialization","cdc":"Timing Issues","category":"Input Validation and Sanitization","subcategory":"Insecure Parsing or Deserialization","scope":"Remote","impact":"Denial of Service (DoS)","summary":"NLTK 3.10.3 tgrep module allows ReDoS via unvalidated regex in _tgrep_node_action.","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2026-80206\/","description":"NLTK before 3.10.3 contains a regular expression denial of service (ReDoS) vulnerability in the tgrep module. The _tgrep_node_action function compiles user-supplied regular expressions embedded in \/regex\/ pattern nodes and executes them via re.search against tree node labels without any validation or timeout. An attacker who controls the tgrep pattern (e.g., via tgrep_positions() or tgrep_compile() exposed to external input) can supply a pattern that triggers catastrophic backtracking, causing indefinite CPU saturation that blocks the Python process.","solution":"Upgrade NLTK to version\u202f3.10.3\u202for later.","affected_component":"NLTK","fixed_by_upgrading":true,"vulnerable_code":"import re\nfrom nltk.tree import Tree\nfrom nltk.tgrep import tgrep_positions\n\ndef find_matching_nodes(tree: Tree, pattern: str):\n    \"\"\"\n    Search tree nodes whose labels match a user\u2011supplied regular expression\n    embedded in a tgrep pattern.\n    \"\"\"\n    # VULNERABLE: compiles and searches user\u2011controlled regex without limits\n    compiled = re.compile(pattern)\n    matches = []\n    for node, _ in tgrep_positions(tree, f\"\/{pattern}\/\"):\n        if compiled.search(node.label()):\n            matches.append(node)\n    return matches\n","patched_code":"import re\nimport regex\nfrom nltk.tree import Tree\nfrom nltk.tgrep import tgrep_positions\n\ndef find_matching_nodes(tree: Tree, pattern: str):\n    \"\"\"\n    Search tree nodes whose labels match a user\u2011supplied regular expression\n    embedded in a tgrep pattern, with a safe timeout.\n    \"\"\"\n    # FIX: use regex module with a timeout to bound backtracking\n    compiled = regex.compile(pattern, timeout=0.1)\n    matches = []\n    for node, _ in tgrep_positions(tree, f\"\/{pattern}\/\"):\n        if compiled.search(node.label()):\n            matches.append(node)\n    return matches\n","payload_needed":true,"payload":null,"payload_status":"model_refused","published_fix":[{"repository":"nltk\/nltk","commit_url":"https:\/\/github.com\/nltk\/nltk\/commit\/0072ea2fb8be22e038a36e887b7061bb6b9339d9","commit_subject":"Add wall-clock ReDoS backstop for caller-supplied regex\/tag patterns","units":[{"file":"nltk\/chunk\/regexp.py","function":null},{"file":"nltk\/chunk\/regexp.py","function":"ChunkString.xform"},{"file":"nltk\/chunk\/regexp.py","function":"RegexpChunkRule.__init__"},{"file":"nltk\/tag\/sequential.py","function":null},{"file":"nltk\/tag\/sequential.py","function":"RegexpTagger.choose_tag"},{"file":"nltk\/tag\/sequential.py","function":"RegexpTagger.__init__"},{"file":"nltk\/text.py","function":null},{"file":"nltk\/tgrep.py","function":null},{"file":"nltk\/tgrep.py","function":"_tgrep_node_action"},{"file":"nltk\/tokenize\/regexp.py","function":null},{"file":"nltk\/tokenize\/regexp.py","function":"RegexpTokenizer.span_tokenize"},{"file":"nltk\/tokenize\/regexp.py","function":"RegexpTokenizer._check_regexp"},{"file":"nltk\/tokenize\/util.py","function":null},{"file":"nltk\/tokenize\/util.py","function":"regexp_span_tokenize"}]}],"references":null}