# CVE-2026-6879: Quadratic Behavior in xml.etree.ElementPath Index Predicates

> Attackers can cause denial of service in Python applications by crafting XML documents that trigger quadratic time complexity in ElementPath index predicates.

- **Severity:** Low 2.0 (`CVSS:4.0/AV:N/AC:H/AT:P/PR:H/UI:P/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 28 Jul 2026
- **Updated:** 13 Aug 2026
- **Also known as:** ALPINE-CVE-2026-6879, AZL-94157, AZL-94299, BELL-CVE-2026-6879, BIT-libpython-2026-6879, BIT-python-2026-6879, BIT-python-min-2026-6879, DEBIAN-CVE-2026-6879, ECHO-b4f7-133a-6293, GHSA-77qw-3xm6-r2pp, MINI-55xp-2jm7-3qfv, MINI-852j-mq6w-2jrf, MINI-9c36-jq5h-fq7v, MINI-mhm7-2xm2-wqh7, MINI-wqr5-3qfj-vp55, OESA-2026-3252, OESA-2026-3253, OESA-2026-3396, OESA-2026-3433, PSF-2026-34, RHSA-2026:48238, RHSA-2026:48246, RHSA-2026:48253, RHSA-2026:48278, RHSA-2026:48279, UBUNTU-CVE-2026-6879

## What is CVE-2026-6879?

CVE-2026-6879 is a low-severity denial of service vulnerability in CPython, published on 28 Jul 2026. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.

### Official 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.

Weakness: CWE-407 (Inefficient Algorithmic Complexity)

## Which versions are affected by CVE-2026-6879?

3 open source packages ship an affected version, including libpython, python and python-min.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libpython` | Bitnami | All versions | 3.10.21, 3.11.16, 3.12.14, 3.13.15, 3.14.7 |
| `python` | Bitnami | All versions | 3.10.21, 3.11.16, 3.12.14, 3.13.15, 3.14.7 |
| `python-min` | Bitnami | All versions | 3.10.21, 3.11.16, 3.12.14, 3.13.15, 3.14.7 |
| `python-unversioned-command` | Red Hat:hummingbird:1 | All versions | 0:3.14.6-2.2.hum1 |
| `python3` | Red Hat:hummingbird:1 | All versions | 0:3.14.6-2.2.hum1 |
| `python3-debug` | Red Hat:hummingbird:1 | All versions | 0:3.14.6-2.2.hum1 |
| `python3-devel` | Red Hat:hummingbird:1 | All versions | 0:3.14.6-2.2.hum1 |
| `python3-idle` | Red Hat:hummingbird:1 | All versions | 0:3.14.6-2.2.hum1 |
| `python3-libs` | Red Hat:hummingbird:1 | All versions | 0:3.14.6-2.2.hum1 |
| `python3-test` | Red Hat:hummingbird:1 | All versions | 0:3.14.6-2.2.hum1 |
| `python3-tkinter` | Red Hat:hummingbird:1 | All versions | 0:3.14.6-2.2.hum1 |
| `python3.10` | Red Hat:hummingbird:1 | All versions | 0:3.10.20-3.2.hum1 |
| `python3.10-debug` | Red Hat:hummingbird:1 | All versions | 0:3.10.20-3.2.hum1 |
| `python3.10-devel` | Red Hat:hummingbird:1 | All versions | 0:3.10.20-3.2.hum1 |
| `python3.10-idle` | Red Hat:hummingbird:1 | All versions | 0:3.10.20-3.2.hum1 |
| `python3.10-libs` | Red Hat:hummingbird:1 | All versions | 0:3.10.20-3.2.hum1 |
| `python3.10-test` | Red Hat:hummingbird:1 | All versions | 0:3.10.20-3.2.hum1 |
| `python3.10-tkinter` | Red Hat:hummingbird:1 | All versions | 0:3.10.20-3.2.hum1 |
| `python3.11` | Red Hat:hummingbird:1 | All versions | 0:3.11.15-5.5.hum1 |
| `python3.11-debug` | Red Hat:hummingbird:1 | All versions | 0:3.11.15-5.5.hum1 |
| `python3.11-devel` | Red Hat:hummingbird:1 | All versions | 0:3.11.15-5.5.hum1 |
| `python3.11-idle` | Red Hat:hummingbird:1 | All versions | 0:3.11.15-5.5.hum1 |
| `python3.11-libs` | Red Hat:hummingbird:1 | All versions | 0:3.11.15-5.5.hum1 |
| `python3.11-test` | Red Hat:hummingbird:1 | All versions | 0:3.11.15-5.5.hum1 |
| `python3.11-tkinter` | Red Hat:hummingbird:1 | All versions | 0:3.11.15-5.5.hum1 |
| `python3.12` | Red Hat:hummingbird:1 | All versions | 0:3.12.13-3.8.hum1 |
| `python3.12-debug` | Red Hat:hummingbird:1 | All versions | 0:3.12.13-3.8.hum1 |
| `python3.12-devel` | Red Hat:hummingbird:1 | All versions | 0:3.12.13-3.8.hum1 |
| `python3.12-idle` | Red Hat:hummingbird:1 | All versions | 0:3.12.13-3.8.hum1 |
| `python3.12-libs` | Red Hat:hummingbird:1 | All versions | 0:3.12.13-3.8.hum1 |
| `python3.12-test` | Red Hat:hummingbird:1 | All versions | 0:3.12.13-3.8.hum1 |
| `python3.12-tkinter` | Red Hat:hummingbird:1 | All versions | 0:3.12.13-3.8.hum1 |
| `python3.13` | Red Hat:hummingbird:1 | All versions | 0:3.13.14-1.7.hum1 |
| `python3.13-debug` | Red Hat:hummingbird:1 | All versions | 0:3.13.14-1.7.hum1 |
| `python3.13-devel` | Red Hat:hummingbird:1 | All versions | 0:3.13.14-1.7.hum1 |
| `python3.13-freethreading` | Red Hat:hummingbird:1 | All versions | 0:3.13.14-1.7.hum1 |
| `python3.13-freethreading-debug` | Red Hat:hummingbird:1 | All versions | 0:3.13.14-1.7.hum1 |
| `python3.13-idle` | Red Hat:hummingbird:1 | All versions | 0:3.13.14-1.7.hum1 |
| `python3.13-libs` | Red Hat:hummingbird:1 | All versions | 0:3.13.14-1.7.hum1 |
| `python3.13-test` | Red Hat:hummingbird:1 | All versions | 0:3.13.14-1.7.hum1 |

## How do I fix CVE-2026-6879?

Upgrade libpython to a fixed version for your release line: 3.10.21, 3.11.16, 3.12.14 or 3.13.15.

## Is CVE-2026-6879 being exploited?

There is no known exploitation of CVE-2026-6879 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-6879 and fix it if it is affected.

What it is: CVE-2026-6879 is a low-severity denial of service vulnerability in CPython, published on 28 Jul 2026. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-6879 in the wild and no public exploit code.

Affected packages and fixed versions:
- libpython (Bitnami): affected all versions; fixed in 3.10.21, 3.11.16, 3.12.14, 3.13.15, 3.14.7
- python (Bitnami): affected all versions; fixed in 3.10.21, 3.11.16, 3.12.14, 3.13.15, 3.14.7
- python-min (Bitnami): affected all versions; fixed in 3.10.21, 3.11.16, 3.12.14, 3.13.15, 3.14.7

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-6879/ (Markdown: https://insights.sbomify.com/CVE-2026-6879/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-6879
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-6879
- OSV: https://osv.dev/vulnerability/CVE-2026-6879

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-6879/
Summaries are generated and may contain mistakes; the official description above is the record.
