Skip to main content

libexpat CVE-2026-56403

| EUVDEUVD-2026-38180 MEDIUM
Integer Overflow or Wraparound (CWE-190)
2026-06-21 mitre GHSA-xqw9-f65g-5qxw
6.9
CVSS 3.1 · NVD
View

Attack ChainAIDerived

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

  1. Recon
    Craft XML with oversized namespace prefix
  2. Delivery
    Deliver document to libexpat-based parser
  3. Exploit
    storeAtts accumulates prefix length past INT_MAX
  4. Install
    Integer overflow yields small totalLen
  5. C2
    Undersized heap buffer allocated
  6. Execute
    memcpy corrupts adjacent heap memory
  7. Impact
    Arbitrary code execution or process crash

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Integer overflow checks
MITRE ATT&CK

1 technique across 1 tactic: Execution

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

Exploitation Conditions

Exploitation requires that the target application uses libexpat before 2.8.2 to parse attacker-controlled XML that includes namespace-qualified attributes - specifically, the vulnerable storeAtts() code path is only reached when the parsed XML uses XML namespace bindings (xmlns: prefix declarations); plain XML documents without namespace usage do not enter the affected code. The namespace prefix name or XML local-part name must be crafted to approach or exceed INT_MAX (~2.1 billion) bytes in length, a condition that is AC:H because it demands deliberate construction and will frequently be blocked by upstream protocol message-size limits (e.g., HTTP max body size, SAML message constraints, or OS pipe limits). The library itself imposes no authentication requirement, but the calling application's access controls determine whether external, unauthenticated parties can supply XML documents. No non-default libexpat compile-time or runtime configuration is required; the vulnerability is present in the default build. Exploitation is limited in practice by allocator hardening (ASLR, heap metadata canaries) and the difficulty of constructing a multi-gigabyte XML token within typical protocol constraints.

Impact

The vendor-assigned CVSS vector AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L (score 6.9) assigns a Local attack vector, which is conservative relative to libexpat's actual deployment footprint: the library routinely parses XML originating from HTTP bodies, SOAP messages, SAML assertions, RSS feeds, and other network-delivered content, making an independent AV:N assessment more representative of real-world exposure. AC:H is well-justified because crafting a namespace prefix or local-part that approaches INT_MAX (~2 billion characters) is non-trivial and will frequently be blocked by upstream protocol message-size limits or application-layer input validation. The High C and I scores reflect the theoretical worst case - heap corruption enabling code execution - though actual exploitability to that level depends heavily on heap layout and allocator mitigations. No CVE is listed in the CISA KEV catalog, no EPSS data is present in the available intelligence, and no public exploit code has been identified, all pointing to low current exploitation activity. The principal real-world concern is services that parse large, attacker-controlled XML documents (e.g., public XML APIs, document upload endpoints, federated identity flows using SAML) without enforcing document size limits; those deployments warrant near-term patching. Organizations processing only bounded, trusted XML face substantially lower risk.

Exploit ScenarioDerived

An attacker submits a crafted XML document containing a namespace declaration whose prefix name is constructed to be close to or exceeding INT_MAX bytes in length to a service that passes the document through libexpat before 2.8.2. The storeAtts() function increments prefixLen until integer overflow yields a small wrapped value, causing heap allocation of an undersized buffer; the subsequent memcpy writes the full-length string past the buffer boundary, corrupting adjacent heap metadata and potentially enabling controlled code execution within the parsing process.

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

Integer overflow in libexpat's storeAtts() function before version 2.8.2 allows heap buffer corruption during XML namespace attribute processing. When an XML document contains namespace-qualified attributes whose prefix name or local-part name approaches or exceeds INT_MAX bytes, the combined expanded-name length calculation wraps to a small integer, causing allocation of an undersized heap buffer followed by an out-of-bounds write during the memcpy phase. The vendor CVSS scores this 6.9 with High confidentiality and integrity impact; no public exploit has been identified at time of analysis and the CVE is not listed in the CISA KEV catalog.

RemediationAI

The primary fix is to upgrade libexpat to version 2.8.2 or later, which adds size_t-typed intermediate variables and explicit INT_MAX/SIZE_MAX overflow guards in storeAtts() (see https://github.com/libexpat/libexpat/pull/1232). Downstream packages - Linux distribution libexpat packages, Python interpreters, PHP builds, and any software statically linking libexpat - must be rebuilt or updated against 2.8.2; distribution vendors should be monitored for security update advisories. If an immediate upgrade is not possible, a compensating control is to enforce strict XML document and individual token size limits at the application layer before passing input to libexpat, rejecting any document whose namespace prefix or local-part identifier exceeds a safe ceiling (e.g., a few thousand characters); this requires application-level changes and may reject pathological but technically valid XML edge cases. WAF rules that cap HTTP request body size or reject anomalously large XML payloads can reduce network-sourced attack surface but do not protect file-based or local-IPC processing paths. No additional vendor advisory URL beyond the GitHub PR and NVD entry is present in the available intelligence.

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 streaming XML parser used in Python's pyexpat module, Apache httpd, D-Bus, and hundreds of downstream packages across Linux distributions. The vulnerable code path is in storeAtts() within expat/lib/xmlparse.c, which constructs expanded XML attribute names by concatenating three components: namespace URI length (binding->uriLen), namespace prefix length (prefixLen), and local-part length (i). Pre-fix, both prefixLen and i were declared as int, and the null-terminator counting loops incremented them without overflow checks. CWE-190 (Integer Overflow or Wraparound) is the precise root cause: if candidateLen (the prefix character count) or localPartLen (the local-part character count) surpasses INT_MAX during accumulation, the value wraps to a small positive number, making totalLen far smaller than the actual string. The downstream memcpy then writes the full-length string into the under-allocated buffer, corrupting adjacent heap metadata. The fix in PR #1232 switches intermediate variables to size_t and inserts explicit INT_MAX and SIZE_MAX guards before the cast and memcpy call.

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

AV:N reflects libexpat's primary deployment parsing network-sourced XML; AC:H because the overflow requires namespace tokens approaching INT_MAX length, an inherently difficult constraint.

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

Primary rating from Vendor (mitre).

CVSS VectorNVD

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

Lifecycle Timeline

1
Patch available
Jun 21, 2026 - 17:01 EUVD

DescriptionNVD

libexpat before 2.8.2 has an integer overflow in storeAtts.

Threat Intelligence Overview

EPSS Score
0.1%
Top 99% exploitable
Social Media
1
Sightings
Data Quality
7 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
Total

Priority Score

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

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

Integer overflow occurs when an arithmetic operation produces a result that exceeds the maximum value a given integer type can store.

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
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