CVE-2022-25235
expat: Malformed 2- and 3-byte UTF-8 sequences can lead to arbitrary code execution
Severity
ImportantRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · February 19, 2022
Updated · October 9, 2026
Description
A flaw was found in expat. Passing malformed 2- and 3-byte UTF-8 sequences (for example, from start tag names) to the XML processing application on top of expat can lead to arbitrary code execution. This issue is dependent on how invalid UTF-8 is handled inside the XML processor.
Statement
This flaw affects applications that leverage expat to parse untrusted XML files. Applications that only parse trusted XML files or do not process XML files at all are not affected by this flaw.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
There is no known mitigation other than restricting applications using the expat library from processing untrusted XML content. Please update the affected packages as soon as possible.
CVSS / CWE
CVSS 3.1 · 9.8CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CWE-838 · Inappropriate Encoding for Output Context