Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit crafted XML to libexpat-based app
-
DeliveryDocument declares application-registered unknown encoding
-
ExploitTrailing truncated multibyte sequence
-
Executionconvert callback reads past parse buffer
-
ImpactLeak adjacent memory or crash process
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Buffer over-read prevention
|
| Exploitation Conditions | Exploitation requires the application embedding libexpat to register a custom unknown encoding through XML_SetUnknownEncodingHandler with a convert callback, and the attacker-supplied XML document must end in a truncated multibyte sequence whose encoding-map byte length exceeds the bytes remaining before fromLim, causing unknown_toUtf8()/unknown_toUtf16() to advance the read pointer past the parse buffer. This is NOT default behavior: applications that do not install an unknown-encoding handler are not affected. Limiting factors: the non-default custom-encoding configuration, the crafted truncated-input requirement, and the AC:H/AT:P metrics indicating specific conditions must align; impact is confined to adjacent-memory disclosure or a crash (no code execution or integrity loss). |
| Impact | This is a moderate, conditionally-exploitable issue rather than a top-tier emergency. The CVSS 4.0 vector (AV:N/AC:H/AT:P/PR:N/UI:N) is network-reachable and needs no privileges or user interaction, but AC:H and AT:P signal that reliable triggering depends on specific, attacker-uncontrolled conditions - consistent with the description, which requires the embedding application to have registered a custom unknown-encoding convert callback. Impact is limited to VC:L/VA:L (adjacent-memory disclosure or crash), with no integrity impact, matching CWE-126 (buffer over-read). No KEV listing and no EPSS score were supplied, and there is no public exploit identified at time of analysis; the only exploitation signals are the vendor advisory (VulnCheck) and the fix. The vuln.today priority is 'this_month' (not act_now/emergency), aligning with a real-but-not-urgent patch priority. The principal caveat is reach: although libexpat itself is ubiquitous, the vulnerable path is only present when an application uses application-registered unknown encodings, which is uncommon - so real-world exposure is far narrower than libexpat's overall footprint. |
| Exploit ScenarioDerived | An attacker submits an XML document to a service that embeds libexpat (≤2.10.0) and has registered a custom unknown encoding via XML_SetUnknownEncodingHandler. By ending the document in a truncated multibyte sequence whose encoding-map length exceeds the remaining bytes, the convert callback in unknown_toUtf8()/unknown_toUtf16() advances past the parse buffer limit, reading adjacent memory that may be leaked in output or causing a crash. The CVSS AC:H/AT:P metrics indicate this requires the specific unknown-encoding configuration plus precisely crafted truncated input; no public exploit is identified at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 07, 2026
libexpat through 2.10.0 can read past the end of the parse buffer in unknown_toUtf8() and unknown_toUtf16() when an embedding application has registered a custom unknown encoding via XML_SetUnknownEncodingHandler. If an attacker supplies an XML document that terminates in a truncated multibyte sequence, the encoding's convert callback advances the input pointer beyond fromLim, disclosing adjacent process memory or crashing the parser. The flaw is not reachable in the default configuration - only applications that install an unknown-encoding handler with a convert callback are exposed - and impact is limited to partial confidentiality loss and availability (assessed CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:L, CVSS 4.0 base 6.3); no confirmed active exploitation (not in CISA KEV) and no public exploit identified at time of analysis. Vendor remediation is available and the issue is prioritised for this month's patch cycle.
RemediationAI
Vendor-released patch status: available from vendor, delivered upstream as PR #1492 (https://github.com/libexpat/libexpat/pull/1492), which adds the missing readLen-versus-(fromLim - *fromP) check in both unknown_toUtf8() and unknown_toUtf16() and returns XML_CONVERT_INPUT_INCOMPLETE on truncation; the input data does not state a released version number containing the fix, so confirm the exact fixed release tag on the libexpat project page before pinning, and upgrade every embedded or statically linked copy - Expat is frequently bundled, so rebuilding dependent applications and language runtimes is part of the fix. Where upgrading cannot be completed immediately, the most direct compensating control is to stop registering an XML_SetUnknownEncodingHandler convert callback for parsers that process untrusted documents (or to restrict such parsers to built-in encodings); the trade-off is that applications legitimately parsing custom or legacy encodings lose that capability. Applications that must keep the handler should add their own length validation inside the convert callback so it never reads past the supplied end pointer, and should reject documents whose final bytes form an incomplete multibyte sequence; the trade-off is reliance on application code rather than the library boundary and the risk of diverging from Expat's own fix. Because the demonstrated impact is adjacent-memory disclosure or a crash rather than code execution, running parsers over untrusted input in a confined, least-privilege worker process with crash isolation limits both the leaked data and the availability effect, at the cost of process-management overhead. Advisory reference: https://www.vulncheck.com/advisories/libexpat-through-2.10.0-out-of-bounds-read-via-unknown-toutf8-and-unknown-toutf16.
Affected VersionsENISA
Affected Packages
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
Expat is a small, widely embedded C library for parsing XML, used directly by applications and indirectly by runtimes and language bindings. The affected routines live in expat/lib/xmltok.c (roughly lines 1274-1322 in the referenced revision) and implement the converter hooks for encodings that the application supplies at runtime through XML_SetUnknownEncodingHandler, rather than for Expat's built-in UTF-8/UTF-16/ISO-8859-1 tables. For such encodings the application fills an XML_Encoding.map array whose entries encode the byte length of multibyte sequences using BT_LEAD2/BT_LEAD3/BT_LEAD4 style markers; the old code advanced the source pointer by (type[**fromP] - (BT_LEAD2 - 2)) without ever comparing that computed length against the bytes remaining before fromLim. The weakness class is CWE-126 (buffer over-read): a length value derived from attacker-influenced input is used as a read span without a bounds check. PR #1492 fixes this by capturing the computed length in readLen and returning XML_CONVERT_INPUT_INCOMPLETE (the 'input truncated, more data needed' signal) whenever readLen exceeds (size_t)(fromLim - *fromP), and by normalising the function's tail to a single XML_CONVERT_COMPLETED return. The accompanying regression test (test_misc_unknown_encoding_no_source_overread) registers a synthetic 'x-q5' encoding mapping 0xC3 to a 2-byte lead and 0xA9 to a 4-byte lead, feeds the document "<?xml \xC3\xA9?>" as final input, and asserts that parsing returns XML_STATUS_ERROR instead of reading out of bounds. The trigger is only reachable when an application-installed handler defines such multibyte mapping entries; the underlying ordinary XML decoding paths are not implicated by the supplied evidence.
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
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:N/VA:L/SC:N/SI:N/SA:N
Network-reachable XML parsing (AV:N) but only when the app registers an unknown-encoding handler and a crafted truncated sequence is supplied, so AC:H; limited memory read and crash give C:L/A:L, I:N.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
libexpat through 2.10.0 contains an out-of-bounds read vulnerability in unknown_toUtf8() and unknown_toUtf16() in xmltok.c when handling application-registered unknown encodings. Attackers can supply a document ending in a truncated multibyte sequence so the convert callback reads past the parse buffer, leaking adjacent memory or crashing applications.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
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.
In Expat (aka libexpat) before 2.4.5, there is an integer overflow in storeRawNames. Rated critical severity (CVSS 9.8),
libexpat in Expat before 2.7.2 allows attackers to trigger large dynamic memory allocations via a small document that is
In libexpat before 2.2.8, crafted XML input could fool the parser into changing from DTD parsing to document parsing too
CPU exhaustion in libexpat through 2.9.0 lets remote attackers stall XML parsing workloads by supplying a moderately siz
Malformed UTF-16 decoding in libexpat through 2.8.4 lets remote attackers hide XML markup from the parser: a lone high s
In libexpat through 2.4.9, there is a use-after free caused by overeager destruction of a shared DTD in XML_ExternalEnti
Alpine Linux: expat fixed in 2.6.2-r0
XML External Entity vulnerability in libexpat 2.2.0 and earlier (Expat XML Parser Library) allows attackers to put the p
Denial of service in libexpat before 2.8.1 lets remote attackers exhaust CPU by submitting moderately sized crafted XML
expat before version 2.4.0 does not properly handle entities expansion unless an application developer uses the XML_SetE
Expat allows context-dependent attackers to cause a denial of service (crash) or possibly execute arbitrary code via a m
An issue was discovered in libexpat before 2.6.3. Rated critical severity (CVSS 9.8), this vulnerability is remotely exp
EUVD-2026-119271
GHSA-wm22-jw4m-rfcf
NVD
CVE.org
EPSS
VulDB
Exploit-DB