Skip to main content

libexpat CVE-2026-56412

| EUVDEUVD-2026-38189 MEDIUM
Use After Free (CWE-416)
2026-06-21 mitre GHSA-m2mm-5w64-p8p7
5.9
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Supply crafted XML with malicious CDATA section
  2. Delivery
    Trigger XML_TOK_DATA_CHARS processing in doCdataSection
  3. Exploit
    Induce policy violation during handler callback
  4. Install
    Bypass missing beforeHandler/afterHandler depth tracking
  5. C2
    Corrupt handler call-depth counter
  6. Execute
    Trigger use-after-free in parser heap
  7. Impact
    Achieve limited memory corruption or disclosure

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Memory lifecycle management
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires all of the following: (1) the target application must use libexpat at a version prior to 2.8.2; (2) the application must register XML event handlers that are invoked during CDATA section parsing - applications that parse XML without custom handler callbacks are not affected in the same way; (3) a policy violation must be triggered during handler invocation while processing a XML_TOK_DATA_CHARS token inside a CDATA section, which is a non-default and specific XML structural condition. The high attack complexity (AC:H) reflects that reaching the use-after-free state requires this precise combination of handler configuration, XML structure, and policy-violation trigger. The local attack vector (AV:L per NVD) limits the formal attack surface to file-based or process-local XML parsing, though applications that accept XML documents from network sources extend the practical reach. Authentication is not required per the PR:N metric. Exploitation is meaningfully limited by the need for a handler-registration pattern that encounters a policy violation specifically within CDATA data-character processing, which is not a default parser state.

Impact

The NVD-assigned CVSS score of 4.9 with vector AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L reflects a moderate-to-low real-world risk profile with several important caveats. AV:L is conservative for a library vulnerability: libexpat routinely processes XML delivered over the network through higher-level applications, meaning network-exposed services effectively inherit a broader attack surface than AV:L implies - this is a notable discrepancy to verify in deployment context. AC:H correctly captures that exploitation requires a specific conjunction of handler registration, CDATA section processing, and a policy-violation scenario, which is not a default or trivially reached state. CIA impact is uniformly Low, consistent with a use-after-free that is difficult to control reliably for primitive exploitation. No EPSS score was included in the source intelligence, and no CISA KEV listing exists, meaning no confirmed active exploitation has been recorded. The absence of identified public proof-of-concept code further reduces immediate urgency. Despite the modest raw score, libexpat's ubiquity as a transitive dependency in broadly deployed software ecosystems makes broad patch adoption important to prevent silent accumulation of risk across downstream consumers.

Exploit ScenarioDerived

An attacker crafts a malicious XML document containing a CDATA section that triggers a policy violation during event handler callback invocation within doCdataSection, specifically on a XML_TOK_DATA_CHARS token. When a libexpat-consuming application - such as a web API, messaging middleware, or content management platform - parses this document, the missing depth-tracking calls leave the parser's internal call-depth counter inconsistent, triggering a use-after-free. Depending on heap layout at the time of exploitation, the outcome may range from a crash and denial of service to limited memory disclosure; no public proof-of-concept code exists at time of analysis.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 22, 2026

Use-after-free in libexpat before 2.8.2 arises from the doCdataSection function omitting beforeHandler/afterHandler depth-tracking calls for XML_TOK_DATA_CHARS tokens during CDATA section parsing - an incomplete fix for the related CVE-2026-50219. When a policy violation occurs during handler callback invocation in this code path, the parser's internal call-depth counter becomes inconsistent, enabling a use-after-free condition. An attacker supplying specially crafted XML to any libexpat-consuming application may trigger limited memory corruption, information disclosure, or availability impact under high-complexity conditions; no public exploit is identified at time of analysis and no CISA KEV listing exists.

RemediationAI

Upgrade libexpat to version 2.8.2 or later, which introduces the missing beforeHandler(parser) and afterHandler(parser) depth-tracking calls in the XML_TOK_DATA_CHARS branch of doCdataSection. The upstream fix is tracked at https://github.com/libexpat/libexpat/pull/1278 and the fix version 2.8.2 is confirmed by EUVD-2026-38189. Note that the fix version is inferred from the upstream PR and EUVD data rather than a standalone dedicated security advisory - verify against the official libexpat release page. For environments unable to patch immediately, restrict XML inputs to trusted and validated sources only, preventing untrusted parties from supplying CDATA-containing XML to the parser (trade-off: limits functionality for legitimate use cases involving external XML feeds). Applications using Python's pyexpat, PHP, or other runtimes that bundle libexpat must update those runtime versions independently, as library-level patching of the embedded copy requires a runtime or vendor update rather than an OS-level patch.

Affected VersionsENISA

libexpat 0 <2.8.2

