Skip to content

Commit d7df7eb

Browse files
committed
Merge main into geospatial branch; preserve deferred kernel pin
Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com>
2 parents 8e76809 + 9eb024c commit d7df7eb

11 files changed

Lines changed: 537 additions & 121 deletions

File tree

‎poetry.lock‎

Lines changed: 46 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pyproject.toml‎

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,26 @@ python = "^3.10"
2121
# a wheel and never runs setup.py on DBR LTS -- the build-time break cannot
2222
# trigger. The `DBR LTS Install` CI check (.github/workflows/dbr-lts-install.yml)
2323
# installs the built artifact on real DBR LTS clusters and is the authoritative
24-
# gate for this. Cap at <0.25.0: thrift is pre-1.0, each 0.x minor can carry
25-
# breaking changes or packaging regressions (see 0.23.0), so bump this
26-
# deliberately once a new minor ships and the DBR-LTS gate proves it safe.
27-
thrift = "~=0.24.0"
24+
# gate for this.
25+
#
26+
# Ceiling raised to <0.26.0 for 0.25.0 (released 2026-09-30, THRIFT-6067 series
27+
# follow-up), which fixes 61 CVEs across language bindings, several affecting
28+
# the Python binding this connector uses (see #969), e.g. CVE-2026-66858
29+
# (skip() recursion-limit bypass in the Python accelerator) and CVE-2026-85494
30+
# (framed transport / binary protocol size a read buffer from a peer-declared
31+
# length with no effective maximum). 0.25.0 ships the same prebuilt wheel
32+
# matrix as 0.24.0 (manylinux2014/macOS/musl/Windows, cp310-cp314), so the
33+
# DBR LTS build-time risk above does not apply; the `DBR LTS Install` CI gate
34+
# remains the authoritative check. thrift is pre-1.0, so keep this ceiling one
35+
# minor ahead and bump deliberately once a newer minor ships and the DBR-LTS
36+
# gate proves it safe -- do not use an open-ended `^`/`>=` constraint.
37+
#
38+
# NOTE: 0.25.0 also changes TBinaryProtocol's default `string_length_limit`
39+
# from unbounded to ~15.6 MiB (see the explicit `string_length_limit=None` /
40+
# `container_length_limit=None` passed in thrift_backend.py's protocol
41+
# construction, which preserves the connector's pre-0.25 unbounded behavior
42+
# for its own already-bounded, trusted-server result stream).
43+
thrift = ">=0.24.0,<0.26.0"
2844
pandas = [
2945
{ version = ">=1.2.5,<4.0.0", python = ">=3.10,<3.13" },
3046
{ version = ">=2.2.3,<4.0.0", python = ">=3.13" }

‎src/databricks/sql/backend/thrift_backend.py‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,19 @@
7777
TIMESTAMP_AS_STRING_CONFIG = "spark.thriftserver.arrowBasedRowSet.timestampAsString"
7878
DEFAULT_SOCKET_TIMEOUT = float(900)
7979

80+
# thrift>=0.25.0 changed TBinaryProtocol's default string_length_limit from
81+
# unbounded (None) to DEFAULT_STRING_LENGTH_LIMIT (DEFAULT_MAX_FRAME_SIZE,
82+
# ~15.6 MiB) as part of its CVE-2026-85494 fix (peer-declared length with no
83+
# effective maximum). That default is sized for untrusted/unbounded peers;
84+
# this connector already bounds its own result stream via the TLS-verified,
85+
# server-negotiated `buffer_size_bytes` (default 100 MiB, see client.py's
86+
# DEFAULT_RESULT_BUFFER_SIZE_BYTES) and the inline Arrow batches in
87+
# TFetchResultsResp routinely exceed thrift's new ~15.6 MiB cap. Pass these
88+
# explicitly so upgrading thrift does not silently cap -- or regress -- the
89+
# connector's own, already-bounded result size behavior.
90+
THRIFT_BINARY_PROTOCOL_STRING_LENGTH_LIMIT = None
91+
THRIFT_BINARY_PROTOCOL_CONTAINER_LENGTH_LIMIT = None
92+
8093
# see Connection.__init__ for parameter descriptions.
8194
# - Min/Max avoids unsustainable configs (sane values are far more constrained)
8295
# - 900s attempts-duration lines up w ODBC/JDBC drivers (for cluster startup > 10 mins)
@@ -238,7 +251,11 @@ def __init__(
238251
self._transport.setTimeout(timeout and (float(timeout) * 1000.0))
239252

240253
self._transport.setCustomHeaders(dict(http_headers))
241-
protocol = thrift.protocol.TBinaryProtocol.TBinaryProtocol(self._transport)
254+
protocol = thrift.protocol.TBinaryProtocol.TBinaryProtocol(
255+
self._transport,
256+
string_length_limit=THRIFT_BINARY_PROTOCOL_STRING_LENGTH_LIMIT,
257+
container_length_limit=THRIFT_BINARY_PROTOCOL_CONTAINER_LENGTH_LIMIT,
258+
)
242259
self._client = TCLIService.Client(protocol)
243260

244261
try:

0 commit comments

Comments
 (0)