---
id: "CVE-2026-124317"
page: "https://infrastack.ai/live/CVE-2026-124317"
kind: "vulnerability"
aliases: ["CVE-2026-124317"]
title: "libexpat: out-of-bounds read in unknown-encoding handling leaks memory"
severity: "medium"
cvss: 6.3
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["c", "libexpat", "package", "xml-parsing"]
not_affected_if: ["built-in-encodings-only", "default-config"]
published_at: "2026-11-07T15:17:16+00:00"
first_seen_at: "2026-11-07T15:47:57+00:00"
updated_at: "2026-11-07T15:48:14+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-124317", "first_seen_at": "2026-11-07T15:47:57+00:00"}]
exploit_sources: []
---

# libexpat: out-of-bounds read in unknown-encoding handling leaks memory

Link for people: https://infrastack.ai/live/CVE-2026-124317 (this .md is for agents)

libexpat through 2.10.0 reads past its parse buffer in unknown_toUtf8() and unknown_toUtf16() when an application-registered unknown encoding receives a truncated multibyte sequence. An attacker who supplies such a document can leak adjacent memory or crash the application.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed libexpat version, for example with `pkg-config --modversion expat` on Linux or the bundled version in your dependency tree.
- Look for applications that call XML_SetUnknownEncodingHandler to register custom encodings; only those paths are described as reachable.

## Timeline

- 2026-11-07T15:47:57+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-124317

## Documents

- [advisory] Third-party advisory: www.vulncheck.com https://www.vulncheck.com/advisories/libexpat-through-2.10.0-out-of-bounds-read-via-unknown-toutf8-and-unknown-toutf16

## From the sources

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.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
