Impact
PyPy prior to versions 3.11.16 and 3.12.14 has a use‑after‑free flaw in the pyexpat module’s ExternalEntityParserCreate function. The flaw arises when an external‑entity sub‑parser is created without keeping a reference to its parent. The child parser holds a raw C back‑pointer to the parent’s struct, and PyPy’s tracing garbage collector may free this parent struct while the child still accesses it. Each parsed token then causes bundled libexpat to dereference the freed memory, resulting in corruption. This corruption can be exploited to hijack program flow or inject code, representing a significant confidentiality, integrity, and availability risk.
Affected Systems
The vulnerability affects the PyPy distribution. Specifically, any installation of PyPy 3.11.x earlier than 3.11.16 or PyPy 3.12.x earlier than 3.12.14 is impacted. All other PyPy releases are considered unaffected until a new advisory is issued.
Risk and Exploitability
The CVSS score of 6.3 indicates moderate severity. EPSS data is not available, and the issue is not listed in the CISA KEV catalog, suggesting no publicly known exploits have been reported yet. However, because the flaw requires a crafted XML document and an application using pyexpat with external entities, the attack vector is likely local or requires remote delivery of malicious XML to a vulnerable application. An attacker controlling XML input could trigger memory corruption during parsing, potentially leading to arbitrary code execution.
OpenCVE Enrichment