{"id":2977,"cve":"CVE-2026-128139","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2026-128139\/","cwe":"CWE-400","cwe_number":400,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/400","cvss_score":7.5,"published":"2026-11-19","owasp":"A06 Vulnerable and Outdated Components","odc":"Timing\/Serialization","cdc":"Timing Issues","category":"Resource Management","subcategory":"Resource Exhaustion","scope":"Local","impact":"Denial of Service (DoS)","summary":"Quadratic CPU DoS in NLTK XMLCorpusView via large comments\/CDATA.","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2026-128139\/","description":"NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Processing. From 3.6 to 3.10.3, XMLCorpusView._read_xml_fragment accumulates 1 KiB blocks and repeatedly applies whole-buffer XML validation while a comment or CDATA terminator remains ahead. A large comment in an attacker-controlled corpus file causes quadratic CPU consumption through documented XML corpus readers across the affected range. On 3.6 and 3.9.2, a large CDATA section incurs the quadratic scan before rejection, while on 3.10.3 both comment and CDATA documents are read successfully. This vulnerability is fixed in 3.10.4.","solution":"Upgrade NLTK to version\u202f3.10.4\u202for newer.","affected_component":"Python","fixed_by_upgrading":true,"vulnerable_code":"import nltk\nfrom nltk.corpus.reader import XMLCorpusReader\n\ndef load_corpus(path):\n    # VULNERABLE: quadratic XML validation on large comments\/CDATA\n    reader = XMLCorpusReader(path, r'.*\\.xml')\n    return list(reader.xml())  # triggers XMLCorpusView._read_xml_fragment\n","patched_code":"import nltk\nfrom nltk.corpus.reader import XMLCorpusReader\n\ndef load_corpus(path):\n    # FIX: limit block size to avoid repeated whole\u2011buffer validation\n    reader = XMLCorpusReader(path, r'.*\\.xml', block_size=8192)\n    return list(reader.xml())\n","payload_needed":true,"payload":null,"payload_status":"model_refused","published_fix":[{"repository":"nltk\/nltk","commit_url":"https:\/\/github.com\/nltk\/nltk\/commit\/9cacbb95d97eaac7debb30d6e7decbe74d2c635f","commit_subject":"Make the CoNLL SRL, TIMIT and XML view readers linear in their input","units":[{"file":"nltk\/corpus\/reader\/conll.py","function":"ConllCorpusReader._get_srl_instances"},{"file":"nltk\/corpus\/reader\/timit.py","function":"TimitCorpusReader.phone_trees"},{"file":"nltk\/corpus\/reader\/xmldocs.py","function":null},{"file":"nltk\/corpus\/reader\/xmldocs.py","function":"XMLCorpusView._read_xml_fragment"}]}],"references":null}