Skip to content

fix(java-base): Disable Base64 intrinsics to mitigate CVE-2026-114938 - #1741

Merged
dervoeti merged 4 commits into
mainfrom
fix/disable-base64-intrinsics-cve-2026-114938
Nov 18, 2026
Merged

dervoeti merged 4 commits into
mainfrom
fix/disable-base64-intrinsics-cve-2026-114938

Conversation

@dervoeti

@dervoeti dervoeti commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Description

Mitigates CVE-2026-114938 (Java4Shell) in all Java based images.

The HotSpot Base64 decode intrinsic in OpenJDK 17.0.6 and later can write up to 63 bytes past the end of the output buffer on x86-64 CPUs with AVX-512 VBMI. Temurin does not seem to have fixed builds yet.

As suggested in the recommendations, we now set JAVA_TOOL_OPTIONS="-XX:-UseBASE64Intrinsics", so the JVM falls back to the pure Java Base64 implementation.

All product images with a JVM use one of these two images as the base of their final stage, so they pick this up on rebuild.

Things to be aware of:

  • The JVM now logs Picked up JAVA_TOOL_OPTIONS: -XX:-UseBASE64Intrinsics to stderr on every start.
  • Setting JAVA_TOOL_OPTIONS on a Pod replaces the value from the image and removes the mitigation, we should inform our customers about that.
  • The flag is set for all Java versions. Java 11 is not affected by the CVE, there it only disables the Base64 encode intrinsic.
  • Base64 decoding and encoding get slower, I did not measure by how much.
  • This is meant to be temporary and can be removed once all Temurin versions we install contain the upstream fix.

Testing

Built java-base 11 and 25 and jdk-base 21 from this branch. In all three the JVM starts and reports UseBASE64Intrinsics = false.

On a node with AVX-512 VBMI (Ice Lake) I ran the Base64Trigger reproducer published in the advisory:

  • kafka:4.2.1-stackable26.7.0 (Temurin 25.0.3+9): reproduced
  • kafka:3.9.2-stackable26.7.0 (Temurin 21.0.11+10): reproduced.
  • java-base 25 from this branch (Temurin 25.0.5+8): not reproduced.
  • The same java-base 25 with JAVA_TOOL_OPTIONS set to an empty value: reproduced again, so the flag is what prevents it and not the newer Temurin build.

Definition of Done Checklist

Note

Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant.

Please make sure all these things are done and tick the boxes

  • Changes are OpenShift compatible
  • All added packages (via microdnf or otherwise) have a comment on why they are added
  • Things not downloaded from Red Hat repositories should be mirrored in the Stackable repository and downloaded from there
  • All packages should have (if available) signatures/hashes verified
  • Add an entry to the CHANGELOG.md file
  • Integration tests ran successfully
TIP: Running integration tests with a new product image

The image can be built and uploaded to the kind cluster with the following commands:

boil build <IMAGE> --image-version <RELEASE_VERSION> --strip-architecture --load
kind load docker-image <MANIFEST_URI> --name=<name-of-your-test-cluster>

See the output of boil to retrieve the image manifest URI for <MANIFEST_URI>.

@dervoeti dervoeti moved this to Development: Waiting for Review in Stackable Engineering Nov 18, 2026
@dervoeti dervoeti self-assigned this Nov 18, 2026
sbernauer
sbernauer previously approved these changes Nov 18, 2026

@sbernauer sbernauer 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.

LGTM, but a few points

  1. We should track to remove this again, maybe the deprecation board and schedule it for the next release?
  2. Not sure how hard it is to contain this "fix" to only amd64 and leave arm64 as is - maybe ask AI? If it is more than like 5 lines I'm ok as-is.
  3. We should definitely mention this in the release notes, as this could be a performance regression

@sbernauer sbernauer moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering Nov 18, 2026
@sbernauer sbernauer added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Nov 18, 2026
@Techassi

Techassi commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Not sure how hard it is to contain this "fix" to only amd64 and leave arm64 as is - maybe ask AI? If it is more than like 5 lines I'm ok as-is.

boil currently has no feature to differentiate builds by the target architecture. This could be something we can add.

We should definitely mention this in the release notes, as this could be a performance regression

I agree. @dervoeti can you write up a short release note snippet as a comment or as part of the PR description?

sbernauer
sbernauer previously approved these changes Nov 18, 2026

@sbernauer sbernauer 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.

Point 2 has been addressed, thank you!

Comment thread java-base/Dockerfile Resolved
@dervoeti

Copy link
Copy Markdown
Member Author

Release note

The Java based product images now disable the HotSpot Base64 intrinsics on amd64 (-XX:-UseBASE64Intrinsics via JAVA_TOOL_OPTIONS) to mitigate CVE-2026-114938 (Java4Shell), until fixed Temurin builds are available. Setting JAVA_TOOL_OPTIONS through envOverrides or podOverrides replaces this value and thus might remove the mitigation.

@dervoeti

Copy link
Copy Markdown
Member Author

Follow up issue: #1742

@dervoeti
dervoeti added this pull request to the merge queue Nov 18, 2026
@Techassi Techassi moved this from Development: In Review to Development: Done in Stackable Engineering Nov 18, 2026
Merged via the queue into main with commit 7ffa62c Nov 18, 2026
3 checks passed
@dervoeti
dervoeti deleted the fix/disable-base64-intrinsics-cve-2026-114938 branch November 18, 2026 11:55
@lfrancke lfrancke moved this from Development: Done to Done in Stackable Engineering Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/26.11.0 release-note Denotes a PR that will be considered when it comes time to generate release notes.

Projects

Development

Successfully merging this pull request may close these issues.

4 participants