PyPy pyexpat ExternalEntityParserCreate Use-After-Free
PyPy
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| PyPy PyPy |
| No fix yet |
Original description
PyPy before versions 3.11.16 and 3.12.14 contains a use-after-free vulnerability in the pyexpat module's ExternalEntityParserCreate function that allows attackers to corrupt memory by supplying a crafted XML document to applications that create external-entity sub-parsers without retaining a reference to the parent parser. The child parser retains a raw C back-pointer to the parent parser struct while PyPy's tracing garbage collector can free the parent's C struct, causing bundled libexpat to dereference the freed pointer on every parsed token, producing memory corruption.
From the CVE record · VulnCheck
References
- doc.pypy.org/release-v8.0.0.html
- github.com/pypy/pypy/releases/tag/release-pypy3.12-v8.0.0Patch
- github.com/pypy/pypy/releases/tag/release-pypy3.11-v8.0.0Patch
- vulncheck.com/advisories/pypy-pyexpat-externalentityparsercreate-use-after-free
- github.com/CVEProject/cvelistV5/tree/main/cves/2026/76xxx/CVE-2026-76875.json
- nvd.nist.gov/vuln/detail/CVE-2026-76875
- github.com/pypy/pypy