libexpat can be built with general-entity support switched off, XML_GE=0, a configuration meant for parsers that never want entity expansion, and separately with XML_UNICODE for wide-character output. In the combination of the two, the function storeSelfEntityValue() in xmlparse.c, which stores an entity’s own reference as its value when expansion is disabled, treated narrow C string literals as wide strings and read past their end. The VulnCheck record says a document “whose DOCTYPE declares a general entity” can “expose adjacent static memory through the entity value or crash the parser”. The fix is merged upstream for 2.12.0 and no release carries it yet. If you build libexpat yourself with XML_GE=0 and XML_UNICODE, apply commit caa656b or drop one of the two options; distribution packages are built with general entities on and are outside the described configuration.
CVE-2026-137951 at a glance.
| Component | libexpat, storeSelfEntityValue() in expat/lib/xmlparse.c, only in builds configured with both XML_GE=0 (general entities disabled, the EXPAT_GE=OFF CMake option) and XML_UNICODE (the wide build). The default build, with general entities on, does not take the affected path |
| Affected versions | libexpat 2.6.0 through 2.11.0, per the VulnCheck CNA record; the XML_GE option was introduced in 2.6.0, which is why the range starts there |
| Fixed in | no release yet: the fix, pull request #1534 (commit caa656b), was merged into master on 27 November 2026 with milestone 2.12.0, and the project added a CI job for the -DEXPAT_GE=OFF configuration alongside it. Debian sid carries it in 2.11.0-2; bookworm, trixie and forky are marked vulnerable. This is a known state, not a missing one |
| Severity | VulnCheck (CNA) CVSS 4.0 6.3 Medium (AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:N/VA:L) and CVSS 3.1 4.8 Medium (AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:L), CWE-125 (out-of-bounds read). Debian no urgency set; Ubuntu and Red Hat pages refused automated readers; SUSE’s page was empty; NVD Awaiting Analysis with both VulnCheck scores and no score of its own |
| Exploited in the wild | Not on CISA’s Known Exploited Vulnerabilities list as of 1 December 2026 (catalogue 2026.11.30). EPSS 0.00551 (39.8th percentile) on 30 November 2026 |
| Who is exposed | Software that ships its own libexpat built with general entities off and wide characters on, and parses XML with a DOCTYPE from outside. That is a deliberate, uncommon configuration: a hardened embedded parser or a Windows-origin application that disabled entities to close the billion-laughs class and kept the wide API. No Linux distribution package is built that way, which is why the distribution rows below describe the package’s version rather than a live exposure. What leaks is static memory adjacent to a string literal, through the entity’s value as the application sees it; what crashes is the parser |
| Published | CVE record 27 November 2026 (VulnCheck CNA); fix merged the same day; this page built 1 December 2026, last updated 1 December 2026 |
What it is
When general entities are disabled at build time, libexpat still has to do something with an entity declaration in a DOCTYPE, and what it does is store the entity’s own reference, &name;, as the value, so the application sees the reference rather than an expansion. storeSelfEntityValue() builds that value from fixed string literals, the ampersand and the semicolon, and the entity name. In the wide build every string the parser handles is an array of 16-bit units, and the function used the same copying path for the literals, which are narrow char strings. Read two bytes at a time, a one-byte literal runs off its end and continues into whatever the compiler placed next in the read-only data segment.
That is CWE-125, an out-of-bounds read, confined to static memory. The attacker controls when it happens, by declaring a general entity in a DOCTYPE, but not what sits beyond the literal; the parser either copies a few stray bytes of other literals into the entity value, which the application may then print or send, or runs far enough to hit an unmapped page and crash. The VulnCheck vector gives low confidentiality and low availability impact and AC:H for the build-configuration precondition.
The fix, by Sebastian Pipping after a report by hyc-alt, makes the function use wide literals under XML_UNICODE; it was merged into master on 27 November 2026 as part of pull request #1534, which also adds the -DEXPAT_GE=OFF configuration to the MinGW/Clang CI job so the combination is tested from now on. Debian cites commit caa656b as the fix and carries it in sid’s 2.11.0-2. The 2.12.0 release that will contain it has no date.
Who is affected on Linux
Each row is what the distribution’s own security tracker said on 1 December 2026; the link in the row is the tracker page, which will be newer than this one. Every distribution builds expat with general entities on, so the “vulnerable” marks describe the source version, not a reachable path in the shipped library.
| Distribution | Status | Fixed package |
|---|---|---|
| Alpine | Not consulted for this page; the Alpine tracker has refused automated readers on every earlier run | — |
| Debian | expat marked vulnerable in bookworm (2.5.0-1+deb12u5), trixie (2.9.0-1~deb13u1) and forky (2.11.0-1); fixed in sid (2.11.0-2), “Fixed by” caa656b; Debian bug 1155795. Note the range starts at 2.6.0, so bookworm’s 2.5.0 is outside it despite the mark | 2.11.0-2 (sid) |
| Ubuntu | Tracker unreachable on 1 December 2026 (client error on two attempts); nothing inferred | — |
| RHEL, Rocky, Alma, CentOS Stream | Tracker unreachable on 1 December 2026 (client error on the hydra JSON); nothing inferred | — |
| openSUSE/SLE | Page returned empty on 1 December 2026; nothing inferred | — |
Static and vendored copies: Python’s bundled pyexpat, language runtimes, embedded firmware, container images built from source | The upstream release applies; each bundle is fixed when its own project rebuilds against a fixed libexpat | per bundle |
How to check
The question that matters is not the version but the build: a libexpat compiled with general entities disabled and the wide API is the only one in the described path, and no distribution ships one. The check therefore looks for self-built or vendored copies and asks how they were configured.
# 1. which libexpat is installed, and which build variant: libexpat.so.1 is the byte build, libexpatw.so.1 the XML_UNICODE (wide) build
dpkg -l libexpat1 2>/dev/null | awk '/^ii/ {print $2, $3}'; rpm -q expat 2>/dev/null; apk info -v expat 2>/dev/null
ls -l /usr/lib/*/libexpat*.so.1* /usr/lib64/libexpat*.so.1* 2>/dev/null
strings $(ls /usr/lib/*/libexpat.so.1 /usr/lib64/libexpat.so.1 2>/dev/null | head -1) | grep -E '^expat_[0-9]' | head -1
# 2. a build with XML_GE=0 has no entity expansion: the byte build reports it through XML_GetFeatureList (XML_FEATURE_GE absent) and expat_config.h
grep -rsE '^#define XML_GE' /usr/include/expat_config.h /usr/local/include/expat_config.h 2>/dev/null
grep -rsE 'XML_GE|EXPAT_GE' /usr/local/src/*expat*/CMakeCache.txt /opt/*/expat*/CMakeCache.txt 2>/dev/null
# vendored copies in source trees: find the two options together
grep -rlsE 'XML_GE\s*0|EXPAT_GE=OFF|-DXML_GE=0' --include='*.h' --include='*.txt' --include='*.cmake' --include='Makefile*' /usr/local/src /opt /srv 2>/dev/null | head
# 3. and is that build the wide one? XML_UNICODE builds install libexpatw and define XML_UNICODE in the same config
grep -rsE '^#define XML_UNICODE' /usr/include/expat_config.h /usr/local/include/expat_config.h 2>/dev/null
ls /usr/local/lib/libexpatw* 2>/dev/nullA distribution package, whatever its version, is built with general entities on and is outside the described configuration; the Debian marks describe the source, not the library. The exposed case is a locally built or vendored libexpat whose configuration shows both XML_GE 0 and XML_UNICODE, and an application that feeds it XML with a DOCTYPE from outside. One without the other is not in the path.
How to fix it
There is no package to install yet. For a self-built library in the affected configuration, apply the fix commit to the 2.11.0 source and rebuild, or wait for 2.12.0; for a distribution package, take the normal update when it arrives and nothing more.
# self-built libexpat 2.11.0 with -DEXPAT_GE=OFF and the wide build: apply the merged fix and rebuild
cd /usr/local/src/libexpat && git fetch origin && git cherry-pick caa656b
cmake -S expat -B build -DEXPAT_GE=OFF -DEXPAT_CHAR_TYPE=ushort && cmake --build build && sudo cmake --install build
# Debian sid already carries it
sudo apt update && sudo apt install --only-upgrade libexpat1
# then restart whatever maps the rebuilt library
grep -l 'libexpat.*(deleted)' /proc/[0-9]*/maps 2>/dev/null | cut -d/ -f3 | sort -unThe simpler mitigation for a build you control is to drop one of the two options. Building with general entities on, the default, removes the affected function from the path entirely, and the billion-laughs protection that XML_GE=0 was meant to give can be had at run time instead:
/* keep general entities compiled in, and cap expansion at run time instead (libexpat 2.4+) */
XML_Parser p = XML_ParserCreate(NULL);
XML_SetBillionLaughsAttackProtectionMaximumAmplification(p, 100.0f);
XML_SetBillionLaughsAttackProtectionActivationThreshold(p, 8388608ULL);Do not treat the Debian “vulnerable” marks on bookworm, trixie and forky as a reason for an emergency update of the system package: the shipped library is not built in the affected configuration, and the maintainers’ marks track source versions. And do not reach for XML_GE=0 as a hardening measure on the strength of this page: the run-time amplification limits above give the same protection without the configuration that carries this bug.
Sources
- CVE-2026-137951 at CVE.org — the VulnCheck CNA record (27 November 2026): the description, the 2.6.0–2.11.0 range, the two build options, the CVSS 4.0 and 3.1 vectors and CWE-125
- libexpat pull request #1534 — the fix, merged into master on 27 November 2026 as e263ba0 with milestone 2.12.0; commits caa656b (the fix) and 391ae8f (the
-DEXPAT_GE=OFFCI job); reported by hyc-alt - xmlparse.c at the affected revision — the lines the record cites
- NVD entry — Awaiting Analysis; published 27 November; VulnCheck’s 4.8 (3.1, primary) and 6.3 (4.0, secondary); CWE-125; no NVD score
- Distribution trackers: Debian (bug 1155795; sid fixed at 2.11.0-2, “Fixed by” caa656b) · Ubuntu (unreachable on 1 December) · Red Hat (unreachable) · SUSE (empty page)
- CISA KEV catalogue 2026.11.30, not listed · EPSS: 0.00551, 39.8th percentile, on 30 November 2026
Related reading
- CVE-2026-134703: libexpat splits a UTF-16 surrogate pair and hands a lone high surrogate to the application — the same November reporting round
- CVE-2026-139881: libexpat falls back to a predictable hash salt after a short read of /dev/urandom — a draft until its fix is confirmed; the same November reporting round
- CVE-2026-137992: libexpat duplicate ATTLIST declarations denial of service — the first of this round, also waiting on 2.12.0
- What ships in your container image — where vendored and statically built libraries hide, which is where this configuration would live
- Locales and encoding — narrow and wide strings, and why a byte count is not a character count
- Security advisories — every Linux-relevant CVE we track, newest first, with the component index
This advisory page was assembled from the primary sources listed above on 1 December 2026 and is updated when they change. The facts are theirs; the checks and the ordering are ours. If a row in the distribution table is out of date, the tracker link in that row is the current word.
