CVE-2026-78681
Linux Debian vulnerability analysis and mitigation

Overview

CVE-2026-78681 is an XML Entity Expansion ("Billion Laughs") denial-of-service vulnerability in the Natural Language Toolkit (NLTK) Python library. NLTK versions before 3.10.3 use xml.etree.ElementTree to parse XML in multiple modules, which honors entity declarations in document DTDs, allowing attackers to craft nested entity payloads that expand from hundreds of bytes to megabytes in memory. Affected modules include nltk.chunk.named_entity.load_ace_file, nltk.internals.ElementWrapper, and nltk.downloader (Package.fromxml, Collection.fromxml, _find_collections, _find_packages). The vulnerability was published on August 25, 2026, with a patch available in version 3.10.3. It carries a CVSS v3.1 score of 7.5 (High) and a CVSS v4.0 score of 8.7 (High) (GitHub Advisory, NLTK Security Advisory).

Technical details

The root cause is CWE-776 (Improper Restriction of Recursive Entity References in DTDs — XML Entity Expansion). Python's xml.etree.ElementTree honors internal DTD entity declarations, allowing nested entity references where each level multiplies memory consumption by a factor of ten. For example, a 330-byte payload at 5 nesting levels expands to 1,000,000 characters in memory. While libexpat 2.6.0+ introduced an amplification cap, it only activates above an ~8 MiB output threshold, and older libexpat builds (still common with Python 3.10/3.11) have no cap at all — meaning payloads up to ~1 MB per parse always succeed. Notably, external entities are not resolved, so this is a pure memory-amplification DoS (not an XXE/file disclosure issue). The fix routes all affected call sites through a new nltk.xmlsec module that rejects entity declarations, preferring defusedxml and falling back to a xml.parsers.expat pre-scan when defusedxml is absent (NLTK Security Advisory, GitHub Advisory).

Impact

Successful exploitation causes denial of service by exhausting the memory of the process running NLTK, potentially crashing the service or rendering it unavailable. The attack requires no authentication, no user interaction, and no special privileges — any unauthenticated network attacker who can submit XML input to an NLTK-powered application is a potential threat actor. There is no confidentiality or integrity impact; the vulnerability is limited to availability (GitHub Advisory, NLTK Security Advisory).

Exploitability

There is no public proof-of-concept exploit and no evidence of in-the-wild exploitation at the time of disclosure (GitHub Advisory). The EPSS score is 0.0, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. However, the NLTK security advisory includes a detailed attack demonstration with reproducible payload code, lowering the barrier for exploitation. No threat actor attribution has been reported.

Exploitation steps

  1. Identify a target: Locate an application or service that uses NLTK <= 3.10.2 and accepts user-supplied XML input processed by one of the affected modules (nltk.internals.ElementWrapper, nltk.chunk.named_entity.load_ace_file, or nltk.downloader XML parsing functions).
  2. Craft a billion-laughs payload: Construct a small XML document with nested entity declarations in the internal DTD subset. Each nesting level multiplies memory consumption by 10. Example structure (5 levels, ~330 bytes, expands to ~1,000,000 characters):
<!DOCTYPE bomb [
  <!ENTITY e0 "AAAAAAAAAA">
  <!ENTITY e1 "&e0;&e0;&e0;&e0;&e0;&e0;&e0;&e0;&e0;&e0;">
  <!ENTITY e2 "&e1;&e1;&e1;&e1;&e1;&e1;&e1;&e1;&e1;&e1;">
  <!ENTITY e3 "&e2;&e2;&e2;&e2;&e2;&e2;&e2;&e2;&e2;&e2;">
  <!ENTITY e4 "&e3;&e3;&e3;&e3;&e3;&e3;&e3;&e3;&e3;&e3;">
  <!ENTITY e5 "&e4;&e4;&e4;&e4;&e4;&e4;&e4;&e4;&e4;&e4;">
]>
<root>&e5;</root>
  1. Submit the payload: Deliver the crafted XML to the vulnerable application endpoint that triggers NLTK XML parsing (e.g., via HTTP request, file upload, or API call).
  2. Trigger memory exhaustion: The xml.etree.ElementTree parser expands the nested entities in memory, consuming megabytes of RAM per request. Repeated submissions amplify the effect, causing the process to crash or become unresponsive.
  3. Bypass text-based guards (if present): If the application attempts to screen for entity declarations by walking the DOCTYPE text, hide the declaration behind a decoy (e.g., in a prolog comment or processing instruction). Raw ElementTree still processes the real declaration and expands it (NLTK Security Advisory).

Indicators of compromise

  • Network: Repeated HTTP requests (or other protocol messages) containing XML payloads with <!DOCTYPE and <!ENTITY declarations targeting NLTK-powered endpoints; unusually small request sizes paired with disproportionate server-side memory consumption.
  • Logs: Application or web server logs showing repeated requests to XML-processing endpoints from the same or rotating source IPs; Python process crash logs or out-of-memory (OOM) killer events in system logs (/var/log/syslog, dmesg) referencing the NLTK process.
  • Process/System: Sudden spikes in memory usage by the Python process hosting NLTK; process termination events (OOM kills) correlated with incoming XML requests; increased swap usage or system slowdowns coinciding with XML parsing activity.

Mitigation and workarounds

The primary remediation is to upgrade NLTK to version 3.10.3 or later, which routes all affected XML parsing through the new nltk.xmlsec module that rejects entity declarations (NLTK Security Advisory). As an interim measure, install defusedxml in the Python environment — NLTK 3.10.3's fallback mechanism prefers it — and implement input validation to reject XML documents containing <!DOCTYPE or <!ENTITY declarations before they reach NLTK. Additionally, consider implementing rate limiting on XML-accepting endpoints and memory monitoring/alerting to detect and mitigate denial-of-service attempts before they cause full service outages (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related Linux Debian vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-78683CRITICAL9.4
  • Linux Debian logoLinux Debian
  • nltk
NoYesAug 25, 2026
CVE-2026-78682HIGH8.7
  • Linux Debian logoLinux Debian
  • nltk
NoYesAug 25, 2026
CVE-2026-78681HIGH8.7
  • Linux Debian logoLinux Debian
  • nltk
NoYesAug 25, 2026
CVE-2026-78680HIGH8.5
  • Linux Debian logoLinux Debian
  • nltk
NoYesAug 25, 2026
CVE-2026-78679HIGH7.1
  • Linux Debian logoLinux Debian
  • python-git
NoNoAug 25, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management