Web Application
CVE-2026-78681 high CVSS 7.5

Vulnerability in nltk (CVE-2026-78681)

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 XML
  • nltk.internals.ElementWrapper — converts any given string to an Element
  • nltk.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ペイロードを使用してメモリを過剰に消費させることができ、サービスを拒否状態に陥らせる可能性があります。

❓ What is the problem

NLTKにおけるXML解析の脆弱性。

📍 Affected scope

NLTKの3.10.3未満のバージョン。

🔥 Severity

攻撃者がXMLドキュメントの構造を悪用し、メモリを消費させることでDoS攻撃を引き起こせる。

🔧 How to fix

NLTKをバージョン3.10.3以降にアップグレードする。

🛡️ Workaround

情報なし

🔍 Detection

xml.etree.ElementTreeを使用してXMLを解析しているか確認する。

Affected packages

pip nltk
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.10.3"}]}]

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details