Skip to content
High 8.7

NLTKに細工されたコーパスでCPUを使い切られる脆弱性

CVE-2026-126297 First seen on SecPulse

Summary

NLTKの3.10.4より前のバージョンには、ConllCorpusReaderのSRL処理で計算量が二次関数的に膨らむサービス拒否の脆弱性があります。細工されたCoNLL SRLコーパスを読み込ませると、CPUが数分間占有されるおそれがあります。修正版の3.10.4以降にアップデートしてください。

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.10.4より前のバージョンには、ConllCorpusReaderのSRL処理で計算量が二次関数的に膨らむサービス拒否の脆弱性があります。細工されたCoNLL SRLコーパスを読み込ませると、CPUが数分間占有されるおそれがあります。修正版の3.10.4以降にアップデートしてください。

Affected packages

PackageAffected → Fixed
nltknltk
< 3.10.4→ 3.10.4
pipnltk
< 3.10.4→ 3.10.4
PyPInltk
< 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.

Original description The description as published by the source.

Summary

ConllCorpusReader.srl_instances() builds semantic-role-labeling instances from a CoNLL corpus block. For a sentence block with P predicates and P span columns, the instance builder rescans every span column (and every span within it) once per predicate while searching for each predicate's head, giving O(P^2 * R) work. A single well-formed block that places the head span in the last column forces the full scan on every predicate, so an application that reads an attacker-supplied CoNLL SRL corpus can be driven into tens of seconds of single-threaded CPU. No authentication or user interaction is required.

Root Cause

_get_srl_instances iterates over the P predicates of a block; for each predicate it scans every span list and every span within it, using an inner break that stops only when a span tagged V or C-V containing the predicate word is found. When the sole head span is placed in the last span column, no earlier column matches, so the for ... else: continue construct traverses every span of every earlier column before matching. Over P predicates each scanning up to P columns of R spans, the cost is O(P^2 * R). The block is read whole with no size cap, and the grid-consistency check enforces only uniform column count, not a bound on P, R, or total work.

Affected function:
- nltk.corpus.reader.conll.ConllCorpusReader._get_srl_instances (nltk/corpus/reader/conll.py:394-424; nested rescan at lines 405-419)
Public entry point: nltk.corpus.re…

Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory

References

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