CVE-2026-141596: libexpat resumes a parser suspended inside a CDATA section that came from an internal entity against the wrong buffer and dereferences a null pointer

ByLinuxtastic

December 3, 2026 #CVE, #libexpat

libexpat can be stopped from inside a handler with XML_StopParser(parser, XML_TRUE) and picked up later with XML_ResumeParser(); a program that feeds a document in pieces or hands control back to an event loop uses that. The VulnCheck CNA record says doContent() in lib/xmlparse.c “mishandles parser suspension inside CDATA sections within internal general entities”, so that a crafted document given to “applications whose handlers suspend the parser inside the CDATA section” ends up “corrupting parser state and causing a crash”, a null pointer dereference, CWE-476. The issue behind it, #1419, is older and wider: on resume “that processor scans the document buffer rather than the entity buffer”, so a resumable parser can read a document differently from a single-shot one. The record scores it CVSS 4.0 8.2 and CVSS 3.1 5.9; the high attack complexity and the preconditions are the suspension itself. The fix is pull request #1545, approved on 1 December, unmerged, milestone 2.12.0. If a program suspends and resumes libexpat on untrusted documents, assume a crash is reachable until 2.12.0 is installed; a program that parses in one call is not in the path.

CVE-2026-141596 at a glance.

Componentlibexpat, doContent() and cdataSectionProcessor() in expat/lib/xmlparse.c: the processor recorded when a handler suspends the parser inside a CDATA section expanded from an internal general entity (the record points at lines 4203 to 4208 of the 2.11.0 tag)
Affected versionsevery libexpat release through 2.11.0 (the record: 0 to 2.11.0 inclusive); issue #1419 reproduced it on 2.8.2, 2.8.3 and master in October
Fixed innot released on 2 December 2026: pull request #1545, “lib: Fix handling of suspension during entity-based CDATA section (fixes #1419, alternative to #1540)”, by Sebastian Pipping with the fix commit c30aaa2 co-authored by Luis Arancibia, opened 30 November, reworked 1 December after review found an unclosed <![CDATA[ in an entity returned success instead of XML_ERROR_UNCLOSED_CDATA_SECTION, approved 1 December (“LGTM!”), milestone 2.12.0, open and unmerged. Five commits, two of them tests for suspension of complete and incomplete entity-based CDATA sections. This is the unknown field that keeps the page a draft
SeverityVulnCheck (CNA) CVSS 4.0 8.2 High (AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N) and CVSS 3.1 5.9 Medium (AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H), CWE-476. The AT:P and AC:H are the application having to suspend the parser at the right moment. No NVD record and no distribution rating on 2 December
Exploited in the wildNot on the CISA KEV catalogue (2026.11.30). EPSS: no score yet on 2 December 2026
Who is exposedPrograms that call XML_StopParser() with resume set and later XML_ResumeParser() while parsing documents from outside, and whose documents may declare internal general entities that expand to a CDATA section. The crash is in the parsing process; the issue also describes a validator that parses in one shot disagreeing with a consumer that suspends, which is a sanitiser bypass rather than a crash. A program that never suspends, or that rejects internal entities, is not in the path
PublishedCVE record 2 December 2026, 01:08 UTC (VulnCheck CNA); this page built 2 December 2026 as a draft, last updated 2 December 2026

What it is

