2026-03-16 17:52CVE-2026-4224PSF
PUBLISHED5.2

Stack overflow parsing XML with deeply nested DTD content models

When an Expat parser with a registered ElementDeclHandler parses an inline

document type definition containing a deeply nested content model a C stack

overflow occurs.

Affected products

Python Software Foundation

CPython

< 3.15.0 - AFFECTED

References

GitHub Security Advisories

GHSA-h46w-ffvp-4pw5

When an Expat parser with a registered ElementDeclHandler parses an inline document type...

https://github.com/advisories/GHSA-h46w-ffvp-4pw5

When an Expat parser with a registered ElementDeclHandler parses an inline document type definition containing a deeply nested content model a C stack overflow occurs.

JSON source

https://cveawg.mitre.org/api/cve/CVE-2026-4224
Click to expand
{
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "cveMetadata": {
    "cveId": "CVE-2026-4224",
    "assignerOrgId": "28c92f92-d60d-412d-b760-e73465c3df22",
    "assignerShortName": "PSF",
    "dateUpdated": "2026-03-16T18:21:11.567Z",
    "dateReserved": "2026-03-15T18:10:54.886Z",
    "datePublished": "2026-03-16T17:52:26.639Z",
    "state": "PUBLISHED"
  },
  "containers": {
    "cna": {
      "providerMetadata": {
        "orgId": "28c92f92-d60d-412d-b760-e73465c3df22",
        "shortName": "PSF",
        "dateUpdated": "2026-03-16T17:59:17.205Z"
      },
      "title": "Stack overflow parsing XML with deeply nested DTD content models",
      "descriptions": [
        {
          "lang": "en",
          "value": "When an Expat parser with a registered ElementDeclHandler parses an inline\ndocument type definition containing a deeply nested content model a C stack\noverflow occurs.",
          "supportingMedia": [
            {
              "type": "text/html",
              "base64": false,
              "value": "When an Expat parser with a registered ElementDeclHandler parses an inline\ndocument type definition containing a deeply nested content model a C stack\noverflow occurs."
            }
          ]
        }
      ],
      "affected": [
        {
          "vendor": "Python Software Foundation",
          "product": "CPython",
          "repo": "https://github.com/python/cpython",
          "defaultStatus": "unaffected",
          "versions": [
            {
              "version": "0",
              "status": "affected",
              "versionType": "python",
              "lessThan": "3.15.0"
            }
          ]
        }
      ],
      "references": [
        {
          "url": "https://github.com/python/cpython/commit/eb0e8be3a7e11b87d198a2c3af1ed0eccf532768",
          "tags": [
            "patch"
          ]
        },
        {
          "url": "https://mail.python.org/archives/list/security-announce@python.org/thread/5M7CGUW3XBRY7II4DK43KF7NQQ3TPZ6R/",
          "tags": [
            "vendor-advisory"
          ]
        },
        {
          "url": "https://github.com/python/cpython/issues/145986",
          "tags": [
            "issue-tracking"
          ]
        },
        {
          "url": "https://github.com/python/cpython/pull/145987",
          "tags": [
            "patch"
          ]
        },
        {
          "url": "https://github.com/python/cpython/commit/196edfb06a7458377d4d0f4b3cd41724c1f3bd4a",
          "tags": [
            "patch"
          ]
        },
        {
          "url": "https://github.com/python/cpython/commit/e0a8a6da90597a924b300debe045cdb4628ee1f3",
          "tags": [
            "patch"
          ]
        }
      ],
      "metrics": [
        {
          "format": "CVSS",
          "scenarios": [
            {
              "lang": "en",
              "value": "GENERAL"
            }
          ]
        }
      ],
      "credits": [
        {
          "lang": "en",
          "value": "Gil Portnoy",
          "type": "reporter"
        },
        {
          "lang": "en",
          "value": "Stan Ulbrych",
          "type": "remediation developer"
        },
        {
          "lang": "en",
          "value": "Bénédikt Tran",
          "type": "remediation reviewer"
        },
        {
          "lang": "en",
          "value": "Stan Ulbrych",
          "type": "coordinator"
        }
      ]
    },
    "adp": [
      {
        "providerMetadata": {
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP",
          "dateUpdated": "2026-03-16T18:21:11.567Z"
        },
        "title": "CISA ADP Vulnrichment",
        "problemTypes": [
          {
            "descriptions": [
              {
                "lang": "en",
                "description": "CWE-674 Uncontrolled Recursion",
                "cweId": "CWE-674",
                "type": "CWE"
              }
            ]
          }
        ],
        "metrics": [
          {}
        ]
      }
    ]
  }
}