Quick answers
- Is CVE-2026-12876 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2026-12876 being exploited in the wild.
- How severe is CVE-2026-12876?
- Medium severity, with a CVSS score of 4, published 2 September 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-12876?
- 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-12876 attacked?
- It is attacked over the network.
- Am I affected by CVE-2026-12876?
- 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
pip install "nltk>=3.10.3"
Technical details
The RecursiveDescentParser (and SteppingRecursiveDescentParser) in NLTK enumerate parse trees top-down with no upper bound on the number of recursive steps (CWE-407, CWE-674). Two attack patterns are demonstrated: (a) left-recursive grammars (e.g., "S -> S S | 'a'") trigger unbounded recursion depth; (b) ambiguous grammars (e.g., "S -> 'a' S | 'a' S S | 'a'") cause exponential enumeration of parse trees. Both hang on a 24-token input with super-linear growth in input length. Attack vector is network-capable if the grammar or input is drawn from an untrusted source. The fix (in NLTK 3.10.3+) adds a wall-clock max_time limit (default 5 seconds) checked on every recursive _parse entry, protecting by default while allowing opt-out via max_time=None.
Affected products
- NLTK Project NLTK <= 3.10.2
Identifiers
- CVE-2026-12876
- GHSA-ff5c-cp5c-9wjf
- PYSEC-2026-3869
Timeline
- 2026-08-12: disclosed: Published to GitHub Advisory Database
- 2026-08-12: patched: Fix committed; NLTK 3.10.3 released
- 2026-09-02: advisory: Advisory GHSA-ff5c-cp5c-9wjf published
References
- https://github.com/nltk/nltk/security/advisories/GHSA-ff5c-cp5c-9wjf
- https://github.com/nltk/nltk/pull/3649
- https://github.com/nltk/nltk/commit/43aaca1b9024138421c97f970bf13ee19ac8129d
- https://github.com/nltk/nltk/releases/tag/v3.10.3
- https://api.github.com/repos/nltk/nltk/security-advisories/GHSA-ff5c-cp5c-9wjf