unstale

pypi / nltk

nltk

What changed in nltk 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

27 breaking101 security7 new APIs and options7 performance3 behavior and defaults16 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

nltk 3161 changes

Breaking changes 27

  • Unaligned NULL-target pairs are omitted from Alignment strings; alignments with unaligned pairs can be shown, ranged, and drawn on every surface.

    3.10.4release notes

  • Alignment strings now omit NULL targets.

    3.10.4release notes

  • Parsing now runs in linear time and refuses oversized categories, mitigating denial-of-service attacks.

    3.10.4release notessecurity advisory

  • The Java wrapper accepts a main class as its first argument, rejects launcher switches, argfiles, and source files, validates options, and restricts jar locations.

    3.10.4release notes

  • Placeholder labels are treated as missing data when calculating Krippendorff's alpha.

    3.10.4release notes

  • Set this environment variable to 1 to assert that a proxy used for URL fetching is trusted.

    3.10.4release notes

  • Pickle format loads reconstruct plain data only and refuse pickles naming classes or functions; URL fetches are also subject to network restrictions.

    3.10.4release notes

  • Resources and model save destinations are restricted to trusted data roots; unsafe roots are skipped with a warning. Keep private data in a private directory and add it to nltk.data.path.

    3.10.4release notessecurity advisory

  • URL fetching refuses non-global addresses, pins the validated address, restricts file URLs, and refuses proxied fetches unless explicitly trusted.

    3.10.4release notes

  • Provides the default five-second timeout for regular-expression matching; matches exceeding it raise TimeoutError.

    3.10.4release notes

  • Library terminal output renders control characters, escape sequences, and unbalanced bidi overrides as visible escapes to prevent terminal injection.

    3.10.4release notes

  • The wheel no longer includes nltk.test.unit; it remains available from a source checkout or sdist.

    3.10.4release notes

  • XML parsing rejects entity declarations and external references and limits tree depth; oversized or deeply nested input raises ValueError.

    3.10.4release notes

  • Model files are created exclusively under the pinned directory.

    3.10.4release notes

  • Walks deeper than MAX_RECURSION_DEPTH are refused instead of being silently truncated.

    3.10.4release notessecurity advisory

  • The ZWJ pattern no longer captures whitespace, and repeated shapes are handled linearly.

    3.10.4release notes

  • Per-call java() options are validated, and the -XX:/-D allowlist is replaced with a minimal one.

    3.10.3release notessecurity advisory

  • Stanford JAR execution is sandboxed to nltk_data directories.

    3.10.3release notes

  • inisec.py was removed; the notes point developers to PYTHONSAFEPATH instead.

    3.10.2release notes

  • Hardens downloads against XML entity expansion, concurrent download races, path traversal, unsafe ZIP extraction, symlink attacks, decompression bombs, and arbitrary file writes; enables ENFORCE by default.

    3.10.0release notes

  • Rejects binaries resolved relative to the current working directory.

    3.10.0release notes

  • Hardens path containment and ZIP extraction against symlinks, path traversal, validation/extraction mismatches, and unsafe path operations; restricts primitive types accepted by wrappers.

    3.10.0release notes

  • Bounds the default max_phrase_length to prevent cubic denial of service.

    3.10.0release notes

  • Returns None when multiple languages tie for the highest score.

    3.10.0release notes

  • Aligns behavior with Brants (2000) specifications.

    3.10.0release notes

  • The JAR is no longer loaded from the current working directory.

    3.10.0release notes

  • Requires a session token to shut down the WordNet Browser.

    3.10.0release notes