Affected Packages

euvd libexpat fix: 2.8.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

libexpat (CPE: cpe:2.3:a:libexpat_project:libexpat:*:*:*:*:*:*:*:*) is a widely-embedded C XML parsing library used as a direct or transitive dependency across Python (pyexpat), PHP, D-Bus, and numerous other runtimes. The flaw (CWE-416: Use-After-Free) is located in the doCdataSection function within expat/lib/xmlparse.c. Internal wrappers beforeHandler() and afterHandler() maintain a call-depth counter that governs whether nested handler invocations are safe. The original CVE-2026-50219 fix added these guards to some handler invocation sites; this CVE documents that the XML_TOK_DATA_CHARS branch inside doCdataSection was missed. When that token type is encountered and a policy violation is raised, handlers are called without depth tracking, leaving the heap state inconsistent and creating a use-after-free window. The upstream fix (PR #1278) inserts matching beforeHandler/afterHandler calls in the omitted branches.

Know when Libexpat gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (mitre) PRIMARY MEDIUM
NVD 5.9 MEDIUM
AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
vuln.today AI 5.6 MEDIUM

AV:N assigned because libexpat commonly parses XML delivered over the network via consuming applications; AC:H retained reflecting the specific policy-violation handler conditions required.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N
SUSE 4.9 MEDIUM
AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
Red Hat 4.9 MEDIUM

Primary rating from Vendor (mitre).

CVSS VectorNVD

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
Low

Lifecycle Timeline

2
CVSS changed
Jun 23, 2026 - 15:53 NVD
4.9 (MEDIUM) 5.9 (MEDIUM)
Patch available
Jun 21, 2026 - 18:01 EUVD

DescriptionNVD

libexpat before 2.8.2 does not consider XML_TOK_DATA_CHARS in doCdataSection and thus lacks handler call depth tracking for various calls from within handlers in cases of a policy violation. Thus, a use-after-free can occur. NOTE: this issue exists because of an incomplete fix for CVE-2026-50219.

Threat Intelligence Overview

EPSS Score
0.1%
Top 99% exploitable
Social Media
1
Sightings
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment MSRC Vendor CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

30
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Use-after-free vulnerabilities occur when a program continues to access memory through a pointer after that memory has been deallocated.

Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

CVE-2022-25315 CRITICAL POC
9.8 Feb 18

In Expat (aka libexpat) before 2.4.5, there is an integer overflow in storeRawNames. Rated critical severity (CVSS 9.8),

CVE-2025-59375 HIGH POC
7.5 Sep 15

libexpat in Expat before 2.7.2 allows attackers to trigger large dynamic memory allocations via a small document that is

CVE-2019-15903 HIGH POC
7.5 Sep 04

In libexpat before 2.2.8, crafted XML input could fool the parser into changing from DTD parsing to document parsing too

CVE-2026-115506 HIGH POC
8.7 Oct 22

CPU exhaustion in libexpat through 2.9.0 lets remote attackers stall XML parsing workloads by supplying a moderately siz

CVE-2026-93990 HIGH POC
8.7 Sep 19

Malformed UTF-16 decoding in libexpat through 2.8.4 lets remote attackers hide XML markup from the parser: a lone high s

CVE-2022-43680 HIGH POC
7.5 Oct 24

In libexpat through 2.4.9, there is a use-after free caused by overeager destruction of a shared DTD in XML_ExternalEnti

CVE-2024-28757 HIGH POC
7.5

Alpine Linux: expat fixed in 2.6.2-r0

CVE-2017-9233 HIGH POC
7.5 Jul 25

XML External Entity vulnerability in libexpat 2.2.0 and earlier (Expat XML Parser Library) allows attackers to put the p

CVE-2026-45186 HIGH POC
7.5 May 10

Denial of service in libexpat before 2.8.1 lets remote attackers exhaust CPU by submitting moderately sized crafted XML

CVE-2013-0340 MEDIUM POC
6.8 Jan 21

expat before version 2.4.0 does not properly handle entities expansion unless an application developer uses the XML_SetE

CVE-2016-0718 CRITICAL
9.8 May 26

Expat allows context-dependent attackers to cause a denial of service (crash) or possibly execute arbitrary code via a m

CVE-2024-45492 CRITICAL
9.8 Aug 30

An issue was discovered in libexpat before 2.6.3. Rated critical severity (CVSS 9.8), this vulnerability is remotely exp

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SLES15-SP5-CHOST-BYOS-SAP-CCloud Not-Affected
SLES15-SP5-CHOST-BYOS-SAP-CCloud Affected
SLES15-SP6-CHOST-BYOS Affected
SLES15-SP6-CHOST-BYOS-Aliyun Affected
SLES15-SP6-CHOST-BYOS-Azure Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy