Skip to main content

libexpat CVE-2026-76957

| EUVDEUVD-2026-63196 HIGH
Use After Free (CWE-416)
2026-08-20 mitre GHSA-vfgp-2986-rm7g
7.8
CVSS 3.1 · NVD
View

Attack ChainAIDerived

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

  1. Access
    Identify application using XML_SetUnknownEncodingHandler
  2. Delivery
    Craft XML with custom encoding declaring 0x80 byte
  3. Exploit
    Supply document to vulnerable libexpat parser
  4. Execution
    convert callback re-enters parser during character processing
  5. Persist
    Use-after-free corrupts heap structures
  6. Impact
    Achieve arbitrary code execution in process context

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 three concurrent conditions: (1) the target application must use the XML_SetUnknownEncodingHandler API with application-supplied convert and/or release callbacks - default libexpat deployments without custom encoding handlers are not reachable; (2) the attacker must be able to supply attacker-controlled XML content to the parsing application, achievable either via local file placement or through any network-facing feature that passes user data to the vulnerable parser; (3) the attacker needs at least low-privilege local access (PR:L per CVSS AV:L) to deliver the malicious document. The flaw is not remotely exploitable in isolation; exploitation is limited to applications actively using the custom encoding handler extension point and accepting untrusted XML input.

Impact

CVSS 7.8 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H) reflects a realistic worst-case outcome - full process compromise - but the local attack vector sharply limits who can trigger it: an attacker must be able to supply a malicious XML file to an application that uses libexpat with a custom unknown encoding handler. EPSS 0.10% (1st percentile) and SSVC Exploitation:none confirm no observed in-the-wild use. Notably, the SSVC Technical Impact of 'partial' appears to understate the CVSS C:H/I:H/A:H; this discrepancy likely reflects SSVC accounting for real-world exploitation difficulty (local vector, requires custom encoding handler to be configured) rather than theoretical impact ceiling. The serial nature of related CVEs (CVE-2026-50219, CVE-2026-56131, CVE-2026-56412) indicates systematic reentrancy hardening is underway in the project; this pattern may attract researcher attention. Priority should be moderate: apply the patch in maintenance cycles, with urgency elevated for deployments where untrusted XML is parsed by privileged processes (e.g., daemons, setuid utilities).

Exploit ScenarioDerived

An attacker with local access supplies a crafted XML document declaring a non-standard character encoding (e.g., 'reentrant-conv') to an application that invokes XML_SetUnknownEncodingHandler. When the parser encounters byte 0x80 routed through the custom convert callback, the callback re-enters the parser by invoking a character handler, corrupting the parser's internal encoding state and triggering use-after-free of heap-allocated parser structures, which the attacker leverages to redirect execution. No public proof-of-concept exploit has been identified at time of analysis, but the upstream test case in misc_tests.c demonstrates controlled triggering of the reentrancy condition.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.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

AnalysisAIv2 – Sep 08, 2026

Use-after-free in libexpat before 2.8.4 enables a local low-privileged attacker to corrupt parser memory and potentially achieve arbitrary code execution by supplying a crafted XML document with custom encoding callbacks. The flaw stems from the unknown encoding callback path (convert/release handlers) bypassing the reentrancy depth-tracking guards applied to all other libexpat callbacks, allowing an attacker-controlled callback to re-enter the parser and corrupt its state. No public exploit or active exploitation (CISA KEV) has been identified; EPSS is 0.10% (1st percentile), though this belongs to a confirmed series of related reentrancy fixes in libexpat (CVE-2026-50219, CVE-2026-56131, CVE-2026-56412) and Red Hat has already shipped a backported errata.

Earlier versions of this analysis (1)
v1 Aug 20, 2026 - 05:00 CVSS 4.9

Use-after-free in libexpat before 2.8.4 allows an attacker who can supply crafted XML with a custom unknown-encoding declaration to corrupt parser memory when the encoding convert or release callback re-enters the parser without handler-depth tracking. Affected applications are those that register an UnknownEncodingHandler via XML_SetUnknownEncodingHandler - a non-default but legitimate usage pattern. No public exploit code or CISA KEV listing has been identified at time of analysis, and the CVSS score of 4.9 with AV:L/AC:H reflects the constrained exploitation prerequisites, though the library's wide deployment footprint elevates aggregate risk.

