Repository navigation
Cherry pick #130311 to 26.3: Bump vendored expat from 2.9.0 to 2.10.0 - #130434
Merged
Merged
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_9_0` (commit a76b1174c1ea) to `R_2_10_0` (commit a70841d9ffa6). Security fixes that apply to code compiled here: - CVE-2026-113351 - denial of service via `XML_ParserReset` (`xmlparse.cpp`) - CVE-2026-115506 - billion laughs attacks are now detected quicker and for more of their variations: `accountingCurrentAmplificationTolerated` takes the not-yet-charged indirect bytes, and entity expanded sizes are resolved by an explicit-stack analysis in `resolveEntityClosureExpandedSize` - CVE-2026-117610 - segfault on initial non-final empty subparser parse calls - CVE-2026-118370 - signed integer overflow of `attIndex` and `nPrefixes` in `storeAtts` CVE-2026-124317 is not mentioned in the upstream `Changes` for 2.10.0 (it is not listed among the releases up to `R_2_10_0`) and is not fixed here. Other upstream changes that matter for the compiled code: `XML_Parse` handles `XML_CONTEXT_BYTES == 0` correctly, `m_parsingStatus.finalBuffer` is initialized in `parserInit`, `isCalledFromInsideHandler` is checked first in `XML_Parse`, a missing character-handler reset check and a missing `m_startDoctypeDeclHandler` NULL check are added, `ENTITY.textLen` and `ENTITY.processed` become `size_t`, and integer truncation in `XmlGetAttributes`/`getAtts` is fixed. `parserInit` gained an `isReset` parameter so that `XML_ParserReset` no longer clobbers the amplification properties, and the allocator tracks `bytesAllocatedWhenLastReset` so one document cannot skew the memory accounting of the next. Local modifications re-applied on top of upstream 2.10.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 - the removal of the `EXPAT_*_DEBUG` tracing (`getDebugLevel`, `unsignedCharToPrintable`, the accounting/entity/allocation report helpers, and the `debugLevel` and `peakBytesAllocated` fields), which upstream restructured in this release; the report call sites added by 2.10.0 in `resolveEntityClosureExpandedSize` are dropped as well Files: `entities.h` is a new upstream header included by `xmlparse.cpp` (with the `Poco/XML/expat_external.h` include path applied). `xcs.h` gains the new `xcsnstr` declaration; `xmlxcs.c` (upstream `xcs.c`) gains its definition. `-Wno-declaration-after-statement` is added to the `_poco_xml_expat` target: the new `xcsnstr` in `xmlxcs.c` declares a variable after a statement, which `-Weverything` rejects even under `-std=gnu11`. Co-Authored-By: Claude Code <[email protected]>
The style check's whitespace_check rejects ", "; the other vendored expat headers already carry the collapsed form. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Bump vendored `expat` from 2.9.0 to 2.10.0
Resolve conflicts in `xmlparse.cpp`: release branch 26.3 still contains the debug-output code removed on master by #126748, so take upstream expat 2.9.0 -> 2.10.0 changes on top of the branch file instead of the master file. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original pull-request #130311
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Before you resolve anything
Conflicts are often caused by a prerequisite change that has not been backported yet, rather than by a real divergence. The bot re-tries this cherry-pick against the release branch on every run, so if that is the case here it will merge itself as soon as the prerequisite lands, and you will see a comment saying so. Manual resolution is only needed while the conflict persists.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job