CVE-2026-6879Quadratic Behavior in xml.etree.ElementPath Index Predicates
`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.
What to do
Fixed builds are available from Alpine, Debian: see the table below for the fixed version per release.
Debian, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | pypy3 | Fix pending | UBUNTU-CVE-2026-6879 | |
| Ubuntu 26.10 | python3.14 | Fix pending | UBUNTU-CVE-2026-6879 | |
| Ubuntu 26.04 | pypy3 | Under investigation | UBUNTU-CVE-2026-6879 | |
| Ubuntu 26.04 | python3.14 | Under investigation | UBUNTU-CVE-2026-6879 | |
| Ubuntu 24.04 | pypy3 | Under investigation | UBUNTU-CVE-2026-6879 | |
| Ubuntu 24.04 | python3.12 | Under investigation | UBUNTU-CVE-2026-6879 | |
| Ubuntu 22.04 | pypy3 | Under investigation | UBUNTU-CVE-2026-6879 | |
| Ubuntu 22.04 | python2.7 | Fix pending | UBUNTU-CVE-2026-6879 | |
| Ubuntu 22.04 | python3.10 | Under investigation | UBUNTU-CVE-2026-6879 | |
| Ubuntu 22.04 | python3.11 | Fix pending | UBUNTU-CVE-2026-6879 | |
| Ubuntu 20.04 | pypy3 | Fix pending | UBUNTU-CVE-2026-6879 | |
| Ubuntu 20.04 | python2.7 | Fix pending | UBUNTU-CVE-2026-6879 | |
| Ubuntu 20.04 | python3.8 | Fix pending | UBUNTU-CVE-2026-6879 | |
| Ubuntu 20.04 | python3.9 | Fix pending | UBUNTU-CVE-2026-6879 | |
| Ubuntu 18.04 | python2.7 | Fix pending | UBUNTU-CVE-2026-6879 | |
| Ubuntu 18.04 | python3.6 | Fix pending | UBUNTU-CVE-2026-6879 | |
| Ubuntu 18.04 | python3.7 | Fix pending | UBUNTU-CVE-2026-6879 | |
| Ubuntu 18.04 | python3.8 | Fix pending | UBUNTU-CVE-2026-6879 | |
| Ubuntu 16.04 | python2.7 | Fix pending | UBUNTU-CVE-2026-6879 | |
| Ubuntu 16.04 | python3.5 | Fix pending | UBUNTU-CVE-2026-6879 | |
| Ubuntu 14.04 | python2.7 | Fix pending | UBUNTU-CVE-2026-6879 | |
| Ubuntu 14.04 | python3.4 | Fix pending | UBUNTU-CVE-2026-6879 | |
| Ubuntu 14.04 | python3.5 | Fix pending | UBUNTU-CVE-2026-6879 | |
| Debian 14 | pypy3 | Fixed | 8.0.0+dfsg-1 | DEBIAN-CVE-2026-6879 |
| Debian 14 | python3.14 | Fixed | 3.14.7-1 | DEBIAN-CVE-2026-6879 |
| Debian 13 | pypy3 | Fix pending | DEBIAN-CVE-2026-6879 | |
| Debian 13 | python3.13 | Fixed | 3.13.5-2+deb13u5 | DEBIAN-CVE-2026-6879 |
| Debian 12 | pypy3 | Fix pending | DEBIAN-CVE-2026-6879 | |
| Debian 12 | python3.11 | Fix pending | DEBIAN-CVE-2026-6879 | |
| Alpine Linux 3.24 | python3 | Fixed | 3.14.7-r0 | ALPINE-CVE-2026-6879 |
What the vendor says
As published in the CVE record by PSF, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- Python Software Foundation CPython: affected: before 3.10.21, 3.11.0 to before 3.11.16, 3.12.0 to before 3.12.14, 3.13.0 to before 3.13.15, 3.14.0 to before 3.14.7, 3.15.0a1 to before 3.15.0rc1; fixed in
3.10.21,3.11.16,3.12.14,3.13.15,3.14.7,3.15.0rc1
Vendor advisories:
- https://github.com/python/cpython/pull/152676 (patch)
- https://mail.python.org/archives/list/security-announce@python.org/thread/7YMZ6DDZVR26TJJ… (vendor-advisory)
- https://github.com/python/cpython/commit/2ffab083782968a4d732738f4f1dff6bbd69d2b0 (patch)
- https://github.com/python/cpython/commit/02c08e6b747ac43d0d866a4ffa916bedf3423f81 (patch)
- https://github.com/python/cpython/commit/390337b8ba1658833fdef379e1739c9f9533a8db (patch)
- https://github.com/python/cpython/commit/cb409342a19f25656f62e679f8bac265fe1442c3 (patch)
References
- https://github.com/python/cpython/pull/152676
- https://github.com/python/cpython/issues/152674
- https://mail.python.org/archives/list/security-announce@python.org/thread/7YMZ6DDZVR26TJJBVO3RDNBAVGHNYAKR/
- https://github.com/python/cpython/commit/2ffab083782968a4d732738f4f1dff6bbd69d2b0
- https://github.com/python/cpython/commit/02c08e6b747ac43d0d866a4ffa916bedf3423f81
- https://github.com/python/cpython/commit/390337b8ba1658833fdef379e1739c9f9533a8db
- https://github.com/python/cpython/commit/cb409342a19f25656f62e679f8bac265fe1442c3
- https://github.com/python/cpython/commit/96510a3758f4a075f43223afdee3b6ee1a7a7f02
- https://github.com/python/cpython/commit/037965c00a427cba5c05447efadc67c51a492e85
- https://github.com/python/cpython/commit/0583f24ae678993e3f7939f51ad5bcae5ad9dc70
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.