RemediationAI

Upgrade libexpat to version 2.8.4 or later, which introduces callUnknownEncodingConvert() and callUnknownEncodingRelease() wrappers to enforce reentrancy depth tracking on custom encoding callbacks. Red Hat users should apply RHSA-2026:60451 via standard package management. For distributions that have not yet shipped 2.8.4, applying the upstream patches from PR #1322 and PR #1329 (https://github.com/libexpat/libexpat/pull/1322, https://github.com/libexpat/libexpat/pull/1329) against the packaged source is a viable interim measure. If patching is not immediately possible, restrict which applications can parse externally supplied XML with custom encoding handlers; specifically, if an application calls XML_SetUnknownEncodingHandler, auditing whether untrusted input reaches the parser reduces exposure without requiring downtime. There are no known safe in-process workarounds that fully mitigate the flaw without code changes.

Affected VersionsENISA

libexpat 0 <2.8.4

Affected Packages

euvd libexpat fix: 2.8.4

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:2.3:a:libexpat_project:libexpat, all versions before 2.8.4) is the Expat XML parsing C library, widely embedded in Python, Firefox, Apache httpd, and countless system packages. The XML_SetUnknownEncodingHandler API lets applications supply custom convert and release callbacks to handle non-standard character encodings. All other libexpat callbacks (character data, element start/end, etc.) are wrapped by beforeHandler()/afterHandler() guards that track call depth and prevent reentrancy. The unknown encoding callbacks were not wrapped, so a crafted XML document with a custom encoding can invoke the convert callback during parsing; that callback can then re-invoke parser-modifying operations (e.g., trigger a character handler), leading to use-after-free (CWE-416) of parser-internal structures. The fix in PR #1322 introduces callUnknownEncodingConvert() and callUnknownEncodingRelease() wrapper functions that bracket encoding callbacks with the existing depth-tracking guards, and clears encoding data pointers after release to prevent dangling references.

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 7.8 HIGH
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 7.8 HIGH

Local vector and low privileges align with supplying a malicious file to an application; custom encoding handler is a prerequisite but AC:L because no race condition or unusual configuration beyond that is required.

3.1 AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
4.0 AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/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
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

4
Severity Changed
Sep 08, 2026 - 21:08 NVD
MEDIUM HIGH
CVSS changed
Sep 08, 2026 - 21:08 NVD
4.9 (MEDIUM) 7.8 (HIGH)
Patch available
Aug 20, 2026 - 05:01 EUVD
CVE Published
Aug 20, 2026 - 04:28 cve.org
MEDIUM 4.9

DescriptionNVD

libexpat before 2.8.4 lacks handler call depth tracking with custom encoding callbacks. Thus, a use-after-free can occur. NOTE: this is similar to CVE-2026-50219, CVE-2026-56131 and CVE-2026-56412.

Executive ViewAI

Why It Matters

libexpat versions prior to 2.8.4 contain a use-after-free vulnerability enabling local low-privileged attackers to corrupt XML parser memory and potentially execute arbitrary code through specially crafted XML documents. While the EPSS score of 0.1% indicates minimal exploitation likelihood and no public exploit has been identified, this widely-deployed parsing library is foundational infrastructure in data processing pipelines across most enterprise environments, warranting prompt patching.

Business Impact: High
Compensating Controls

Apply vendor patch: libexpat 2.8.4 or later.

Threat Intelligence Overview

EPSS Score
0.1%
Top 99% exploitable
Prevalence
High
embedded in Python, Firefox, Apache, and most Linux distributions
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment MSRC Vendor 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 HIGH
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.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
Scheduled
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact
High
Technical Impact
Partial

Priority Score

39
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +39
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-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-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-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-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

CVE-2024-45491 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
SUSE Linux Enterprise Desktop 15 SP7 Affected
SUSE Linux Enterprise High Performance Computing 12 Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Affected
SUSE Linux Enterprise Micro 5.3 Affected
SUSE Linux Enterprise Micro 5.4 Affected

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