Repository navigation
Bump vendored expat from 2.8.2 to 2.9.0 - #124255
Conversation
`expat` is not a submodule: Poco vendors it, so the sources are re-vendored by hand. This brings `base/poco/XML` from upstream `R_2_8_2` to `R_2_9_0` (commit a76b1174c1ea), which also folds in the intermediate releases 2.8.3, 2.8.4 and 2.8.5. Security fixes that apply to code compiled here: - CVE-2026-77214 - `XML_ParseBuffer` did not validate `len` against the available buffer capacity (`xmlparse.cpp`) - CVE-2026-66046, CVE-2026-76641 - quadratic runtime from "attribute isCdata lookups", a denial of service (2.8.4) - CVE-2026-76957 - custom encoding callbacks could re-enter the parser (2.8.4) - CVE-2026-76956 - inverted `getentropy` return handling (2.8.4); not reachable here because `EXPAT_POCO` replaces expat's entropy gathering - CVE-2026-93990 - malformed UTF-16 smuggling (2.8.5); needs UTF-16 input, not reachable with the UTF-8 build used here - CVE-2026-72522 - out-of-bounds read in `*_toUtf16` (2.8.3); needs 16-bit character support, not enabled here CVE-2026-102633 (integer overflow in `expat_realloc` on 32-bit platforms) does not apply: `expat_realloc` is only compiled with `XML_GE == 1`, while this build defines `XML_GE=0` and targets 64-bit platforms. Other upstream changes that matter for the compiled code: the `XML_ATTR_INFO` and `XML_MIN_SIZE` features are dropped; `XML_ParserReset` now handles OOM while copying `encodingName`; the unknown encoding release callback runs before parser teardown; new Properties API and 64-bit location API functions are added; `xcs` is split out of `xmlparse.c` into `xcs.c`/`xcs.h`, and the hash table moves into `hash_table.h`. Local modifications re-applied on top of upstream 2.9.0: - the `EXPAT_POCO` blocks that replace expat entropy gathering with `Poco::RandomStream` (including reading into `unsigned long` for macOS) and the `XML_ResetHandlerCallDepth` helper - the `Poco/XML/expat.h` and `Poco/XML/expat_external.h` include paths - explicit casts on `malloc`/`realloc` results and on `void *data`, needed because `xmlparse.cpp` is compiled as C++ - `extern "C"` guards in `internal.h`, `xmltok.h`, `xmlrole.h` and `xcs.h`, which upstream removed when it stopped mixing C and C++ translation units; here `xmlparse.cpp` is C++ while `xmltok.c`, `xmlrole.c` and `xmlxcs.c` are C Files: `hash_table.h`, `xcs.h` and `xmlxcs.c` (upstream `xcs.c`, renamed so the `src/xml*.c` glob compiles it, since it is now a standalone source) are added; `xcsinc.c` is removed (upstream folded it into `xcs.c`); the rest of the vendored expat sources and headers are updated. `-Wno-unreachable-code-return` is added to the `_poco_xml` target: the new `XML_GetPropertyFloat64` and `XML_GetPropertyUInt64` end with a `return` that is unreachable because their `switch` handles every enum value. Co-Authored-By: Claude Code <[email protected]>
|
Workflow [PR], commit [5edd4ed] Summary: ❌
AI ReviewSummaryThis PR revendors Findings💡 Nits
Tests
Final Verdict
|
| return XML_STATUS_ERROR; | ||
| } | ||
|
|
||
| // Detect and avoid integer overflow |
There was a problem hiding this comment.
The security applicability note in the PR body is stale here: it says CVE-2026-77214 does not apply because Poco never calls XML_ParseBuffer, but base/poco/XML/src/XMLStreamParser.cpp:675 still drives expat through XML_GetBuffer + XML_ParseBuffer. Please update the description to treat that CVE as applicable, or at least drop the “never calls XML_ParseBuffer” rationale.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes7 object files changed (+4.16 KiB total), 1 added.
719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units156 translation units recompiled, 523 s compile time in total, 154 of them have a recent master baseline. |
The old glibc in the ppc64le sysroot defines `strncmp` as a recursive macro in `bits/string2.h`, and `xmlxcs.c` from expat 2.9.0 calls `strncmp` directly, which fails the build under `-Weverything -Werror`. The other poco targets already suppress this warning. Co-Authored-By: Claude Fable 5.1 <[email protected]>
0a46f51
Backport #124255 to 26.9: Bump vendored `expat` from 2.8.2 to 2.9.0
Backport #124255 to 26.8: Bump vendored `expat` from 2.8.2 to 2.9.0
Backport #124255 to 26.7: Bump vendored `expat` from 2.8.2 to 2.9.0
Backport #124255 to 26.3: Bump vendored `expat` from 2.8.2 to 2.9.0
Bump the vendored
expatinbase/poco/XMLfrom 2.8.2 to 2.9.0. The pin had also missed the 2.8.3–2.8.5 security releases.CVEs
Attacker-controlled XML reaches expat only through backup manifests (
.backup, read by RESTORE from user-chosen storage); every other input is operator-controlled configuration (server config,include_from/from_zk/from_env, UDF and dictionary files).CVE-2026-66046(HIGH, fixed in 2.8.4) — applies: a crafted multi-megabyte manifest spins a CPU during RESTORE (quadratic attribute handling).CVE-2026-93990(fixed in 2.8.5) — applies, low impact: lone UTF-16 surrogates silently alter characters; no memory corruption in this UTF-8 build.CVE-2026-76641(faulty intermediate fix never shipped in 2.8.2; needs external entity parsers, which Poco disables),CVE-2026-76957(Poco's encoding callback never re-enters the parser),CVE-2026-76956(entropy comes fromPoco::RandomStream, expat's own path is not compiled),CVE-2026-72522(needsXML_UNICODE),CVE-2026-77214(Poco callsXML_Parse, neverXML_ParseBuffer),CVE-2026-102633(32-bit only,XML_GE=0).ClickHouse-side changes
src/xmlparse.cpp,src/xmltok*.c,src/xmlrole.c, their headers andinclude/Poco/XML/expat*.h; new upstreamsrc/xcs.h,src/hash_table.h,src/xmlxcs.c(upstreamxcs.c, renamed to match thexml*.cglob);src/xcsinc.cremoved upstream.EXPAT_POCOentropy override, C++ casts,extern "C"guards (upstream dropped them;xmlparse.cppis C++ here).CMakeLists.txt:-Wno-unreachable-code-returnfor_poco_xml.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Update the vendored
expatto 2.9.0, fixing a denial of service through a crafted backup manifest during RESTORE (CVE-2026-66046) and the other 2.8.3–2.9.0 security fixes.Workflow [PR]
Sync PR [sync-upstream/pr/124255]
Version info
26.10.1.2375-master(included in26.10and later)26.9.19.13,26.8.27.13,26.7.31.8,26.3.54.5