Gptline: NLTK: Entity-expansion DoS (billion laughs) via remaining raw ElementTree parses (CVE-2026-78681)
Description
NLTK versions from 1.0.8 up to but not including 1.0.8_23 contain a denial-of-service vulnerability due to unsafe XML entity expansion in several XML parsing functions that use Python's xml.etree.ElementTree directly. Crafted XML documents with nested entity declarations can cause exponential memory amplification (billion laughs attack), leading to high memory consumption and potential service disruption. The vulnerability is mitigated by routing XML parsing through a new nltk.xmlsec module that forbids entity declarations, using defusedxml or a fallback expat pre-scan. A patch is available to address this issue.
CVSS v4.0
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Several XML parsing sites in NLTK (<= 3.10.2) use xml.etree.ElementTree directly, which processes <!ENTITY> declarations in internal DTD subsets, allowing crafted XML documents to expand exponentially in memory (billion laughs attack). This causes a memory amplification denial-of-service (CWE-776). The vulnerability affects call sites including nltk.chunk.named_entity.load_ace_file, nltk.internals.ElementWrapper, and nltk.downloader XML parsing functions. The underlying libexpat parser added an input-amplification cap in version 2.6.0, but it only activates above ~8 MiB output and depends on the linked libexpat version; older versions have no cap. The fix routes all XML parsing through nltk.xmlsec, which forbids entity declarations and prefers defusedxml, falling back to an expat pre-scan to block malicious entities. The patch rejects malicious payloads that previously caused large memory expansions.
Potential Impact
Exploitation of this vulnerability allows an attacker to cause a denial-of-service by consuming excessive memory through crafted XML documents with nested entity expansions. This can lead to application crashes or degraded service availability. There is no remote code execution or file disclosure as external entities are not resolved. The impact is limited to memory exhaustion and denial-of-service conditions.
Mitigation Recommendations
A patch is available that routes all affected XML parsing through the nltk.xmlsec module, which forbids entity declarations and uses defusedxml or a fallback expat pre-scan to prevent entity expansion attacks. Users should upgrade to the fixed version >=1.0.8_23. No additional action is required if the patch is applied.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-jx89-3qg8-p2mr
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-78681"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a8d9aeeacd9273b493e19c1
Added to database: 08/25/2026, 13:38:54 UTC
Last enriched: 09/18/2026, 02:16:52 UTC
Last updated: 10/09/2026, 06:48:19 UTC
Views: 67
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.