Bump shaded bouncycastle and libthrift to clear remaining CVE findings#1461
Open
vikrantpuppala wants to merge 4 commits into
Open
Bump shaded bouncycastle and libthrift to clear remaining CVE findings#1461vikrantpuppala wants to merge 4 commits into
vikrantpuppala wants to merge 4 commits into
Conversation
Addresses three GHSA-tracked vulnerabilities in bcprov-jdk18on and bcpkix-jdk18on that are invisible to NVD-CPE scanners but surface through OSV: * GHSA-p93r-85wp-75v3 (CVE-2026-5598) -- covert timing channel, severity 8.9, fixed in 1.84 * GHSA-wg6q-6289-32hp -- bcpkix vulnerability, severity 6.3 * GHSA-c3fc-8qff-9hwx -- bcprov vulnerability, severity 5.5 All three were discovered while building the OSV-Scanner gate in #1460, which catches GHSA-only advisories that OWASP's NVD-CPE matcher misses. Co-authored-by: Isaac Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
Clears the May 2026 Apache Thrift advisory batch (GHSA-7pwc-h2j2-rjgj covering CVE-2026-41603/41604/41605/43869). All four affect parser paths and were the only libthrift CVEs in that batch not already suppressed as non-Java-binding false positives. The bump required regenerating the checked-in Thrift-generated Java sources because libthrift 0.21 added a third generic parameter to `org.apache.thrift.ProcessFunction` via THRIFT-5762, which made the existing TCLIService.java (generated by Thrift 0.19) fail to compile against the 0.23 runtime ("wrong number of type arguments; required 3" on every AsyncMethodCallback callsite). Regeneration steps documented in the new scripts/regenerate-thrift.sh: 1. Builds the Apache Thrift 0.23.0 compiler from source (the official Docker images aren't versioned past 0.12.0; building compiler-only with --enable-libs=no takes <1 min). 2. Runs `thrift --gen java` against the IDL at jdbc-core/src/main/java/com/databricks/jdbc/dbclient/impl/thrift/ TCLIService.thrift. 3. Replaces the contents of jdbc-core/src/main/java/com/databricks/jdbc/model/client/thrift/ generated/ (~107 files). 4. Runs `mvn spotless:apply` so the new sources match the project's formatting. The IDL has also been re-synced from the canonical source at ~/universe/peco/thrift/TCLIService.thrift (per the README there, this IDL feeds the Python, Node.js, Go, and Java SQL drivers). The in-repo copy is identical except for a 2-line comment header. Verified locally: - mvn clean install -DskipTests -Plocal succeeds. - mvn -pl jdbc-core test -Plocal -Dgroups='!Jvm17PlusAndArrowToNio ReflectionDisabled' passes 3288 tests with 0 failures, 0 errors. Co-authored-by: Isaac Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
The canonical IDL is maintained upstream as part of the shared Thrift interface for SQL drivers; carrying a copy in this repo creates drift risk without adding value. The generated Java sources (~107 files in src/main/java/com/databricks/jdbc/model/client/thrift/generated/) are what the build actually consumes, so removing the IDL doesn't change behavior or the Maven build. Drops: - src/main/java/com/databricks/jdbc/dbclient/impl/thrift/TCLIService.thrift - scripts/regenerate-thrift.sh (no longer needed without the IDL) When a future libthrift bump requires regenerating the generated code, that should happen against the upstream IDL and tooling, not from a copy here. Co-authored-by: Isaac Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
…t 0.23
libthrift 0.21+ began dereferencing the return value of
TTransport.getConfiguration() in the message-reading code path (e.g.
TProtocolUtil.readMessageBegin reads the recursion limit). Our custom
DatabricksHttpTTransport returned null, which worked under 0.19 (where
the framework tolerated null) but throws NullPointerException under
0.23:
java.lang.NullPointerException: Cannot invoke
"org.apache.thrift.TConfiguration.getRecursionLimit()" because the
return value of "org.apache.thrift.transport.TTransport.getConfiguration()"
is null
This caused 182 errors across the THRIFT_SERVER fake-service integration
test matrix in the previous CI run on this PR. The unit-test suite
didn't catch it because integration tests are excluded from the
unit-test group (they require a fake service running).
Fix: return TConfiguration.DEFAULT (libthrift's built-in default).
DatabricksHttpTTransport doesn't need a custom configuration because
it's an HTTP-based transport with bounded message sizes governed by
the HTTP client, not by Thrift framing.
Verified locally:
- 106 thrift-related unit tests pass.
- The TConfiguration NPE no longer appears in surefire reports when
running ResultSetIntegrationTests with FAKE_SERVICE_TYPE=THRIFT_SERVER.
Co-authored-by: Isaac
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
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.
Summary
Clears the two remaining unsuppressed CVSS≥7 findings against the JDBC driver (visible via PR #1460's OSV-Scanner gate). Three commits — two version bumps and a small cleanup:
ProcessFunctionvia THRIFT-5762).What this PR is NOT
Test plan
mvn clean install -DskipTests -Plocalsucceeds across all three commits (including after the IDL/script deletion — the Maven build never referenced either).mvn -pl jdbc-core test -Plocal -Dgroups='!Jvm17PlusAndArrowToNioReflectionDisabled'— 3288 tests, 0 failures, 0 errors after the libthrift regen.mvn dependency:treeconfirms resolved versions:libthrift 0.23.0,bcprov-jdk18on 1.84,bcpkix-jdk18on 1.84.Follow-up: flip security-scan to required
Once both this PR and #1460 land, the PR security-scan gate from #1460 should have zero unsuppressed CVSS≥7 findings on main. That's the cue to flip the gate's check to required-to-merge in branch protection (the explicit plan from #1460).
This pull request and its description were written by Isaac.