Skip to main content

Gptline: NLTK: Quadratic CPU Exhaustion in `XMLCorpusView._read_xml_fragment()` (CVE-2026-81723)

0
Low
Published: 09/03/2026 (09/03/2026, 09:08:38 UTC)
Source: GCVE Database
Product: gptline

Description

NLTK's XMLCorpusView._read_xml_fragment() function exhibits quadratic CPU exhaustion when processing malformed XML corpus files. The function reads input in 1 KiB blocks, appending to a growing buffer and rescanning the entire accumulated fragment with a regex match on each iteration. This causes CPU usage to grow quadratically with input size, leading to potential denial of service. The issue affects several corpus readers relying on XMLCorpusView, including BNCCorpusReader. No patch is available in published releases, but a fix is suggested to avoid rescanning the entire buffer each iteration.

CVSS v3.1

Score 3.7low

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
Low
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L

Affected software

Homebrewmore threats →ghsa
gptline
pkg:brew/gptline
Affected versions
>=1.0.8 <1.0.8_23

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 09/18/2026, 01:51:05 UTC

Technical Analysis

The vulnerability in NLTK's XMLCorpusView._read_xml_fragment() arises because the function reads a corpus file in 1 KiB blocks, appending each block to a growing string fragment. On each iteration, it calls a regex match on the entire accumulated fragment, causing the total work to grow quadratically with input size. For malformed XML inputs that never match the regex, the loop continues until EOF, resulting in excessive CPU consumption. This affects readers such as BNCCorpusReader and others relying on XMLCorpusView, but not XMLCorpusReader.xml(). The issue was verified in NLTK versions 3.9.4, 3.10.0, and the current development branch. No patch exists in published releases, but a fix is proposed to use incremental parsing or bounded fragment accumulation to eliminate the quadratic behavior.

Potential Impact

Applications processing attacker-controlled XML corpus files with affected NLTK readers can experience CPU exhaustion leading to denial of service. The attacker only needs write access to a file path the reader will open; no special privileges or credentials are required. Offline tools processing trusted local corpora are not at risk. The impact is limited to availability (denial of service) with no confidentiality or integrity impact.

Mitigation Recommendations

A patch is available for this vulnerability. Users should apply the official fix once released. Until then, avoid processing untrusted XML corpus files with affected readers. The suggested fix involves avoiding rescanning the entire accumulated fragment on each iteration by using incremental parsing or bounded fragment accumulation. No generic mitigations are recommended beyond applying the patch when available.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
BREW-gptline-CVE-2026-81723
Osv Schema Version
1.7.3
Ecosystems
["Homebrew"]
Cvss Version
3.1

Threat ID: 6aac8e5a55bf5e2cf5491af3

Added to database: 09/18/2026, 01:05:30 UTC

Last enriched: 09/18/2026, 01:51:05 UTC

Last updated: 09/18/2026, 02:07:15 UTC

Views: 3

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses