Quadratic Behavior in xml.etree.ElementPath Index Predicates
CVE-2026-6879Published 28 Jul 2026, 13:46 UTC
Real-world risk
0.1/ 10Low
Routine
If the vulnerable configuration applies to you: 0.2
PreliminaryFrom the CVSS vector only · confidence low
CVSS
2.0
scored by the vendor (CNA), CVSS 4.0
In plain words
No plain-language summary yet. The original description is below.
Original description (from PSF)
`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.
Am I affected?
| Product | Affected versions (from the sources) | Fixed in |
|---|---|---|
| CPythonUbiquitous | < 3.10.21; >= 3.11.0, < 3.11.16; >= 3.12.0, < 3.12.14; >= 3.13.0, < 3.13.15; >= 3.14.0, < 3.14.7; >= 3.15.0a1, < 3.15.0rc1 | 3.10.21, 3.11.16, 3.12.14, 3.13.15, 3.14.7, 3.15.0rc1 |
What to do
Update to a fixed version: 3.10.21, 3.11.16, 3.12.14, 3.13.15, 3.14.7, 3.15.0rc1.
Why this score
| Factor | Value | Evidence | × |
|---|---|---|---|
| Impact | MinorReflected XSS, CSRF with low effect, open redirect, minor leak | From the CVSS vector | 0.30 |
| Attacker position | InternetAnyone on the Internet can reach a typical deployment | From the CVSS vector | 1.00 |
| Privileges needed | HighAdmin or equivalent | From the CVSS vector | 0.20 |
| Victim interaction | RoutineA normal action: open a file, visit a page, click a link | From the CVSS vector | 0.70 |
| Configuration | UncommonNeeds a non-default feature that a minority enables | From the CVSS vector | 0.45 |
| Reliability | HardNarrow race, needs an extra info leak, needs a man-in-the-middle position, or must be chained with another bug | From the CVSS vector | 0.45 |
Threat level T1: Nothing known (× 0.85)
The default for a new disclosure
EPSS 0.4% chance of exploitation in 30 days (percentile 31), as of 2026-12-03.
The arithmetic
- Prerequisites multiplied together0.028
- Threat T1: Nothing known0.850
- 10 × impact 0.3 × prerequisites 0.0284 × threat 0.850.072
- Rounded to one decimal between 0.1 and 100.1
Exploitation and evidence timeline
- 28 Jul 2026 Published
- 3 Dec 2026 Risk 0.1 (cvss fallback)
Weakness
CWE-407
References
- https://github.com/python/cpython/pull/152676patch
- https://github.com/python/cpython/issues/152674issue-tracking
- https://mail.python.org/archives/list/[email protected]/thread/7YMZ6DDZVR26TJJBVO3RDNBAVGHNYAKR/vendor-advisory
- https://github.com/python/cpython/commit/2ffab083782968a4d732738f4f1dff6bbd69d2b0patch
- https://github.com/python/cpython/commit/02c08e6b747ac43d0d866a4ffa916bedf3423f81patch
- https://github.com/python/cpython/commit/390337b8ba1658833fdef379e1739c9f9533a8dbpatch
- https://github.com/python/cpython/commit/cb409342a19f25656f62e679f8bac265fe1442c3patch
- https://github.com/python/cpython/commit/96510a3758f4a075f43223afdee3b6ee1a7a7f02patch
- https://github.com/python/cpython/commit/037965c00a427cba5c05447efadc67c51a492e85patch
- https://github.com/python/cpython/commit/0583f24ae678993e3f7939f51ad5bcae5ad9dc70patch
- CVE-2026-6879 on CVE.org