# NLTK unbounded recursion in JSONTaggedDecoder.decode_obj

Source: https://junglewise.ai/threats/nltk-unbounded-recursion-in-jsontaggeddecoder-decode-obj-e977609c  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-22. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

Severity: high · CVSS 7.5 · Published 2026-08-22

NLTK is a popular Python library for natural language processing tasks. The JSONTaggedDecoder component, which parses JSON data, can be exploited by sending deeply nested JSON structures that exceed Python's recursion limit, causing the process to crash and resulting in denial of service.

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

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** High severity, with a CVSS score of 7.5, published 22 August 2026.

**Which products and versions are affected?** nltk (PyPI) <= 3.9.3.

**Is there a fix for This vulnerability?** A patch was published on 2026-03-18: Fix available in NLTK 3.9.4 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network.

**Am I affected?** 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.

## Technical details

The vulnerability is an uncontrolled recursion flaw (CWE-674) in the JSONTaggedDecoder.decode_obj() method within nltk/jsontags.py. The method recursively processes JSON objects and lists without implementing any depth limit, causing it to exceed Python's default recursion limit (typically 1000) when processing maliciously crafted deeply nested JSON. An attacker can supply externally-sourced JSON with nesting depth exceeding sys.getrecursionlimit() to trigger an unhandled RecursionError that crashes the Python process. The attack requires network reachability to a code path that passes untrusted JSON to JSONTaggedDecoder; no authentication or user interaction is required. The fix, available in version 3.9.4, adds a depth parameter with a hard recursion limit check.

## Affected products

- NLTK Project NLTK <= 3.9.3

## Timeline

- 2026-03-18: disclosed: GHSA-rf74-v2fm-23pw security advisory published
- 2026-08-22: advisory: Duplicate advisory GHSA-cv2g-m8rr-888c published; NVD entry CVE-2026-66393 created
- 2026-03-18: patched: Fix available in NLTK 3.9.4

## References

- [https://github.com/nltk/nltk/security/advisories/GHSA-rf74-v2fm-23pw](https://github.com/nltk/nltk/security/advisories/GHSA-rf74-v2fm-23pw)
- [https://www.vulncheck.com/advisories/nltk-before-denial-of-service-via-jsontaggeddecoder](https://www.vulncheck.com/advisories/nltk-before-denial-of-service-via-jsontaggeddecoder)

## 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)
