Repository navigation
Fix crash when reading malformed ZSTD-compressed ORC files (25.8) - #116162
Merged
Merged
Conversation
Bump the vendored `orc` submodule to include the cherry-pick of
`ORC-1966` ("[C++] Fix ZSTD compress/decompress to propagate errors").
Without this check, `ZSTDDecompressionStream::decompress` returned the
raw `ZSTD_decompressDCtx` result. On a malformed ZSTD frame that call
returns an error code as a near-2^64 `size_t`, which `BlockDecompressionStream::NextDecompress`
stored as the decompressed length and passed downstream unchecked. This
produced two exploitable symptoms when reading a crafted ORC input:
- the corrupt length reached protobuf parsing of the file footer, causing
an out-of-bounds `memcpy` and a server crash;
- the corrupt length reached the string blob reader feeding
`readColumnWithStringData`, causing an out-of-bounds/uninitialized read
copied into query results.
Both share this single root cause, so guarding the `ZSTD_isError` return
closes both. Newer releases (26.3+) already carry the fix via the
`orc` 2.3.1 bump; 25.8 did not receive that bump, so this is a minimal
targeted backport of only the ZSTD error-handling change.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Contributor
|
Workflow [BackportPR], commit [c7d4d8a] |
rschu1ze
approved these changes
Aug 24, 2026
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
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.
Backports the
ORC-1966fix to the vendoredorclibrary: check thereturn code of
ZSTD_decompressDCtx/ZSTD_compressCCtxand raise anexception instead of propagating the error code as a buffer length.
Reading a crafted ORC input with a corrupt ZSTD frame could otherwise
produce an out-of-bounds access when the bogus length reached footer
parsing or the string column reader. Newer releases already carry this
via the
orc2.3.1 bump; 25.8 did not, so this is a minimal targetedbackport of only the ZSTD error-handling change.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix a possible crash when reading a malformed ZSTD-compressed ORC file.