NLTKに細工されたコーパスで処理が極端に遅くなる脆弱性
Summary
NLTKの3.6から3.10.3までには、攻撃者が用意したコーパスファイルに大きなコメントやCDATAがあると、CPUの消費が急増してサービス停止を招く脆弱性があります。修正版の3.10.4が公開されているため、該当するバージョンを使っている場合は3.10.4への更新を検討してください。CVSSは7.5で、急ぎの対応が必要な水準です。
AI summary
Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.
NLTKの3.6から3.10.3までには、攻撃者が用意したコーパスファイルに大きなコメントやCDATAがあると、CPUの消費が急増してサービス停止を招く脆弱性があります。修正版の3.10.4が公開されているため、該当するバージョンを使っている場合は3.10.4への更新を検討してください。CVSSは7.5で、急ぎの対応が必要な水準です。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| nltknltk | — | Not listed |
| PyPInltk |
≥ 3.6, < 3.10.4→ 3.10.4 |
3.10.4 |
| pipnltk |
< 3.10.4→ 3.10.4 |
3.10.4 |
Fix status by distribution
Records published by each distribution for this CVE. Fixed versions differ by release; check each link.
- Debian DEBIAN-CVE-2026-128139 nltk No fixed version in this record
- Ubuntu UBUNTU-CVE-2026-128139 nltk No fixed version in this record
Original description The description as published by the source.
affected: PyPI
nltk>= 3.6—nltk.corpus.reader.xmldocs.XMLCorpusViewstreaming read (and thenps_chat/framenetreaders built on it)
dynamically reproduced:3.6(6/6 checks),3.9.2(6/6),3.10.3(6/6) anddevelop6818767b9(6/6)
Source references (nltk/corpus/reader/xmldocs.py:NNN) are to commit 6818767b99c24659107eb2be9bccd32a3d4bf045 (develop, v3.10.3-15-g6818767b9). The released v3.10.3 wheel's xmldocs.py is byte-identical to that commit, so the same line numbers apply to the released wheel.
Summary
An attacker who can make a victim read a well-formed XML corpus file whose body contains one large comment or CDATA section can pin a CPU core for a time quadratic in the file size, because XMLCorpusView._read_xml_fragment (nltk/corpus/reader/xmldocs.py) re-runs a linear whole-buffer validation after every 1 KiB block while the comment/CDATA terminator is still ahead. XMLCorpusView is NLTK's documented streaming API for XML corpora and is instantiated directly by the NPSChatCorpusReader and FramenetCorpusReader readers; the module header (xmldocs.py:16-20) explicitly handles untrusted corpus XML. The in_tag guard added to this function for GHSA-vp2x covers only a single oversized <...> tag and leaves the CDATA/comment path quadratic in the current release.
Details
Root cause: _read_xml_fragment (xmldocs.py:273-338) accumulates the file into one fragment string in _BLOCK_SIZE (1024) cha…
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- advisory github.com
- package github.com
- web github.com
- web github.com
- web github.com
- web nvd.nist.gov
- web github.com