Skip to content

Mitigate CVE-2026-114938 (Java4Shell) by disabling Base64 intrinsics - #55294

Open
Diogo-Rego wants to merge 1 commit into
keycloak:mainfrom
Diogo-Rego:fix/cve-2026-114938-java4shell-mitigation
Open

Diogo-Rego wants to merge 1 commit into
keycloak:mainfrom
Diogo-Rego:fix/cve-2026-114938-java4shell-mitigation

Conversation

@Diogo-Rego

Copy link
Copy Markdown

This PR disables OpenJDK hardware-accelerated Base64 decoding intrinsics (-XX:-UseBASE64Intrinsics) in default JVM options across kc.sh, kc.bat, and the Keycloak Operator Dockerfile.

This mitigates the critical CVE-2026-114938 (Java4Shell), which affects HotSpot C2 compiler Base64 intrinsics on x86-64 CPUs with AVX-512 VBMI instruction support. In default configurations, processing malformed Base64 data prior to authentication (such as HTTP Authorization: Basic headers, SAML assertions, and JWTs) can trigger an out-of-bounds write / memory corruption.

Disabling the intrinsic serves as the recommended mitigation until vendor-patched OpenJDK packages are broadly distributed in base container images.

Related Issue

Closes #55293

Verification & Testing

  • Verified that kc.sh injects -XX:-UseBASE64Intrinsics into the active JVM process (/proc/1/cmdline).
  • Verified that OAuth2 / OIDC token issuance, JWT handling, and realm operations continue functioning normally.
  • Verified that malformed Base64 authentication payloads are safely rejected without JVM crashes.

@Diogo-Rego
Diogo-Rego requested review from a team as code owners November 17, 2026 23:20
Copilot AI balanced review requested due to automatic review settings November 17, 2026 23:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

An unescaped parenthesis breaks the Windows launcher's option-selection control flow, and shared launcher tests lack an explicit assertion protecting the security mitigation.

No open issues 🎉

What changed in this PR

This PR adds JVM defaults intended to mitigate the reported Base64 intrinsic vulnerability in Keycloak server launchers and the Operator process.

Changes:

  • Add -XX:-UseBASE64Intrinsics and explanatory comments to the Unix and Windows launcher defaults.
  • Add the same flag to the Operator container’s Java entrypoint.
File Description
quarkus/​dist/​src/​main/​content/​bin/​kc.sh Disables Base64 intrinsics in default Unix JVM options.
quarkus/​dist/​src/​main/​content/​bin/​kc.bat Adds the mitigation to default Windows JVM options.
operator/​Dockerfile Disables Base64 intrinsics for the Operator JVM.

Review effort: Balanced

Disables OpenJDK hardware-accelerated Base64 intrinsics in default JVM options
to protect against heap out-of-bounds write / memory corruption (CVE-2026-114938)
on x86-64 processors supporting AVX-512 VBMI instructions.

Closes keycloak#55293

Signed-off-by: Diogo Rego <diego.arruda.amaral@gmail.com>
@Diogo-Rego
Diogo-Rego force-pushed the fix/cve-2026-114938-java4shell-mitigation branch from 729bec7 to 783a39a Compare November 17, 2026 23:28
Copilot AI balanced review requested due to automatic review settings November 17, 2026 23:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the change disabling JVM Base64 intrinsics by default.

No open issues 🎉

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mitigate OpenJDK Base64 intrinsic vulnerability (CVE-2026-114938 / Java4Shell)

3 participants