English version →
Webアプリケーション
CVE-2026-78681 high CVSS 7.5

NLTK: Entity-expansion DoS (billion laughs) via remaining raw ElementTree parses

概要

NLTK: Entity-expansion DoS (billion laughs) via remaining raw ElementTree parses

原文の説明

取得元が公開している説明をそのまま載せています (多くは英語)。

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…

出典: NIST National Vulnerability Database NVD GitHub Advisory

AI要約

外部の AI が作成した要約です。誤りを含むことがあります。重要な判断の前に、下の原文と参照URLを確認してください。

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を解析しているか確認する。

影響パッケージ

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

参照URL

当サイトでは、アクセス解析と広告の効果測定のために Cookie を使います。株式会社Game のサイト共通の設定です。 詳しく