Skip to main content

libexpat CVE-2026-56132

| EUVDEUVD-2026-37977 MEDIUM
Incorrect Synchronization (CWE-821)
2026-06-19 mitre GHSA-425r-vwq2-26qv
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 64+ nested DTD content model declarations
  2. Delivery
    Embed external parameter entity reference in DOCTYPE
  3. Exploit
    Submit to application with XML_PARAM_ENTITY_PARSING enabled
  4. Install
    libexpat creates child parser sharing parent DTD scaffIndex
  5. C2
    Child parser's m_groupSize triggers misaligned scaffIndex realloc
  6. Execute
    Heap buffer overflow corrupts adjacent allocations
  7. Impact
    Achieve code execution in application context

Vulnerability Assessment

Weakness
CWE
Exploitation Conditions

Exploitation requires two concurrent conditions, both of which must be present: (1) The application must have external entity parameter parsing explicitly enabled via XML_SetParamEntityParsing with either XML_PARAM_ENTITY_PARSING_ALWAYS or XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE - this is NOT enabled by default in libexpat, meaning the application developer must have affirmatively opted into this behavior; (2) The attacker-controlled XML input must contain a DTD with deeply nested element content model declarations (the upstream test case uses 64+ levels of recursive grouping) sufficient to trigger multiple scaffold array reallocations, combined with a parameter entity reference that causes libexpat to create an external entity sub-parser that inherits the parent DTD's scaffIndex. Factors that LIMIT exploitation: external entity parsing is off by default and is frequently disabled in security-hardened builds and public-facing XML processors precisely to prevent entity-based attacks; AC:H reflects that crafting the exact nesting depth to trigger misaligned reallocation is non-trivial; AV:L in the provided CVSS suggests that standard usage ties the external entity to a local file path, meaning that attacker delivery may require influence over local file system state or the application's entity resolver implementation; no privilege on the target system is required from the attacker's perspective (PR:N).

Impact

The CVSS 6.9 Medium vector AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L warrants careful interpretation. AC:H accurately reflects that two non-trivial conditions must align: deeply nested DTD element content model declarations (the test case uses 64+ nesting levels to force multiple scaffold reallocations) and active external entity parameter parsing enabled by the application. The AV:L assignment implies the external entity must reference a local file resource; however, if an application implements a custom external entity resolver or processes XML from untrusted network sources with entity parsing enabled, the effective attack surface becomes network-accessible - defenders should not rely solely on AV:L to infer that network delivery is impossible. C:H and I:H are well-supported: a heap overflow in a parsing library can yield arbitrary code execution. A:L rather than A:H is atypical for a heap overflow and likely reflects the assessor's judgment that reliable exploitation is more oriented toward control-flow hijack than crash. No EPSS score was provided in source data, leaving quantitative exploitation probability unknown. The vulnerability is not in CISA KEV, and no weaponized exploit exists beyond the upstream unit test. Despite the medium aggregate score, applications that accept untrusted XML and have external entity parsing enabled should treat remediation as urgent given the C:H/I:H impact potential.

Exploit ScenarioDerived

An attacker submits a crafted XML document containing a DOCTYPE with 64 or more levels of deeply nested element content model declarations followed by a parameter entity reference pointing to an external resource. When a vulnerable application with XML_PARAM_ENTITY_PARSING_ALWAYS configured processes this document, libexpat creates a child parser for the external entity that inherits the parent DTD's scaffIndex by reference. As the child parser processes additional deeply nested content model declarations, m_groupSize triggers a realloc of scaffIndex using the wrong capacity, corrupting adjacent heap memory and potentially enabling code execution. No weaponized exploit exists, but the upstream PR test case provides a functional XML reproduction template.

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 19, 2026

Heap-based buffer overflow in libexpat before 2.8.2 allows heap memory corruption in applications that process externally-supplied XML with external entity parameter parsing enabled. The flaw resides in the doProlog function of xmlparse.c, where the scaffold backing array (scaffIndex) - used to index DTD content model tree nodes - is reallocated using the child parser's m_groupSize counter, which diverges from the actual allocated capacity of the shared scaffIndex inherited from the parent parser. No public exploit code has been identified and the vulnerability is not listed in CISA KEV at time of analysis, but the upstream fix PR includes a functional reproduction test case confirming exploitability.

RemediationAI

Upgrade libexpat to version 2.8.2 or later as stated in the CVE description. The upstream code change is available in GitHub PR #1272 (https://github.com/libexpat/libexpat/pull/1272); organizations should confirm the PR has been merged and tagged in a formal 2.8.2 release before relying on distribution packages claiming this fix, as the only provided reference is the PR rather than a release tag. As a targeted workaround for applications that cannot immediately upgrade, disable external entity parameter parsing by calling XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_NEVER) - this eliminates the shared child-parser DTD scenario required to trigger the overflow, though it will break any functionality that depends on DTD external parameter entities, which is a narrow but real compatibility trade-off. Applications that process only fully trusted, internally generated XML can de-prioritize patching, but any path that accepts externally sourced XML with external entity parsing active should be patched before other less-exposed consumers. Linux distributions (Debian, Ubuntu, Red Hat, Alpine) will ship updated expat packages; verify with each distribution's security advisory channel.

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:2.3:a:libexpat_project:libexpat:*:*:*:*:*:*:*:*) is a widely embedded C XML stream parser used as a dependency in Python, Perl, PHP, D-Bus, Subversion, and most Linux distributions. The root cause is CWE-821 (Incorrect Synchronization): when an application creates an external entity sub-parser via XML_ExternalEntityParserCreate, the child parser inherits the parent's DTD structure by reference, including the scaffIndex array. Prior to the fix, reallocation of scaffIndex was gated on parser->m_groupSize - a counter tracking the current parser's connector array size - rather than the actual allocated capacity of the shared DTD's scaffIndex. Because the child parser's m_groupSize can grow independently of the capacity at which the parent originally allocated scaffIndex, the realloc call operates with an incorrect size, producing a heap overflow. The fix introduces a dedicated scaffIndexSize field to the DTD structure (initialized in dtdCreate, reset in dtdReset, and copied in dtdCopy) so that scaffIndex reallocation is gated on its own tracked capacity. The prior code also erroneously interleaved scaffIndex reallocation inside the m_groupConnector reallocation block, which the fix restructures into a separate, correctly bounded allocation check.

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

Local vector retained because standard external entity resolution targets local files; AC:H reflects required non-default configuration plus precise nesting depth; PR:N since no attacker system privilege is needed.

3.1 AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L
4.0 AV:L/AC:H/AT:P/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 19, 2026 - 07:16 EUVD

DescriptionNVD

In libexpat before 2.8.2, there is a heap-based buffer overflow in doProlog in xmlparse.c because scaffold backing array reallocation is mishandled when there is data-structure sharing across parsers.

Threat Intelligence Overview

EPSS Score
0.1%
Top 99% exploitable
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 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.

Related Vulnerabilities in libexpat Parser Memory Safety Vulnerabilities

View all 2
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-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-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-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
SUSE Linux Enterprise Desktop 15 SP7 Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Affected
SUSE Linux Enterprise Micro 5.3 Affected
SUSE Linux Enterprise Micro 5.4 Affected
SUSE Linux Enterprise Micro 5.5 Affected

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