SB2026081579 - Multiple vulnerabilities in Natural Language Toolkit



SB2026081579 - Multiple vulnerabilities in Natural Language Toolkit

Published: August 15, 2026

Security Bulletin ID SB2026081579
CSH Severity
Medium
Patch available
YES
Number of vulnerabilities 10
Exploitation vector Remote access
Highest impact Code execution

Breakdown by Severity

High 10% Medium 60% Low 30%
  • Low
  • Medium
  • High
  • Critical

Description

This security bulletin contains information about 10 vulnerabilities.


1) Untrusted search path (CVE-ID: N/A)

CWE-ID: CWE-426 - Untrusted Search Path

CVSSv4: 8.5 [CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]


The vulnerability allows a local user to execute arbitrary code.

The vulnerability exists due to an untrusted search path in the Graphviz \'dot\' binary invocation in nltk.parse.dependencygraph.dot2img and nltk.translate.api.AlignedSent._repr_svg_ when invoking the Graphviz program by bare name. A local user can place a crafted file named dot in a searched location to execute arbitrary code.

On Windows, resolution may include the current working directory.


2) XML Entity Expansion (CVE-ID: N/A)

CWE-ID: CWE-776 - Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')

CVSSv4: 8.7 [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]


The vulnerability allows a remote attacker to cause a denial of service.

The vulnerability exists due to improper restriction of recursive entity references in DTDs in xml.etree.ElementTree parsing sites within NLTK when parsing crafted XML documents containing internal entity declarations. A remote attacker can supply a specially crafted XML document to cause a denial of service.

External entities are not resolved, so the issue is limited to memory amplification during XML parsing rather than file disclosure.


3) Deserialization of Untrusted Data (CVE-ID: N/A)

CWE-ID: CWE-502 - Deserialization of Untrusted Data

CVSSv4: 9.3 [CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]


The vulnerability allows a remote attacker to execute arbitrary code.

The vulnerability exists due to deserialization of untrusted data in nltk.picklesec.allowlisted_pickle_load, nltk.tokenize.punkt.punkt_pickle_load, and nltk.parse.transitionparser.TransitionParser.parse when loading attacker-controlled model or tokenizer artifacts. A remote attacker can supply a crafted pickle payload to execute arbitrary code.

The issue stems from allowlists that trust whole module namespaces, enabling dangerous in-namespace callables to be reached through pickle REDUCE during unpickling.


4) External Control of File Name or Path (CVE-ID: N/A)

CWE-ID: CWE-73 - External Control of File Name or Path

CVSSv4: 8.7 [CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N]


The vulnerability allows a remote attacker to disclose sensitive information outside the intended sandbox.

The vulnerability exists due to external control of file name or path in nltk.corpus.reader constructors when processing a caller-supplied corpus root path. A remote attacker can supply a crafted corpus root path to disclose sensitive information outside the intended sandbox.

The issue affects LinThesaurusCorpusReader and PanLexLiteCorpusReader, and the demonstrated reads include a local text file and a local SQLite database even with sandbox enforcement enabled.


5) Improper Neutralization of Argument Delimiters in a Command (CVE-ID: N/A)

CWE-ID: CWE-88 - Argument Injection or Modification

CVSSv4: 8.7 [CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]


The vulnerability allows a remote user to execute arbitrary code.

The vulnerability exists due to argument injection in the java() function and Stanford wrapper classes when processing user-supplied java_options. A remote user can supply crafted JVM options to execute arbitrary code.

This affects deployments where java_options is derived from user input, configuration files, or environment variables.


6) Link following (CVE-ID: N/A)

CWE-ID: CWE-59 - Improper Link Resolution Before File Access ('Link Following')

CVSSv4: 8.2 [CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N]


The vulnerability allows a remote attacker to disclose sensitive information.

The vulnerability exists due to improper link resolution before file access in nltk.corpus.reader.ipipan, nltk.corpus.reader.crubadan, and nltk.corpus.reader.lin when processing attacker-influenced corpora under a trusted data root. A remote attacker can place a symlink inside the trusted corpus root that points to an external file and invoke normal corpus reader methods to disclose sensitive information.

Exploitation requires the application to process attacker-influenced corpora inside a trusted NLTK data root or trusted corpus directory with pathsec enforcement enabled.


7) Uncontrolled Recursion (CVE-ID: N/A)

CWE-ID: CWE-674 - Uncontrolled Recursion

CVSSv4: 6.9 [CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N]


The vulnerability allows a remote attacker to cause a denial of service.

The vulnerability exists due to uncontrolled recursion in nltk.featstruct.FeatStructReader when parsing deeply nested feature-structure or feature-grammar input. A remote attacker can send a specially crafted nested input to cause a denial of service.

The issue is reachable through both FeatStruct(str) and FeatureGrammar.fromstring() when applications parse externally supplied text.


8) Inefficient regular expression complexity (CVE-ID: N/A)

CWE-ID: CWE-1333 - Inefficient Regular Expression Complexity

CVSSv4: 8.2 [CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N]


The vulnerability allows a remote attacker to cause a denial of service.

The vulnerability exists due to inefficient regular expression complexity in the nltk tgrep module _tgrep_node_action() function when processing user-supplied regular expressions in /regex/ nodes. A remote attacker can send a specially crafted tgrep pattern to cause a denial of service.

Applications are affected when they expose the tgrep API to external input, including via tgrep_positions() or tgrep_compile().


9) Inefficient regular expression complexity (CVE-ID: N/A)

CWE-ID: CWE-1333 - Inefficient Regular Expression Complexity

CVSSv4: 6.3 [CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N]


The vulnerability allows a remote attacker to cause a denial of service.

The vulnerability exists due to inefficient regular expression complexity in nltk.corpus.reader.pl196x.TEICorpusView.read_block and Pl196xCorpusReader public methods when parsing attacker-influenced PL196X or TEI-like corpus files. A remote attacker can supply a malformed file with many opening tags and no matching closing tags to cause a denial of service.

The issue is triggered by repeated rescans of whole <text> blocks, leading to quadratic CPU growth and parser-thread stalling before the input is rejected.


10) Link following (CVE-ID: N/A)

CWE-ID: CWE-59 - Improper Link Resolution Before File Access ('Link Following')

CVSSv4: 6.9 [CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N]


The vulnerability allows a local user to overwrite files outside the intended install root.

The vulnerability exists due to improper link resolution before file access in nltk.downloader.Downloader.download and nltk.downloader.Downloader.incr_download when installing a package into a downloader root containing a pre-existing hardlink. A local user can place a hardlink inside a writable shared downloader directory so that package extraction writes through it to overwrite files outside the intended install root.

Exploitation requires a writable shared downloader root on the same filesystem as the target file.


Remediation

Install update from vendor's website.