Skip to content

GH-51354: [C++][Parquet] Update bundled Apache Thrift to 0.24.0 - #51559

Merged
kou merged 1 commit into
apache:mainfrom
Hanayoshi-8744:GH-51354-update-thrift
Oct 8, 2026
Merged

kou merged 1 commit into
apache:mainfrom
Hanayoshi-8744:GH-51354-update-thrift

Conversation

@Hanayoshi-8744

@Hanayoshi-8744 Hanayoshi-8744 commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

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 message
size 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?

  • Bump the bundled Apache Thrift version from 0.22.0 to 0.24.0 in
    cpp/thirdparty/versions.txt (including the SHA256 checksum).
  • Remove the Clang-only thrift-3187.patch and its application logic
    in ThirdpartyToolchain.cmake. This patch pre-applied Thrift's
    upstream 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/patch fail during the
    bundled build with Clang.

Are these changes tested?

  • Verified that thrift-0.24.0.tar.gz downloads correctly and its
    SHA256 checksum matches the value published at
    downloads.apache.org.
  • Confirmed the CVE fix is present in Thrift 0.24.0 by diffing
    TProtocol.h, TCompactProtocol.h, TBinaryProtocol.h, and
    TTransport.h against 0.22.0.
  • Confirmed thrift-3187.patch no longer applies cleanly against
    0.24.0 sources (already fixed upstream), which is why it was
    removed rather than kept as a no-op.
  • Built Arrow C++ locally on macOS (arm64, AppleClang) with
    -DARROW_PARQUET=ON -DARROW_BUILD_TESTS=ON -DThrift_SOURCE=BUNDLED,
    on top of the latest main (after rebasing), and ran the following
    Parquet 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, and
    parquet-arrow-internals-test.
  • Not tested locally: the removed patch was only applied for
    CMAKE_CXX_COMPILER_ID STREQUAL "Clang", which my AppleClang build
    does 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

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #51354 has been automatically assigned in GitHub to PR creator.

@Hanayoshi-8744

Copy link
Copy Markdown
Contributor Author

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>
@Hanayoshi-8744
Hanayoshi-8744 force-pushed the GH-51354-update-thrift branch from e1db601 to 1d1999a Compare October 5, 2026 16:13
@github-actions github-actions Bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Oct 7, 2026
@wgtmac

wgtmac commented Oct 8, 2026

Copy link
Copy Markdown
Member

@kou Does this look good to you?

@kou

kou commented Oct 8, 2026

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g cpp -g r

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

Revision: 1d1999a

Submitted crossbow builds: ursacomputing/crossbow @ actions-9cd9e6c731

Task Status
example-cpp-minimal-build-static GitHub Actions
example-cpp-minimal-build-static-system-dependency GitHub Actions
example-cpp-tutorial GitHub Actions
r-binary-packages GitHub Actions
r-recheck-most GitHub Actions
test-build-cpp-fuzz GitHub Actions
test-conda-cpp GitHub Actions
test-conda-cpp-valgrind GitHub Actions
test-debian-13-cpp-amd64 GitHub Actions
test-debian-13-cpp-i386 GitHub Actions
test-debian-experimental-cpp-gcc-15 GitHub Actions
test-fedora-42-cpp GitHub Actions
test-r-alpine-linux-cran GitHub Actions
test-r-arrow-backwards-compatibility GitHub Actions
test-r-depsource-system GitHub Actions
test-r-dev-duckdb GitHub Actions
test-r-devdocs GitHub Actions
test-r-extra-packages GitHub Actions
test-r-fedora-clang GitHub Actions
test-r-gcc-11 GitHub Actions
test-r-gcc-12 GitHub Actions
test-r-install-local GitHub Actions
test-r-install-local-minsizerel GitHub Actions
test-r-linux-as-cran GitHub Actions
test-r-linux-rchk GitHub Actions
test-r-linux-sanitizers GitHub Actions
test-r-linux-valgrind GitHub Actions
test-r-m1-san GitHub Actions
test-r-macos-as-cran GitHub Actions
test-r-offline-maximal GitHub Actions
test-r-ubuntu-22.04 GitHub Actions
test-r-versions GitHub Actions
test-r-wasm GitHub Actions
test-ubuntu-22.04-cpp GitHub Actions
test-ubuntu-22.04-cpp-bundled GitHub Actions
test-ubuntu-22.04-cpp-emscripten GitHub Actions
test-ubuntu-22.04-cpp-no-threading GitHub Actions
test-ubuntu-24.04-cpp GitHub Actions
test-ubuntu-24.04-cpp-gcc-13-bundled GitHub Actions
test-ubuntu-24.04-cpp-gcc-14 GitHub Actions
test-ubuntu-24.04-cpp-minimal-with-formats GitHub Actions
test-ubuntu-24.04-cpp-thread-sanitizer GitHub Actions

@kou kou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@kou
kou merged commit c7944b3 into apache:main Oct 8, 2026
57 checks passed
@kou kou removed the awaiting committer review Awaiting committer review label Oct 8, 2026
@kou

kou commented Oct 8, 2026

Copy link
Copy Markdown
Member

Oh, Apache Thrift released 0.25.0 last week.

@matthewbayer

Copy link
Copy Markdown

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.

@kou

kou commented Oct 9, 2026

Copy link
Copy Markdown
Member

Does the CVE really affect to Apache Parquet C++?

@Hanayoshi-8744

Copy link
Copy Markdown
Contributor Author

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 ThriftDeserializer (the only place where Arrow reads Thrift data) passes a container size limit (default 1,000,000) to TCompactProtocolT, and Thrift checks it before the overflowing multiplication in checkReadBytesAvailable. I confirmed this with a small harness mimicking Arrow's setup, fed with a list header claiming 2^28 UUIDs (the case from the upstream regression test, apache/thrift@983c813c9a). With 0.22.0 (unoptimized build) it is rejected with SIZE_LIMIT at the default limit, and the size check is bypassed only if the limit is raised to well over 100 million or disabled (0, possible only via the C++ API). 0.24.0 rejects it in all cases.

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.)

@Hanayoshi-8744
Hanayoshi-8744 deleted the GH-51354-update-thrift branch October 15, 2026 14:19
kou pushed a commit that referenced this pull request Oct 16, 2026
### 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants