Skip to main content

libexpat xmlwf CVE-2026-56409

| EUVDEUVD-2026-38186 MEDIUM
Integer Overflow or Wraparound (CWE-190)
2026-06-21 mitre GHSA-jhv6-83wh-9vj5
6.5
CVSS 3.1 · Vendor: mitre
View

Attack ChainAIDerived

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

  1. Access
    Craft near-SIZE_MAX-length outputDir or filename
  2. Delivery
    Invoke xmlwf -d <crafted_path> <xml_file>
  3. Exploit
    Integer overflow in malloc size calculation
  4. Execution
    Undersized heap buffer allocated
  5. Persist
    Filename copy overflows heap allocation
  6. Impact
    Memory corruption enables code execution

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

The vulnerability is triggered only when the xmlwf command-line tool is invoked with the -d outputDir flag AND the combined byte length of the output directory path and the XML input filename approaches the platform's SIZE_MAX / sizeof(XML_Char) threshold - a condition requiring abnormally long path strings. Both the additive sum tcslen(outputDir) + tcslen(file) + 2 and the multiplicative step * sizeof(XML_Char) must each be individually guarded (as the fix demonstrates), meaning either stage can be the overflow point. Exploitation is limited to local execution (AV:L), requires a user or automated process to actively run the tool (UI:R), and demands high complexity to construct suitable path lengths (AC:H). The core libexpat API used by linked applications is entirely unaffected - only the standalone xmlwf binary is vulnerable, and only when the -d flag is present.

Impact

The CVSS 3.1 score of 6.5 (AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L) accurately reflects the constrained exploitation profile: local access, high attack complexity, and mandatory user interaction all bound practical risk despite the elevated C:H/I:H impact ratings. AC:H is well-supported by the fix code - triggering the overflow requires that the combined outputDir and filename lengths approach SIZE_MAX / sizeof(XML_Char), a condition difficult to achieve in typical usage. No EPSS score was provided, KEV listing is absent, and no public POC has been identified - all signals point to low near-term exploitation probability. However, risk escalates in environments where xmlwf is invoked programmatically in CI/CD pipelines or document processing workflows that accept external file paths, since user-interaction and complexity requirements may be met by design in such contexts. The C:H/I:H impact is credible only if heap exploitation succeeds; crashing the tool (denial of service) is a more likely immediate outcome.

Exploit ScenarioDerived

An attacker with influence over the outputDir argument or over filenames processed by an automated xmlwf pipeline supplies a directory path or filename whose combined length with the XML input filename approaches the size_t maximum. When xmlwf runs with -d <attacker-controlled-path>, the addition tcslen(outputDir) + tcslen(file) + 2 wraps to a near-zero value, malloc() allocates a tiny heap buffer, and the subsequent filename string copy overflows it - potentially corrupting adjacent heap metadata and enabling code execution in the context of the process running xmlwf. No public exploit code exists at time of analysis, but the integer-overflow-to-heap-overflow primitive is well-documented in exploitation literature.

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 the xmlwf command-line utility bundled with libexpat before 2.8.2 allows heap buffer overflow when the -d outputDir flag is used with extremely long path values. The overflow occurs during malloc size calculation - (tcslen(outputDir) + tcslen(file) + 2) * sizeof(XML_Char) - wrapping the size_t to a near-zero value, causing an undersized allocation followed by out-of-bounds write during filename construction. No public exploit has been identified at time of analysis and the vulnerability is absent from CISA KEV, but the heap overflow primitive is well-understood and could yield code execution in automated XML processing pipelines.

RemediationAI

Upgrade libexpat to version 2.8.2 or later, which introduces explicit SIZE_MAX overflow guards in xmlwf.c before both the additive and multiplicative size calculations (upstream PR #1259: https://github.com/libexpat/libexpat/pull/1259). If an immediate upgrade is not feasible, discontinue or restrict use of the xmlwf -d outputDir invocation mode, particularly in any automated pipeline that processes untrusted XML files or accepts externally-supplied directory paths. As a compensating control, enforce OS-level or application-level limits on filesystem path lengths before passing them to xmlwf (e.g., reject paths exceeding PATH_MAX); this prevents the near-SIZE_MAX lengths required to trigger the overflow. Note that restricting path length may affect legitimate deep-directory processing. The core libexpat parsing API does not require remediation for this specific CVE.

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-deployed C XML parsing library; xmlwf is its bundled command-line well-formedness checker. The vulnerable code in expat/xmlwf/xmlwf.c computes a malloc() size via two consecutive unsafe arithmetic operations: an additive step tcslen(outputDir) + tcslen(file) + 2 and a multiplicative step * sizeof(XML_Char). Either operation can silently wrap around a size_t (CWE-190: Integer Overflow or Wraparound), producing a value far smaller than the combined path lengths require. The subsequent string copy into the undersized buffer writes past the heap allocation boundary - a classic integer-overflow-to-heap-overflow chain, reflected in the 'Buffer Overflow' tag alongside 'Integer Overflow'. The upstream fix in PR #1259 mirrors guards already used elsewhere in the codebase (xcsdup() and resolveSystemId()), adding explicit SIZE_MAX boundary checks before both arithmetic steps.

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

Local-only tool requires active invocation with the -d flag (AV:L/UI:R); near-SIZE_MAX path lengths needed to overflow (AC:H); successful heap corruption enables code execution (C:H/I:H).

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

Primary rating from Vendor (mitre).

CVSS VectorVendor: mitre

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

Lifecycle Timeline

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

DescriptionCVE.org

xmlwf in libexpat before 2.8.2 has an integer overflow for the output filename when -d outputDir is used.

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

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