# CVE-2026-81724: NLTK FeatStructReader uncontrolled recursion denial of service

Source: https://junglewise.ai/threats/cve-2026-81724-nltk-featstructreader-uncontrolled-recursion-denial-of-service  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-27. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-81724 · Severity: medium · CVSS 5.3 · Published 2026-08-27

NLTK is a widely-used natural language processing library. Its feature-structure parser, used in NLP applications and grammar tools, lacks protection against deeply nested input. An attacker can send a small malicious grammar string (~700 bytes) that causes the application to crash instantly with an unhandled exception. The impact ranges from request failures in web applications to complete process termination in single-threaded workers.

Technologies: [nltk (PyPI)](https://junglewise.ai/threats/technologies/nltk). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-81724 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-81724 being exploited in the wild.

**How severe is CVE-2026-81724?** Medium severity, with a CVSS score of 5.3, published 27 August 2026.

**Which products and versions are affected?** nltk (PyPI) <= 3.10.2, ECOSYSTEM:introduced=0,fixed=3.10.3.

**Is there a fix for CVE-2026-81724?** Yes. nltk (PyPI): upgrade to 3.10.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-81724 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-81724?** Check whether you run nltk (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- nltk (PyPI): upgrade to 3.10.3 or later

  ```sh
  pip install "nltk>=3.10.3"
  ```


## Technical details

The vulnerability is a classic uncontrolled recursion issue (CWE-674) in nltk.featstruct.FeatStructReader. The recursive call chain (_read_partial → _read_value → read_value → read_fstruct_value → read_partial) has no depth counter or MAX_PARSE_DEPTH guard. When deeply nested feature structures like "[a=" repeated 167 times are provided, the parser exceeds Python's recursion limit and raises an unhandled RecursionError instead of the library's normal ValueError. The PoC crashes in ~2ms with just 669 bytes. The parser is reachable via FeatStruct(str) and FeatureGrammar.fromstring(), affecting any application that processes user-supplied grammars. The fix (adding a MAX_PARSE_DEPTH constant and depth check) was already implemented in nltk/sem/logic.py but missing from featstruct.py. Patched in NLTK 3.10.3.

## Affected products

- NLTK Project NLTK <= 3.10.2

## Identifiers

- CVE-2026-81724
- GHSA-cw6x-m8jw-qmrh
- PYSEC-2026-3739

## Timeline

- 2026-08-12: disclosed
- 2026-09-02: advisory: GitHub Security Advisory published
- 2026-09-02: patched: Fix released in NLTK 3.10.3

## References

- [https://api.github.com/users/JoshgunAbdullayev](https://api.github.com/users/JoshgunAbdullayev)
- [https://github.com/JoshgunAbdullayev](https://github.com/JoshgunAbdullayev)
- [https://api.github.com/users/JoshgunAbdullayev/gists%7B/gist_id%7D](https://api.github.com/users/JoshgunAbdullayev/gists%7B/gist_id%7D)
- [https://api.github.com/users/JoshgunAbdullayev/repos](https://api.github.com/users/JoshgunAbdullayev/repos)
- [https://avatars.githubusercontent.com/u/128043503?v=4](https://avatars.githubusercontent.com/u/128043503?v=4)
- [https://api.github.com/users/JoshgunAbdullayev/events%7B/privacy%7D](https://api.github.com/users/JoshgunAbdullayev/events%7B/privacy%7D)

## Related threats

- [NLTK WekaClassifier path traversal in model validation](https://junglewise.ai/threats/cve-2026-109956-nltk-through-3-10-3-contains-a-path-traversal-vulnerability-in)
- [NLTK RecursiveDescentParser uncontrolled recursion denial of service](https://junglewise.ai/threats/cve-2026-12876-nltk-recursivedescentparser-uncontrolled-recursion-denial-of)
- [NLTK tgrep regular expression denial of service](https://junglewise.ai/threats/nltk-tgrep-regular-expression-denial-of-service-02fca1b2)
- [NLTK Downloader hardlink filesystem containment bypass](https://junglewise.ai/threats/nltk-downloader-hardlink-filesystem-containment-bypass-522cb97d)
- [NLTK Pl196xCorpusReader quadratic ReDoS on malformed TEI blocks](https://junglewise.ai/threats/nltk-pl196xcorpusreader-quadratic-redos-on-malformed-tei-blocks-8473e6ef)