Security 101

  • java() now guards cmd[0] against JEP 330 source-file execution.

    3.10.4release notes

  • Natural Language Toolkit (NLTK): Uncontrolled recursion (crash DoS) in DependencyGraph.tree()/triples()

    3.10.4security advisory

  • Natural Language Toolkit (NLTK): Uncontrolled recursion (crash DoS) in Synset.tree()/acyclic_tree() via WordNet relation traversal

    3.10.4security advisory

  • NLTK: AllowlistUnpickler does not deny numpy submodule-local file-I/O sinks

    3.10.4security advisory

  • NLTK: ARFF_Formatter Injects Weka ARFF Schema Directives via Attacker-Controlled Class Labels

    3.10.4security advisory

  • NLTK: BllipParser passes caller-supplied model paths to the bllipparser C extension with no pathsec check, enabling arbitrary read

    3.10.4security advisory

  • NLTK corpus-reader view methods bypass the scoped root sandbox via intermediate-directory symlinks

    3.10.4security advisory

  • NLTK dot2img runs Graphviz 'dot' without the trusted-exec chokepoint, enabling local code execution via a writable PATH element

    3.10.4security advisory

  • NLTK: Downloader cyclic collection indices cause an infinite closure walk

    3.10.4security advisory

  • NLTK incomplete fix: additional JVM/JAR sandbox bypass through unvalidated launcher tokens in java() command arguments

    3.10.4security advisory

  • NLTK: Path Traversal in save_maxent_params / load_maxent_params Allow Arbitrary File READ/WRITE

    3.10.4security advisory

  • NLTK: Quadratic CPU exhaustion in LegalitySyllableTokenizer.tokenize via unguarded onset reversal loop

    3.10.4security advisory

  • NLTK: Quadratic CPU exhaustion in NLTK XMLCorpusView.read_block via deeply nested XML corpus tags

    3.10.4security advisory

  • NLTK: Quadratic CPU exhaustion in TreebankWordTokenizer.span_tokenize via list.pop(0) in quote-restore loop

    3.10.4security advisory

  • NLTK: Quadratic-time CPU denial of service in ConllCorpusReader SRL instance builder via nested span rescan

    3.10.4security advisory

  • NLTK: Quadratic-time CPU denial of service in Tree.chomsky_normal_form right-factor binarization via list.pop(0)

    3.10.4security advisory

  • NLTK: Quadratic-time DoS in SeekableUnicodeStreamReader.readline on an unterminated corpus line via per-iteration full-buffer rescan

    3.10.4security advisory

  • NLTK: StreamBackedCorpusView constructor os.stat leaks out-of-root file existence, size, and mtime bypassing pathsec ENFORCE

    3.10.4security advisory

  • NLTK: Symlink escape in chat80.sql_query bypasses the pathsec data-root sandbox to read out-of-root SQLite databases

    3.10.4security advisory

  • NLTK: Symlink escape in YCOECorpusReader lets a psd/pos directory symlink read files outside the corpus root within the data sandbox

    3.10.4security advisory

  • NLTK: Unbounded CPU consumption in SteppingRecursiveDescentParser.parse() with ambiguous or self-embedding grammars

    3.10.4security advisory

  • NLTK: Uncontrolled recursion in CCG lexicon parser causes denial of service via deeply nested category input

    3.10.4security advisory

  • NLTK: Uncontrolled recursion in DependencyGraph traversal causes denial of service via deep dependency chains

    3.10.4security advisory

  • NLTK: Uncontrolled recursion in semantic-logic type parser causes denial of service via nested type strings

    3.10.4security advisory

  • NLTK: Uncontrolled recursion in Toolbox settings helpers causes denial of service via deeply nested input

    3.10.4security advisory

  • NLTK: Uncontrolled recursion in Tree.fromlist causes denial of service via deeply nested list input

    3.10.4security advisory

  • NLTK: Untrusted search path in prover9/mace4 config allows local code execution via relative binary_location

    3.10.4security advisory

  • NLTK: WekaClassifier passes an unvalidated caller-controlled model path to the weka JVM, bypassing nltk.pathsec containment

    3.10.4security advisory

  • NLTK: XMLCorpusView comment and CDATA parsing permits quadratic CPU denial of service

    3.10.4security advisory

  • JSON and YAML resource loading now applies size and depth bounds; YAML uses a bounded safe loader.

    3.10.4release notes

  • NLTK-compiled regular expressions, including caller-supplied patterns, are bounded against excessive compilation and match time; patterns retain re syntax and match objects remain those of the regex engine.

    3.10.4release notessecurity advisory

  • Downloaded archives and extraction are restricted to safe package directories, with ownership, writability, size, checksum, and archive-member checks.

    3.10.4release notessecurity advisory

  • The Toolbox reader and writers were hardened following a security re-audit.

    3.10.4release notes

  • Deserialization is bounded against depth and resource-exhaustion denial-of-service attacks.

    3.10.4release notes

  • Algorithmic-complexity DoS hardening is extended in a repository-wide sweep, including two-string distances.

    3.10.3release notes

  • Corpus-reader roots are validated against the data sandbox.

    3.10.3release notessecurity advisory

  • MaltParser's Java execution is sandboxed.

    3.10.3release notes

  • NLTK: Allowlisted pickle loaders still permit code execution in current source

    3.10.3security advisory

  • NLTK AllowlistUnpickler dotted-name validation bypass allows remote code execution

    3.10.3security advisory

  • NLTK: Corpus Reader Sandbox Bypass

    3.10.3security advisory

  • NLTK: Corpus readers follow symlinks outside trusted roots despite pathsec enforcement

    3.10.3security advisory

  • NLTK: Downloader.download follows hardlinks and overwrites outside-root files

    3.10.3security advisory

  • NLTK: Entity-expansion DoS (billion laughs) via remaining raw ElementTree parses

    3.10.3security advisory

  • NLTK: pathsec SSRF protection can be bypassed when a proxy is configured

    3.10.3security advisory

  • NLTK: Pl196xCorpusReader has quadratic ReDoS on malformed TEI blocks

    3.10.3security advisory

  • NLTK: Quadratic CPU Exhaustion in XMLCorpusView._read_xml_fragment()

    3.10.3security advisory

  • NLTK: Quadratic-time DoS in PorterStemmer via long runs of 'y'

    3.10.3security advisory

  • NLTK: ReDoS in nltk.tgrep via unvalidated user-supplied regular expressions

    3.10.3security advisory

  • NLTK: Uncontrolled recursion in nltk.featstruct.FeatStructReader causes unhandled RecursionError (DoS) via deeply nested feature-structure input

    3.10.3security advisory

  • NLTK: Uncontrolled resource consumption in RecursiveDescentParser via ambiguous or left-recursive grammars

    3.10.3security advisory

  • NLTK: Uncontrolled search path when invoking the Graphviz 'dot' binary

    3.10.3security advisory

  • Unbounded work in parsers and grammar transforms is bounded to mitigate denial-of-service risks.

    3.10.3release notes

  • The sandbox is hardened against write-side symlink TOCTOU and shared-temp squatting.

    3.10.3release notes

  • The system temp directory is trusted only when it is private.

    3.10.3release notes

  • A symlink escape vulnerability in FramenetCorpusReader was fixed.

    3.10.2release notes

  • NLTK: Symlink-based arbitrary file read in IPIPANCorpusReader, bypasses nltk.pathsec entirely

    3.10.2security advisory

  • NLTK: Symlink-based sandbox bypass in FramenetCorpusReader (bypasses the fix for CVE-2026-54292)

    3.10.2security advisory

  • Uses sparse indices to prevent unbounded-allocation denial of service.

    3.10.0release notes

  • Stops quadratic ReDoS in CCG lexicon parsing.

    3.10.0release notes

  • Bounds extraction to prevent exponential denial of service.

    3.10.0release notes

  • Guards against malformed input.

    3.10.0release notes

  • Prevents ReDoS in chunk tag-pattern parsing.

    3.10.0release notes

  • Uses a linear-time implementation to prevent quadratic-time denial of service.

    3.10.0release notes

  • Uses sparse storage to prevent quadratic-memory denial of service.

    3.10.0release notes

  • Validate input lines to prevent crashes on malformed lines.

    3.10.0release notes

  • Caches feature extraction and hardens boundaries.

    3.10.0release notes

  • Corpus readers use defusedxml to block XML entity-expansion denial of service.

    3.10.0release notes

  • Avoids algorithmic-complexity denial of service.

    3.10.0release notes

  • Routes loading through the pathsec sandbox.

    3.10.0release notes

  • Bounds work to prevent quadratic time and memory denial of service.

    3.10.0release notes

  • Bounds the default max_len to prevent unbounded allocation.

    3.10.0release notes

  • Blocks path traversal when accessing frames.

    3.10.0release notessecurity advisory

  • Bounds derivation-expansion steps to prevent unbounded enumeration.

    3.10.0release notes

  • Prevents JVM argument injection.

    3.10.0release notes

  • Bounds recursion depth to prevent uncaught RecursionError.

    3.10.0release notes

  • Relative MaltParser directories are resolved using MALT_PARSER rather than the current working directory.

    3.10.0release notes

  • Prevents process-wide current-working-directory pollution during parsing.

    3.10.0release notes

  • Bounds quantifier-nesting cost to prevent combinatorial denial of service.

    3.10.0release notes

  • Natural Language Toolkit (NLTK): DNS-rebinding SSRF filter bypass in nltk.pathsec.urlopen (nltk.download / nltk.data.load) defeats ENFORCE mode

    3.10.0security advisory

  • Natural Language Toolkit (NLTK): Path Traversal in NKJPCorpusReader leads to Arbitrary File Read and bypasses the nltk.pathsec sandbox (ENFORCE=True)

    3.10.0security advisoryrelease notes

  • Natural Language Toolkit (NLTK): ReDoS in NLTK ReviewsCorpusReader FEATURES regex

    3.10.0security advisoryrelease notes

  • Natural Language Toolkit (NLTK): URL-Encoded Path Traversal in nltk.data.load() Allows Arbitrary Local File Read

    3.10.0security advisory

  • nltk: Arbitrary File Read via Path Traversal in nltk.data.load() through Percent-Encoded Sequences

    3.10.0security advisory

  • NLTK: Default ENFORCE=False Disables All pathsec Security Controls

    3.10.0security advisory

  • NLTK downloader allows cross-package resource and model poisoning

    3.10.0security advisory

  • NLTK: FileSystemPathPointer.open() sandbox check is dead code — arbitrary file read via file:// protocol

    3.10.0security advisory

  • NLTK network URL validation permits SSRF to RFC 6598 shared-address-space hosts

    3.10.0security advisory

  • NLTK: ReDoS in nltk.text.Text.findall() via unvalidated user-supplied regular expressions

    3.10.0security advisory

  • NLTK: SSRF Fail-Open in validate_network_url() via DNS Resolution Failure

    3.10.0security advisory

  • NLTK: Stable FrameNet and NKJP readers parse outside-root XML

    3.10.0security advisory

  • NLTK: StreamBackedCorpusView Bypasses pathsec.ENFORCE - Arbitrary Local File Read

    3.10.0security advisory

  • Honors proxy settings and prevents DNS-rebinding SSRF, including IPv6 transition-embedded internal IPv4 bypasses.

    3.10.0release notes

  • Relative ReppTokenizer directories are resolved using REPP_TOKENIZER rather than the current working directory.

    3.10.0release notes

  • Bounds the super-linear n-gram scan.

    3.10.0release notes

  • The binary is no longer run from the current working directory.

    3.10.0release notes

  • Prevents ReDoS in XML fixing.

    3.10.0release notes

  • Cleans temporary files and isolates Java options.

    3.10.0release notes

  • Prevents ReDoS in the paragraph-break regex.

    3.10.0release notes

  • Prevents pickle RCE when loading models and fixes sparse index dtype compatibility with scikit-learn 1.9.

    3.10.0release notessecurity advisory

  • Removes a quadratic scan.

    3.10.0release notes

  • Stops exponential ReDoS in the XML validation regex.

    3.10.0release notes

