{
  "affected": [
    {
      "ranges": [
        {
          "database_specific": {
            "source": "REFERENCES"
          },
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2ffab083782968a4d732738f4f1dff6bbd69d2b0"
            }
          ],
          "repo": "https://github.com/python/cpython",
          "type": "GIT"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "PSF",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/6xxx/CVE-2026-6879.json",
    "unresolved_ranges": [
      {
        "extracted_events": [
          {
            "fixed": "3.15.0"
          }
        ],
        "source": "AFFECTED_FIELD"
      }
    ]
  },
  "details": "`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.",
  "id": "CVE-2026-6879",
  "modified": "2026-07-30T03:52:40.743356043Z",
  "published": "2026-07-28T13:46:30.650Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/6xxx/CVE-2026-6879.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://mail.python.org/archives/list/security-announce@python.org/thread/7YMZ6DDZVR26TJJBVO3RDNBAVGHNYAKR/"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-6879"
    },
    {
      "type": "REPORT",
      "url": "https://github.com/python/cpython/issues/152674"
    },
    {
      "type": "FIX",
      "url": "https://github.com/python/cpython/commit/2ffab083782968a4d732738f4f1dff6bbd69d2b0"
    },
    {
      "type": "FIX",
      "url": "https://github.com/python/cpython/pull/152676"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/python/cpython"
    }
  ],
  "schema_version": "1.8.0",
  "severity": [
    {
      "score": "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",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Quadratic Behavior in xml.etree.ElementPath Index Predicates"
}