When libexpat expands an internal general entity it parses the entity’s replacement text from the entity’s own buffer, not from the document, and keeps track of which buffer it is in through a processor function pointer that says what to do when parsing continues. A CDATA section is handled by its own processor, cdataSectionProcessor(), which doContent() installs when it meets <![CDATA[. The mistake, as issue #1419 describes it, is that this hand-off did not record that the section came from an entity: if a handler suspended the parser inside it, the state saved for resumption pointed the CDATA scanner at the document buffer, and on XML_ResumeParser() it carried on reading the wrong text.

Two things follow from reading the wrong buffer. The one the record names is the crash: the saved positions belong to the entity buffer and are applied to the document, and the record calls the result a null pointer dereference that corrupts parser state. The one the issue leads with is subtler: a document can be built so that a parser that runs straight through sees one thing and a parser that is suspended and resumed sees another, with the issue’s example being an <e2/> read as an element by one and as character data by the other. The issue says plainly that “No malformed input is required for the DoS case”, and that a sanitiser validating with a single-shot parser in front of a consumer that suspends can be bypassed. Both need the suspension, which is why the vector carries AT:P.

The fix in pull request #1545 makes the entity-based CDATA path record the right processor and buffer so a suspended parse resumes where it was, and a review by Luis Arancibia on 30 November caught that an entity with an unclosed <![CDATA[ then returned success rather than the unclosed-section error, which the rework of 1 December corrected with a test. The maintainer added the security label the same day because “a related report used the bug to crash Expat with a null-pointer dereference”, requested the CVE, and the pull request was approved; it is an alternative to the closed #1540. Neither pull request is merged and the milestone is 2.12.0. The 2.11.0 Changes entry, read at its tag, does not mention #1545, #1419 or this id.

Who is affected on Linux

Each row is what the distribution’s own security tracker said on 2 December 2026; the link in the row is the tracker page, which will be newer than this one. The record is hours old and none of the trackers had an entry, so the table is empty of statuses and nothing in it is inferred; every distribution ships libexpat, and every one is at or below 2.11.0.

DistributionStatusFixed package
AlpineNot consulted for this page: the Alpine tracker refused the automated reader on 2 December 2026—
DebianNo entry yet: the tracker returned a client error for this id on 2 December 2026, hours after the record was published; nothing inferred—
UbuntuNo entry yet: ubuntu.com returned a client error for this id on 2 December 2026; nothing inferred—
RHEL, Rocky, Alma, CentOS StreamNo entry yet: the hydra JSON returned a client error for this id on 2 December 2026; nothing inferred—
openSUSE/SLENot consulted: suse.com refused the automated reader on 2 December 2026 (client error)—
Static and vendored copies: Python’s bundled pyexpat, language runtimes, embedded firmware, container images built from sourceThe upstream release applies once it exists; each bundle is fixed when its own project rebuilds against itper bundle, after 2.12.0

How to check

Two questions: which libexpat is installed, and which programs on the host resume a suspended parser, which is the precondition and is visible in a binary’s imports. A program that never references XML_ResumeParser cannot be in the path.

# 1. which libexpat is installed (every release through 2.11.0 is affected), and who has it loaded
dpkg -l libexpat1 2>/dev/null | awk '/^ii/ {print $2, $3}'; rpm -q expat 2>/dev/null; apk info -v expat 2>/dev/null
grep -l 'libexpat' /proc/[0-9]*/maps 2>/dev/null | cut -d/ -f3 | sort -un | xargs -r ps -o pid=,comm= -p

# 2. the precondition: which binaries and libraries on the host can resume a suspended parse
for f in $(grep -l 'libexpat' /proc/[0-9]*/maps 2>/dev/null | cut -d/ -f3 | sort -un | xargs -r -I{} readlink /proc/{}/exe | sort -u); do
  printf '%s: %s\n' "$f" "$(objdump -T "$f" 2>/dev/null | grep -c XML_ResumeParser)"
done
for l in $(ldconfig -p | awk '{print $NF}' | sort -u); do objdump -T "$l" 2>/dev/null | grep -q 'XML_ResumeParser' && echo "$l"; done
# Python: pyexpat exposes suspension only through xml.parsers.expat; most callers never use it
python3 -c 'import pyexpat; print(pyexpat.EXPAT_VERSION)' 2>/dev/null

Every installed libexpat is affected today, so the first block measures exposure, not vulnerability. The second block is the filter: a binary or library that imports XML_ResumeParser is one that suspends, and only those can reach the mishandled state; a count of zero everywhere means the host’s parsers run straight through and this record does not apply to them, whatever the library version. A program that does suspend needs the second half of the precondition too, documents from outside that may carry internal entities, which is a question about where its input comes from.

How to fix it

There is no release to install on 2 December 2026. When 2.12.0 is published and names this CVE, update the package and restart every process that had the old library mapped. Until then the mitigation is at the application, and only programs that suspend the parser need one.

# When the fixed release is packaged
apt update && apt install libexpat1 && systemctl restart <service>      # Debian, Ubuntu
dnf update expat && systemctl restart <service>                          # RHEL family, Fedora
apk upgrade expat && rc-service <service> restart                        # Alpine
grep -l 'libexpat.*(deleted)' /proc/[0-9]*/maps 2>/dev/null | cut -d/ -f3   # anything still on the old copy
# Until then, in a program that suspends: refuse documents that declare internal entities, or do not suspend
# while inside character data. Both are code changes; there is no runtime switch for either.
# A crashed worker should be restarted by its supervisor, not by hand:
systemctl show -p Restart,RestartUSec <service>.service

The two application-side options are honest about what they cost: refusing internal entities (an entity-declaration handler that stops the parser) breaks documents that use them, and never suspending inside character data changes how the program is structured. A supervisor that restarts a crashed worker turns the crash into a dropped request, which is what the 5.9 describes. What not to do: do not apply the closed pull request #1540 on the strength of its title; #1545 is the one the maintainer chose, and it was itself reworked after review. And do not treat the single-shot validator in front of a resumable consumer as safe because the validator passed; the issue’s point is that the two parsers disagree on the same bytes.

Sources

  • CVE-2026-141596 at CVE.org — the VulnCheck CNA record: the “mishandles parser suspension inside CDATA sections within internal general entities” description, both CVSS vectors, CWE-476, the affected range 0 to 2.11.0, and the references to pull request #1545, issue #1419 and the 2.11.0 source (2 December 2026, 01:08 UTC)
  • Pull request #1545, “lib: Fix handling of suspension during entity-based CDATA section (fixes #1419, alternative to #1540)” — Sebastian Pipping, fix commit c30aaa2 co-authored by Luis Arancibia; opened 30 November, reworked and approved 1 December, milestone 2.12.0, open on 2 December 2026 · Issue #1419, “Processor state confusion related to CDATA handling”, opened 8 October 2026 from a report by fabwa: the document-buffer-on-resume analysis, the differential-parsing example and the “No malformed input is required for the DoS case” sentence · xmlparse.c at R_2_11_0, the lines the record cites
  • VulnCheck advisory — the CNA’s own page: High, libexpat through 2.11.0, CVSS 4.0 8.2, CWE-476, credit BartÅ‚omiej Dmitruk and Sebastian Pipping, no fixed version stated (2 December 2026)
  • NVD entry — no record on 2 December 2026 (the API returned zero results)
  • Distribution trackers: Debian · Ubuntu · Red Hat · SUSE — none had an entry readable on 2 December 2026
  • CISA KEV catalogue 2026.11.30, not listed · EPSS no score on 2 December 2026

Related reading

This advisory page was assembled from the primary sources listed above on 2 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.