CVE-2026-6879
Awaiting Analysis Awaiting Analysis - Queue

Element.findall() XPath Index Predicate O(n^2) Complexity in ElementTree

Vulnerability report for CVE-2026-6879, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-28

Last updated on: 2026-07-28

Assigner: Python Software Foundation

Description

`Element.findall()` and fully-consumed `Element.iterfind()` exhibit `O(n^2)` time complexity when using XPath index predicates (e.g. `[1]`, `[last()]`, `[last()-N]`) on XML documents with many same-tag siblings. `Element.find()` is only affected when the first match is near the endΒ  of the sibling list, such as with `[last()]` or `[last()-N]`;Β  `.//item[1]` short-circuits after the first match.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-28
Last Modified
2026-07-28
Generated
2026-07-28
AI Q&A
2026-07-28
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
python cpython From 3.10 (inc) to 3.15 (inc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-407 An algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability affects CPython's Element.findall() and Element.iterfind() methods in the xml.etree.ElementPath module. When using XPath index predicates like [1], [last()], or [last()-N] on XML documents with many same-tag siblings, these methods exhibit O(n^2) time complexity, causing significant performance degradation as document size increases.

Detection Guidance

This vulnerability is specific to Python's xml.etree.ElementPath module and does not directly affect network or system detection. However, you can check if your Python versions are affected by reviewing installed versions and comparing them against patched releases. Use commands like 'python --version' or 'pip list' to identify Python versions. Monitor for slow XML processing with XPath index predicates as a potential indicator.

Impact Analysis

The vulnerability can cause severe slowdowns when processing large XML files with many sibling elements. Applications using affected methods with XPath predicates may experience degraded performance, potentially leading to timeouts or unresponsiveness during XML parsing operations.

Compliance Impact

This vulnerability does not directly affect compliance with standards like GDPR or HIPAA as it is a performance issue in Python's XML parsing library rather than a data security or privacy flaw. Compliance depends on proper data handling, encryption, and access controls, not algorithmic efficiency.

Mitigation Strategies

Update Python to a patched version (3.10, 3.11, 3.12, 3.13, 3.14, or 3.15) where the fix has been backported. Review code using Element.findall(), Element.iterfind(), or Element.find() with XPath index predicates like [1], [last()], or [last()-N] and update to use more efficient XPath expressions or alternative methods.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-6879. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart