CVE-2026-6879

Quadratic Behavior in xml.etree.ElementPath Index Predicates

State
Published
Severity
2.0 Low
Published
Jul 28, 2026
Updated
Aug 13, 2026
Reserved
Apr 22, 2026

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
4.02.0 LowCVSS:4.0/AV:N/AC:H/AT:P/PR:H/UI:P/VC:N/VI:N/VA:L/SC:N/SI:N/SA:NPSF

Weaknesses

  • CWE-407 Inefficient Algorithmic Complexity

Affected Products

ProductVersions
CPythonPython Software Foundation
  • before 3.10.21Affected
  • 3.11.0 to before 3.11.16Affected
  • 3.12.0 to before 3.12.14Affected
  • 3.13.0 to before 3.13.15Affected
  • 3.14.0 to before 3.14.7Affected
  • 3.15.0a1 to before 3.15.0rc1Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.