Repository navigation
GH-51354: [C++][Parquet] Update bundled Apache Thrift to 0.24.0 - #51559
Conversation
|
|
|
Hi @wgtmac, this is my first contribution to Arrow. No rush at all, but I noticed the CI workflows for this PR seem to be stuck in "action_required" (likely pending approval for a first-time contributor). Could someone take a look when you have a chance? Thanks! |
Update the bundled Apache Thrift dependency from 0.22.0 to 0.24.0 to address CVE-2026-55969, an integer overflow vulnerability in TTransport::checkReadBytesAvailable() that could bypass message size checks when reading maliciously crafted Thrift-encoded data (e.g. via Parquet file metadata parsed with the compact protocol). The Clang-only patch (thrift-3187.patch) that suppressed a gnu-zero-variadic-macro-arguments warning is removed, since the underlying fix (THRIFT-3268) has been merged upstream and is already included in Thrift 0.24.0; keeping the patch would cause `git apply`/ `patch` to fail and break the build. Verified: - Downloaded thrift-0.24.0.tar.gz and confirmed its SHA256 matches the official checksum published at downloads.apache.org. - Confirmed the CVE fix is present in Thrift 0.24.0 by diffing TProtocol.h/TCompactProtocol.h/TBinaryProtocol.h/TTransport.h against 0.22.0. - Confirmed thrift-3187.patch no longer applies cleanly against 0.24.0 (already fixed upstream). - Built Arrow C++ with -DARROW_PARQUET=ON -DARROW_BUILD_TESTS=ON -DThrift_SOURCE=BUNDLED and ran parquet-internals-test, parquet-file-deserialize-test, parquet-schema-test, parquet-reader-test, and parquet-writer-test; all passed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
e1db601 to
1d1999a
Compare
|
@kou Does this look good to you? |
|
@github-actions crossbow submit -g cpp -g r |
|
Revision: 1d1999a Submitted crossbow builds: ursacomputing/crossbow @ actions-9cd9e6c731 |
|
Oh, Apache Thrift released 0.25.0 last week. |
|
Thanks for landing this! @kou @wgtmac - would you consider backporting it to a 26.0.1 patch release for CVE-2026-55969? I'm keen to take this upgrade without waiting on a new major release. |
|
Does the CVE really affect to Apache Parquet C++? |
|
Hi @kou, regarding "Does the CVE really affect Apache Parquet C++?": I looked into it, and I think it most likely does not with the default settings. I also owe an apology: the PR description says this change is relevant to Arrow, which overstated the impact. I had only confirmed that the fix is in Thrift 0.24.0, not whether it is reachable through Arrow's defaults. Arrow's Caveats: I only tested a list header on macOS arm64 with clang, not an end-to-end malicious file or Windows. So I don't think the CVE alone justifies a backport, though that is your call. (This analysis was done with the help of an AI tool, Claude Code; I reviewed the results.) |
### Rationale for this change Thrift 0.25.0 was released shortly after #51559 (bump to 0.24.0) was opened, so bump the bundled version again to keep up with the latest release for 27.0.0. ### What changes are included in this PR? - Bump the bundled Apache Thrift from 0.24.0 to 0.25.0 in `cpp/thirdparty/versions.txt`. The SHA256 matches the one published at downloads.apache.org. ### Are these changes tested? - Compared the 0.24.0 and 0.25.0 sources of the Thrift headers Arrow uses (`TCompactProtocol`, `TMemoryBuffer` in `TBufferTransports.h`, `TApplicationException`). The differences are const-correctness, explicit casts, and opt-in additions mainly for `TFramedTransport`; I found no change in the default behavior of `TMemoryBuffer`. - Built Arrow C++ locally on macOS (arm64, AppleClang) with `-DARROW_PARQUET=ON -DARROW_BUILD_TESTS=ON -DThrift_SOURCE=BUNDLED` on top of the current `main`, and ran `parquet-internals-test`, `parquet-file-deserialize-test`, `parquet-schema-test`, `parquet-reader-test`, `parquet-writer-test`, `parquet-arrow-reader-writer-test`, `parquet-arrow-metadata-test`, `parquet-arrow-index-test`, and `parquet-arrow-internals-test`. All passed (some tests were skipped, e.g. those requiring Snappy, which was not enabled in my build). - Not tested locally: Linux, Windows, and the R package builds; these rely on CI. ### Are there any user-facing changes? No. * GitHub Issue: #53931 --- Disclosure: this change was prepared with the assistance of an AI coding tool (Claude Code). I reviewed the diff and ran the tests locally before opening this PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Authored-by: Hanayoshi-8744 <201203709+Hanayoshi-8744@users.noreply.github.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Rationale for this change
The bundled Apache Thrift dependency (0.22.0) is affected by
CVE-2026-55969, an integer overflow vulnerability in
TTransport::checkReadBytesAvailable()that could bypass messagesize checks when reading maliciously crafted Thrift-encoded data.
Arrow's Parquet module relies on Thrift's compact protocol to
deserialize Parquet file metadata, so this is relevant to Arrow.
What changes are included in this PR?
cpp/thirdparty/versions.txt(including the SHA256 checksum).thrift-3187.patchand its application logicin
ThirdpartyToolchain.cmake. This patch pre-applied Thrift'supstream fix for THRIFT-3268 (a compiler warning), which has since
been merged into Thrift itself and is already included in 0.24.0.
Keeping the patch would make
git apply/patchfail during thebundled build with Clang.
Are these changes tested?
thrift-0.24.0.tar.gzdownloads correctly and itsSHA256 checksum matches the value published at
downloads.apache.org.
TProtocol.h,TCompactProtocol.h,TBinaryProtocol.h, andTTransport.hagainst 0.22.0.thrift-3187.patchno longer applies cleanly against0.24.0 sources (already fixed upstream), which is why it was
removed rather than kept as a no-op.
-DARROW_PARQUET=ON -DARROW_BUILD_TESTS=ON -DThrift_SOURCE=BUNDLED,on top of the latest
main(after rebasing), and ran the followingParquet tests. All of them passed with no failures (some tests were
skipped, e.g. those requiring Snappy, which was not enabled in my
build):
parquet-internals-test,parquet-file-deserialize-test,parquet-schema-test,parquet-reader-test,parquet-writer-test,parquet-arrow-reader-writer-test,parquet-arrow-metadata-test,parquet-arrow-index-test, andparquet-arrow-internals-test.CMAKE_CXX_COMPILER_ID STREQUAL "Clang", which my AppleClang builddoes not hit, so building the bundled Thrift with Clang on Linux
relies on CI. I also did not test encryption, Windows/MSVC, or the
Python/R packaging builds locally.
Are there any user-facing changes?
No.
Disclosure: this change was prepared with the assistance of an AI
coding tool (Claude Code). I reviewed the diff, verified the CVE fix
and checksum myself, and ran the test suite locally before opening
this PR.
🤖 Generated with Claude Code