CVE-2026-6879

Low

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.

SeverityLow
CVSS2.0
Exploit probability—
ProductCPython
PublishedJul 28, 2026
First seenJul 28, 2026
Weakness typeCWE-407CWE-407

How to fix

Affected products

ProductAffected versionsFixed in
Python Software Foundation CPythonv < 3.10.21, 3.11.0 ≤ v < 3.11.16, 3.12.0 ≤ v < 3.12.14, 3.13.0 ≤ v < 3.13.15, 3.14.0 ≤ v < 3.14.7, 3.15.0a1 ≤ v < 3.15.0rc13.10.21, 3.11.16, 3.12.14, 3.13.15, 3.14.7, 3.15.0rc1

Check your version

Choose the product and enter the version you run to see whether it falls in the affected range.

In the Intelligence 360 plan

Attack Surface Management

See the assets tied to your domains, the technologies they run and known vulnerabilities in one list.