Skip to content

Patch shaded Bouncy Castle dependencies to 1.86 - #12164

Merged
kiview merged 3 commits into
mainfrom
claude/project-thread-wajft6
Nov 14, 2026
Merged

kiview merged 3 commits into
mainfrom
claude/project-thread-wajft6

Conversation

@kiview

@kiview kiview commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Supersedes #12139 by @codefish1, rebased onto main now that #12138 (Jackson 2.18.12) is merged. The commit keeps the original author.

Fixes #12135.

Change

  • Pin bcprov-jdk18on, bcutil-jdk18on and bcpkix-jdk18on together at 1.86 in the core shaded build. Bouncy Castle comes in transitively through docker-java-core, which still declares 1.82.
  • Allow the META-INF/LICENSE.md resource that the newer jars ship in JarFileShadingTest.

The only conflict with #12138 was in the force block and the META-INF whitelist. Both sides are kept.

Verification

  • The shaded configuration resolves all three Bouncy Castle modules at 1.86 and Jackson at 2.18.12.
  • :testcontainers:jarFileTest and :testcontainers:japicmp pass locally.
  • The shaded jar contains no unrelocated classes, and the java.security.Provider service file is still excluded. Every class and member reference into the shaded Bouncy Castle packages resolves inside the jar.
  • TLS daemon connections, which CI doesn't cover, were checked manually against a TLS-only dockerd using DOCKER_TLS_VERIFY/DOCKER_CERT_PATH. RSA (PKCS#1, PKCS#8) and EC (SEC1, PKCS#8) client keys connect, a client cert from the wrong CA is rejected, and both match main's behaviour on 1.82.

Generated by Claude Code

Summary by CodeRabbit

  • Chores
    • Updated the core build to resolve Bouncy Castle provider and utility libraries at version 1.86.
  • Tests
    • Updated packaging checks to expect LICENSE.md in the META-INF directory listing, reflecting the expected license metadata in packaged artifacts.

Pin bcprov, bcutil and bcpkix (jdk18on) together at 1.86 in the core
shaded build and allow the LICENSE.md resource the newer jars ship.

Originally proposed in #12139; rebased onto main after #12138 with the
conflicting force block and JarFileShadingTest list merged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015e4ZbVcQMuDUob7DCLdUHm
@kiview
kiview requested a review from a team as a code owner November 14, 2026 11:37
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@kiview kiview self-assigned this Nov 14, 2026
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The build forces Bouncy Castle’s provider, utility, and PKIX modules to version 1.86. The shaded JAR test now expects LICENSE.md in the META-INF directory listing.

Changes: Bouncy Castle Shading

Layer / File(s) Summary
Pin modules and update shading assertion
core/build.gradle, core/src/jarFileTest/java/org/testcontainers/JarFileShadingTest.java
The build forces three Bouncy Castle modules to version 1.86. The META-INF listing assertion includes LICENSE.md.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Other · Severity of issue fixed: Medium

Suggested reviewers: eddumelendez, pioorg

Merge Risk: Minimal · up to 61a84

This updates the Bouncy Castle libraries embedded in the shaded core JAR to 1.86, as requested in issue #12135, and adjusts the shading test for the new LICENSE.md entry. No actionable merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: pinning the shaded Bouncy Castle modules (bcprov, bcutil, bcpkix jdk18on) to 1.86 in the core shaded build. It is specific and matches the raw summary and objectives. …
Description check Passed The description follows the repository template's intent. It explains the change and its context, and it links the superseded PR and the fixed issue (#12135). It lists the changes and gives verificati…
Linked Issues check Passed Issue #12135 has two coding requirements.

(1) Consistent fixed Bouncy Castle modules in the core shaded JAR. The whole-PR diff (merge base to head) adds three force entries at 1.86 in the configurati…
Out of Scope Changes check Passed The whole-PR diff changes two files.

- core/build.gradle: adds three Bouncy Castle force entries at 1.86 and one explanatory comment. These implement #12135.
- core/src/jarFileTest/java/org/testconta…
Full details: Title check

Explanation

The title names the main change: pinning the shaded Bouncy Castle modules (bcprov, bcutil, bcpkix jdk18on) to 1.86 in the core shaded build. It is specific and matches the raw summary and objectives. The title does not mention the JarFileShadingTest LICENSE.md allowance, which is a minor secondary change.

Full details: Description check

Explanation

The description follows the repository template's intent. It explains the change and its context, and it links the superseded PR and the fixed issue (#12135). It lists the changes and gives verification steps. The template's checklist items (new module files, checkstyle/spotless run) do not apply to a dependency pin, and the description does not state that spotless or checkstyle was run. The template's note against dependency-only version bumps is relevant here: the PR is a version bump, but it adds a test allowance and a force block, so the exception may apply. The description does not explain why the pin is needed beyond the transitive dependency note.

Full details: Linked Issues check

Explanation

Issue #12135 has two coding requirements.

(1) Consistent fixed Bouncy Castle modules in the core shaded JAR. The whole-PR diff (merge base to head) adds three force entries at 1.86 in the configurations.all resolutionStrategy block of core/build.gradle: bcprov-jdk18on, bcutil-jdk18on, and bcpkix-jdk18on. All three modules are covered at one version. A comment states that the forces should be removed once docker-java ships 1.86 or newer, which matches the issue's stated approach. I did not run the shaded configuration resolution, so the claim that it resolves at 1.86 rests on the PR description and the force entries.

(2) The shaded-JAR resource assertion must account for the 1.86 META-INF/LICENSE.md entry. The diff adds "LICENSE.md" to the expected META-INF list in core/src/jarFileTest/java/org/testcontainers/JarFileShadingTest.java. This is an automated test change that matches the requirement.

#4211 (whether to shade Bouncy Castle at all) is correctly excluded, as the issue states. The PR description reports that jarFileTest and japicmp pass locally. I did not re-run them. The manual TLS checks in the PR description are not coding requirements and do not affect this verdict.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff changes two files.

  • core/build.gradle: adds three Bouncy Castle force entries at 1.86 and one explanatory comment. These implement #12135.
  • core/src/jarFileTest/java/org/testcontainers/JarFileShadingTest.java: adds the LICENSE.md expectation. This is the test change that #12135 requires.

The Jackson 2.18.12 force lines in the same block are present in the merge base from the earlier merged #12138. They are not new changes in this PR. No other file changes appear in the diff. The PR description states that the change supersedes #12139 and resolves a conflict with #12138; this does not add unrelated code.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c0cee6cb-84f5-4da8-bd72-69b7916cd47e
Commits

Reviewing files that changed from the base of the PR and between d17f9e4 and 61a8489.

Files selected for processing: 1

  • core/build.gradle
Files skipped from review as they are similar to previous changes: 1

  • core/build.gradle

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015e4ZbVcQMuDUob7DCLdUHm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015e4ZbVcQMuDUob7DCLdUHm
@kiview
kiview merged commit 38b74fb into main Nov 14, 2026
81 of 83 checks passed
@kiview
kiview deleted the claude/project-thread-wajft6 branch November 14, 2026 15:51
@kiview kiview added this to the next milestone Nov 14, 2026 — with Claude
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Shaded Bouncy Castle 1.82 contains fixed vulnerabilities

2 participants