Skip to content

fix: allow thrift 0.25.x and clear additional Apache Thrift CVEs - #975

Merged
vuanhphung merged 1 commit into
mainfrom
vu-phung/thrift-0.25-upgrade
Oct 8, 2026
Merged

vuanhphung merged 1 commit into
mainfrom
vu-phung/thrift-0.25-upgrade

Conversation

@vuanhphung

Copy link
Copy Markdown
Collaborator

Internal copy of #970 by @hannonpi1228 so CI checks that need repository secrets (notably DBR LTS Install) can run. The contributor's commit is preserved and rebased on main; only the poetry.lock content-hash conflicted and was recomputed.

Closes #969.

Summary

Widens thrift to >=0.24.0,<0.26.0 and locks 0.25.0, which fixes several CVEs affecting the Python binding (including CVE-2026-85494 and CVE-2026-66858). 0.25.0 also changes TBinaryProtocol's default string_length_limit from unbounded to 16,384,000 bytes per field, so the connector now passes string_length_limit=None explicitly to keep large inline results (e.g. Arrow batches) readable as before.

Review notes

  • string_length_limit=None preserves pre-0.25 behavior but opts the connector's Thrift path out of the new default bound. A large finite cap is the alternative.
  • THttpClient, TSocket and TSerialization are unchanged between thrift 0.24.0 and 0.25.0, and 0.25.0 ships the same wheel matrix (plus Windows ARM64), so the DBR LTS sdist-build failure that motivated the original pin shouldn't recur. DBR LTS Install is the gate.
  • CI re-runs poetry lock against JFrog; confirm the logs show thrift 0.25.0 installed rather than a fallback to 0.24.0.

Testing

  • Unit tests with thrift 0.25.0 on Python 3.12: 1020 passed, 6 skipped.

This pull request and its description were written by Isaac.


This PR was created with GitHub MCP.

Widen the thrift constraint from ~=0.24.0 to >=0.24.0,<0.26.0 so 0.25.0
can be resolved. thrift 0.25.0 fixes 61 CVEs across language bindings,
several affecting the Python binding this connector uses, including
CVE-2026-66858 (skip() recursion-limit bypass in the Python accelerator)
and CVE-2026-85494 (framed transport / binary protocol size a read
buffer from a peer-declared length with no effective maximum).

thrift 0.25.0 also changes TBinaryProtocol's default string_length_limit
from unbounded (None) to ~15.6 MiB (DEFAULT_MAX_FRAME_SIZE) as part of
that same CVE-2026-85494 fix. This connector already bounds its own
result stream via the TLS-verified, server-negotiated buffer_size_bytes
(default 100 MiB), and inline Arrow result batches in TFetchResultsResp
routinely exceed thrift's new ~15.6 MiB cap, so a bare version bump would
regress large-result-set reads. Construct TBinaryProtocol with explicit
string_length_limit=None and container_length_limit=None to preserve
pre-0.25 unbounded behavior for the connector's own already-bounded,
trusted-server result stream.

0.25.0 ships the same prebuilt wheel matrix as 0.24.0
(manylinux2014/macOS/musl/Windows, cp310-cp314), so the DBR LTS
build-time packaging risk that originally capped this dependency
(#798, #840) does not apply; the DBR LTS Install CI gate remains the
authoritative check.

Closes #969

Signed-off-by: Paddy Hannon <pih@ehukai.com>
AOS-Session: 01a10c87-3242-7517-a60e-279091b796c3
AOS-Session: pi-1791211537-21291-e08bda26
AOS-Commit-Time: 2026-10-05T15:03:26Z
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: 1 Low

Looks good — a clean, well-documented thrift 0.24→0.25 bump (CVE remediation) plus an explicit string_length_limit=None/container_length_limit=None passthrough to preserve pre-0.25 unbounded-read behavior, with matching unit coverage. The only occurrence of the affected TBinaryProtocol construction in the library path is the one changed, and the new kwargs are valid on both ends of the version constraint. One low-severity note on preferring a finite cap over fully unbounded as defense-in-depth.

Comment thread src/databricks/sql/backend/thrift_backend.py
@vuanhphung vuanhphung added integration-test Triggers proxy-based integration tests; auto-removed on new commits. kernel-e2e Trigger preview run of the Kernel E2E workflow on this PR labels Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

Integration tests triggered. View workflow runs. Result posts back here as the "Python Integration Tests" check.

1 similar comment
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

Integration tests triggered. View workflow runs. Result posts back here as the "Python Integration Tests" check.

@vuanhphung
vuanhphung enabled auto-merge October 8, 2026 06:56
@vuanhphung
vuanhphung added this pull request to the merge queue Oct 8, 2026
Merged via the queue into main with commit 1558595 Oct 8, 2026
109 of 114 checks passed

This branch was successfully deployed

1 active deployment
azure-prod — 8a237688 Deployed Oct 8, 2026 by vuanhphung via run-kernel-e2e #602
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted integration-test Triggers proxy-based integration tests; auto-removed on new commits. kernel-e2e Trigger preview run of the Kernel E2E workflow on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

thrift pin (<0.25.0) blocks fix for additional Apache Thrift CVEs (CVE-2026-66858, CVE-2026-85494, and others fixed in 0.25.0)

3 participants