New APIs and options 7

  • Setting this variable to 1 opts out of the restriction that Java loads jars only from a data root, with a warning.

    3.10.4release notes

  • The extract argument explicitly controls extraction; packages needing access by another account are extracted, and extracted files are found before the archive.

    3.10.4release notes

  • Sets chart_parse's default five-second wall-clock limit; passing max_time=None disables the limit.

    3.10.4release notes

  • The downloader command can explicitly extract downloaded packages with --extract or leave them unextracted with --no-extract.

    3.10.4release notes

  • Adds support for visualizing syntactic trees for RTL languages.

    3.10.4release notes

  • Adds the english-extended stopword list.

    3.10.4release notes

  • Adds an integration for HuggingFace datasets.

    3.10.0release notes

Performance 7

  • The tokenizer handles retried leading regex runs in linear time.

    3.10.4release notes

  • relextract handles retried leading regex runs in linear time.

    3.10.4release notes

  • The tokenizer handles retried leading regex runs in linear time.

    3.10.4release notes

  • ToktokTokenizer handles retried leading regex runs in linear time.

    3.10.4release notes

  • The parser handles retried leading regex runs in linear time.

    3.10.4release notes

  • The tokenizer handles retried leading regex runs in linear time.

    3.10.4release notes

  • Caches WordNet maximum depth lazily.

    3.10.0release notes

