Quick answers
- Is CVE-2026-78681 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2026-78681 being exploited in the wild.
- How severe is CVE-2026-78681?
- High severity, with a CVSS score of 7.5, published 25 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-78681?
- 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-78681 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2026-78681?
- 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
NLTK versions ≤3.10.2 contain multiple XML parsing code paths that directly use xml.etree.ElementTree, which honours <!ENTITY> declarations in document DTDs. An attacker can craft a small XML file (330 bytes) containing nested entity declarations that expand exponentially in memory—each nesting level multiplies by ~10, allowing a 330-byte payload to expand to ~1 MB. The vulnerable code paths include nltk.chunk.named_entity.load_ace_file(), nltk.internals.ElementWrapper(), and nltk.downloader's Package.fromxml() and Collection.fromxml() methods. While libexpat 2.6.0+ implements an input-amplification cap, it only engages above an ~8 MiB threshold and depends on the interpreter's libexpat version; older libexpat builds have no protection. The vulnerability is a memory-amplification denial of service (CWE-776); external entities are not resolved by ElementTree, so XXE/file disclosure is not possible. The fix introduces a new nltk.xmlsec module that blocks entity declarations by preferring defusedxml (when installed) and falling back to a safe xml.parsers.expat pre-scan that detects DOCTYPE declarations with entity declarations.
Affected products
- NLTK NLTK <= 3.10.2
Identifiers
- CVE-2026-78681
- GHSA-97qj-x29f-37w7
- PYSEC-2026-3748
Timeline
- 2026-08-11: disclosed
- 2026-08-10: patched: Fix committed in v3.10.3
- 2026-09-08: advisory: Published to GitHub Advisory Database
References
- https://github.com/nltk/nltk/security/advisories/GHSA-97qj-x29f-37w7
- https://github.com/nltk/nltk/commit/e91789c9a043296ad04912ce171c22776d45963b
- https://github.com/nltk/nltk/releases/tag/v3.10.3
- https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3748.yaml
- https://www.vulncheck.com/advisories/nltk-before-entity-expansion-dos-via-elementtree