Summary
Vulnerability in nltk (CVE-2026-78681). Risk of unauthorized operations or information disclosure. Exploitable via xml.etree.ElementTree. Mitigation: upgrade to >=3.10.3 or later.
Original description
The description as published by the source.
Several XML parsing sites in NLTK still used xml.etree.ElementTree directly, which honours <!ENTITY> declarations in a document's internal DTD subset. A crafted document a few hundred bytes long can expand to megabytes in memory (each nesting level multiplies by ten), a denial-of-service.
Affected call sites (<= 3.10.2):
nltk.chunk.named_entity.load_ace_file— parses ACE annotation XMLnltk.internals.ElementWrapper— converts any given string to an Elementnltk.downloader—Package.fromxml,Collection.fromxml,_find_collections,_find_packages
libexpat 2.6.0 added an input-amplification cap, but it only engages above an activation threshold (~8 MiB output) and depends on whichever libexpat the interpreter links; builds against older libexpat have no cap at all. External entities are not resolved by ElementTree, so this is a memory-amplification DoS (CWE-776), not XXE/file disclosure.
This completes the earlier defusedxml adoption that these sites were missed by. Fix routes all of them through a new nltk.xmlsec module that refuses entity declarations, preferring defusedxml and falling back to a standard-library xml.parsers.expat pre-scan when defusedxml is absent.
Attack demonstration
Reproducible PoC against a real affected entry point (nltk.internals.ElementWrapper). Every number below is captured output, not illustrative.
1. The amplification (vulnerable path: raw xml.etree.ElementTree)
A payload of a few hundred bytes ex…
Source: NIST National Vulnerability Database NVD GitHub Advisory
AI summary
Written by an external AI model and may contain mistakes. Check the original description and references below before acting on it.
NLTKのバージョン3.10.3未満では、XMLのパースにxml.etree.ElementTreeを使用しています。これにより、攻撃者は特別に構築されたXMLペイロードを使用してメモリを過剰に消費させることができ、サービスを拒否状態に陥らせる可能性があります。
NLTKにおけるXML解析の脆弱性。
NLTKの3.10.3未満のバージョン。
攻撃者がXMLドキュメントの構造を悪用し、メモリを消費させることでDoS攻撃を引き起こせる。
NLTKをバージョン3.10.3以降にアップグレードする。
情報なし
xml.etree.ElementTreeを使用してXMLを解析しているか確認する。
Affected packages
References
- advisory disclosure@vulncheck.com
- exploit disclosure@vulncheck.com
- web nvd.nist.gov
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com