Behavior and default changes 3

  • Store reads now use a key manifest, and the store-swap window is closed.

    3.10.4release notes

  • Syntactic tree visualization now supports right-to-left languages.

    3.10.4release notes

  • Uses OMW-2.0 with all WordNet versions.

    3.10.0release notes

Fixes and other changes 16

  • val_load can now read back data written by val_dump.

    3.10.4release notes

  • The client surfaces the server's reason when it returns a non-2xx response.

    3.10.4release notes

  • Cycle detection no longer returns False for every parsed graph.

    3.10.4release notes

  • Prevents IndexError when stemming an empty string.

    3.10.4release notes

  • Requesting punkt now also downloads punkt_tab, preventing a missing-resource failure.

    3.10.4release notes

  • Requesting punkt now ensures punkt_tab is downloaded as well.

    3.10.4release notes

  • Counts all increasing pairs when computing kendall_tau.

    3.10.4release notes

  • Representation is iterative, so deep accepted trees no longer overflow the stack.

    3.10.4release notes

  • Fixes newline handling in ellipsis tokens and prevents the ZWJ emoji pattern from capturing adjacent whitespace.

    3.10.4release notes

  • Fixes perfect-agreement edge cases.

    3.10.0release notes

  • No longer crashes on terminals with siblings.

    3.10.0release notes

  • Honors substituted direction instead of ignoring it.

    3.10.0release notes

  • Fixes the duplicated -l short option.

    3.10.0release notes

  • Uses the lowercased word for irregular forms in NLTK mode and bounds recursion in _is_consonant.

    3.10.0release notes

  • Allows escaped brackets in input strings.

    3.10.0release notes

  • Fixes comparisons against incompatible types.

    3.10.0release notes