CVE Database›CVE-2022-40674

CVE-2022-40674

expat: a use-after-free in the doContent function in xmlparse.c

Loading…

Severity

Important

Red Hat Product Security

8.1

CVSS 3.1

Review impact separately from score.

Published · September 14, 2022

Updated · October 9, 2026

Description

A vulnerability was found in expat. With this flaw, it is possible to create a situation in which parsing is suspended while substituting in an internal entity so that XML_ResumeParser directly uses the internalEntityProcessor as its processor. If the subsequent parse includes some unclosed tags, this will return without calling storeRawNames to ensure that the raw versions of the tag names are stored in memory other than the parse buffer itself. Issues occur if the parse buffer is changed or reallocated (for example, if processing a file line by line), problems occur. Using this vulnerability in the doContent function allows an attacker to triage a denial of service or potentially arbitrary code execution.

Statement

This flaw is rated as important because this flaw can easily compromise the confidentiality, integrity, or availability of resources but a successful attack can not execute arbitrary code, or allow remote users to cause a denial of service because attack complexity is high and depends on conditions beyond the attacker's control.

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 XML content. Please update the affected packages as soon as possible.

CVSS / CWE

CVSS 3.1 · 8.1
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

CWE-416 · Use After Free