Reach expat · 6 builds in 3 of 4 releases
full reviewcross-check✓ a member decided
Description · NVD
libexpat 2.7.2 through 2.9.0 contains a denial of service vulnerability because XML_ParserReset zeroes the direct byte count but never offsets tracked heap allocations. Attackers can submit a large XML document so later documents on the same reset parser fail with XML_ERROR_NO_MEMORY until it is recreated.
Published 2026-10-20NVD
CVSS 4.0Network · no privileges · no user interaction
How it is reached
- Attack vector
- Network
- Attack complexity
- Low
- Attack requirements
- Present
- Privileges required
- None
- User interaction
- None
What it costs
- Confidentiality
- None
- Integrity
- None
- Availability
- High
What it costs other systems
- Confidentiality
- None
- Integrity
- None
- Availability
- None
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
References 5
- github.com/libexpat/libexpat
- github.com/libexpat/libexpat/blob/a76b1174c1ea52abb639a4c69d52b630a8a106a2/expat/lib/xmlparse.c#L1560
- github.com/libexpat/libexpat/blob/a76b1174c1ea52abb639a4c69d52b630a8a106a2/expat/lib/xmlparse.c#L860-L884
- github.com/libexpat/libexpat/pull/1431
- www.vulncheck.com/advisories/libexpat-2.7.2-through-2.9.0-denial-of-service-via-xml-parserreset
Fable 5.1 · high confidence · 2026-11-05
expat 2.8.4 in this tree carries the vulnerable code: XML_ParserReset() (lib/xmlparse.c:1621-1658) calls parserInit(), which zeroes m_accounting.countBytesDirect, but never touches m_alloc_tracker.bytesAllocated, so the amplification check in expat_heap_increase_tolerable() (lib/xmlparse.c:880-893) can reject allocations on subsequent documents; no Buildroot or Infix patch addresses it and XML_GE=1 compiles the tracker in.
However, the bug is only triggerable by an application that reuses a parser via XML_ParserReset, and none of the shipped consumers of libexpat (dbus-daemon, dbus-glib, avahi-daemon, python3 pyexpat/_elementtree) ever call it: each creates a fresh parser with XML_ParserCreate*() and frees it with XML_ParserFree(); pyexpat does not even expose ParserReset to Python code.
The klish expat backend is not built (WITH_EXPAT_TRUE='#') and also does not call XML_ParserReset.
Reaching the code would require custom software installed outside the product (root shell / developer code linking libexpat and calling XML_ParserReset); it is not reachable from any network interface or management interface.
Evidence 12
Reset moves lists, clears pools and calls parserInit(); it never adjusts parser->m_alloc_tracker.bytesAllocated — the vulnerable pattern described by the CVE is present (no fix hunk).
output/build/expat-2.8.4/lib/xmlparse.c:1621-1658 (XML_ParserReset)
memset(&parser->m_accounting, 0, ...) zeroes countBytesDirect on reset while heap tracker total is retained, creating the skewed amplification ratio.
output/build/expat-2.8.4/lib/xmlparse.c:1585-1590 (parserInit, '#if XML_GE == 1')
Allocation is rejected when bytesAllocated+increase >= activationThreshold and ratio to countBytesDirect exceeds maximumAmplificationFactor (100.0f, lib/internal.h:149) → XML_ERROR_NO_MEMORY.
output/build/expat-2.8.4/lib/xmlparse.c:880-893 (expat_heap_increase_tolerable)
XML_DTD 1 and XML_GE 1 defined → allocation tracker code is compiled into libexpat.so.1.12.4.
output/build/expat-2.8.4/expat_config.h:129-132
No patch applied; 2.8.4 changelog lists no fix for this issue; version is within the stated 2.7.2–2.9.0 range.
output/build/expat-2.8.4/.applied_patches_list (0 bytes); buildroot/package/expat/ (no patches); output/build/expat-2.8.4/Changes (2.8.4 release notes)
expat is selected for the target, pulled in by avahi, dbus and python3 (pyexpat); libexpat.so.1.12.4 is installed (build/packages-file-list.txt:18455).
output/.config:2527 BR2_PACKAGE_EXPAT=y, :1509 BR2_PACKAGE_PYTHON3_PYEXPAT=y; buildroot/package/{avahi,dbus,python3}/Config.in 'select BR2_PACKAGE_EXPAT'
dbus-daemon config loader uses XML_ParserCreate_MM + XML_ParserFree per document; no XML_ParserReset call.
output/build/dbus-1.14.10/bus/config-loader-expat.c:199,296,307
avahi-daemon static service loader uses XML_ParserCreate + XML_ParserFree per file; no XML_ParserReset call.
output/build/avahi-0.8/avahi-daemon/static-services.c:796,849
dbus-glib introspection loader creates/frees parser per use; no XML_ParserReset.
output/build/dbus-glib-0.114/dbus/dbus-gloader-expat.c:208,251,265
pyexpat creates/frees parsers only; XML_ParserReset is neither called nor exported via the pyexpat C-API, so Python code cannot reach it. python3.mk:114-116 uses --with-expat=system.
output/build/python3-3.12.14/Modules/pyexpat.c:1463,1527,2326-2327; Modules/_elementtree.c
klish expat DB backend is not built, and even its source only uses Create/Free.
output/build/klish-*/config.log:1799 WITH_EXPAT_TRUE='#'; dbs/expat/expat_api.c:349,374,383
dbus-daemon runs by default but only parses local trusted config files with per-file parsers; no avahi service file in finit.d (not started by default).
board/common/rootfs/etc/finit.d/dbus.conf:2-3
Version and patches
NVD range 2.7.2–2.9.0 includes 2.8.4; fix is upstream PR #1431 (expected in a release after 2.9.0). Tree source is unmodified 2.8.4: .applied_patches_list is empty, no patches in buildroot/package/expat/ or patches/, no IGNORE_CVES entry. Vulnerable XML_ParserReset code confirmed present at lib/xmlparse.c:1621-1658.
Recommendation
Document as not exposed: no shipped binary calls XML_ParserReset, so the DoS condition cannot be triggered on the device. Pick up the fixed expat release on the next routine Buildroot bump; no urgent backport needed. Re-evaluate if a future package that reuses expat parsers via XML_ParserReset on untrusted input (e.g. a network-facing XML service) is added.
Open questions
output/target/ in this artifact is pruned (no binaries), so linkage was verified from packages-file-list.txt and consumer sources rather than from ELF NEEDED entries. The upstream PR #1431 diff could not be fetched; the fix check relies on the code pattern described in the advisory (tracker not offset on reset), which is clearly present.
Members of Kernel Kit decide. Sign in if you are one.