Skip to content

fix: Disable JVM Base64 intrinsics to mitigate CVE-2026-114938 #WPB-30191 - #173

Merged
alexandreferris merged 1 commit into
mainfrom
fix/WPB-30191-disable-base64-intrinsics
Nov 20, 2026
Merged

alexandreferris merged 1 commit into
mainfrom
fix/WPB-30191-disable-base64-intrinsics

Conversation

@alexandreferris

@alexandreferris alexandreferris commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

Causes (Optional)

On x86-64 CPUs with AVX-512 VBMI (Intel Ice Lake / AMD Zen 4 or newer), the OpenJDK JIT swaps in a hand-tuned Base64 decoder intrinsic that mishandles crafted input. An attacker who can get Base64 data decoded by the app can execute code inside the JVM.

The app runs on eclipse-temurin:21-jre (Temurin 21.0.13+9 / 21.0.12.1+1), which is in the affected range, and the image is linux/amd64. The fixed Temurin 21.0.13.1+2 binaries are already released by Adoptium, but the eclipse-temurin:21-jre Docker image has not been updated yet.

Solutions

  • Set ENV JAVA_TOOL_OPTIONS="-XX:-UseBASE64Intrinsics" in the runtime stage of the Dockerfile. This disables the Base64 intrinsic entirely, so the JVM falls back to the plain Java implementation regardless of the node's CPU.
  • JAVA_TOOL_OPTIONS is read by the JVM itself, so it works with the existing java -jar entrypoint without touching the Helm charts or per-environment values.
  • This is a temporary workaround: once eclipse-temurin:21-jre ships 21.0.13.1+, rebuild and remove the ENV line.

Tested locally (linux/amd64 build of the image):

  • docker inspect shows JAVA_TOOL_OPTIONS=-XX:-UseBASE64Intrinsics in the image
  • java -XX:+PrintFlagsFinal inside the image: UseBASE64Intrinsics = false {environment} (it is true {default} without the flag)
  • Real entrypoint logs Picked up JAVA_TOOL_OPTIONS: -XX:-UseBASE64Intrinsics and the app starts normally (stops only on missing Wire credentials, as expected locally)

…0191

Set JAVA_TOOL_OPTIONS=-XX:-UseBASE64Intrinsics in the runtime image to
turn off the vulnerable Base64 intrinsic (Java4Shell), which is
exploitable on x86-64 CPUs with AVX-512 VBMI.

Temporary workaround until eclipse-temurin:21-jre ships 21.0.13.1+;
remove the ENV line once the image is rebuilt on the fixed version.
@alexandreferris
alexandreferris requested a review from a team as a code owner November 20, 2026 15:54
@alexandreferris alexandreferris self-assigned this Nov 20, 2026
@claude

claude Bot commented Nov 20, 2026

Copy link
Copy Markdown

Review: Disable JVM Base64 intrinsics (CVE-2026-114938)

The change is small and sensible, and I'd approve it. Using JAVA_TOOL_OPTIONS works with the exec-form ENTRYPOINT ["java", "-jar", ...], needs no Helm changes, and the comment explains both why the line is there and when to remove it. Your local check (UseBASE64Intrinsics = false {environment}) is the right way to confirm the flag is applied.

⚠️ Deployment: production won't get this fix just from merging

helm/githubapp/values-prod.yaml pins the image tag:

image:
  repository: quay.io/wire/github-app
  tag: "sha-c277d0f"

staging.yml builds and pushes a new sha-<short> tag on merge, but prod keeps running the old image until someone updates this tag. Please bump it in a follow-up PR, or in this one if your release process allows. Otherwise the CVE stays open in prod even after this is merged.

Things to watch

  1. A runtime env var would replace the flag. Any JAVA_TOOL_OPTIONS set in a Helm env: entry (from values*.yaml, or added later for heap or agent settings) replaces this value; it isn't added to it. Nothing sets it today, but a short note in helm/githubapp/DEPLOYMENT.md (or next to env: in values.yaml) would help: anyone who later sets it must keep -XX:-UseBASE64Intrinsics.
  2. The removal condition can't be checked from the Dockerfile. eclipse-temurin:21-jre is a floating tag, so nobody can tell from this file when "Temurin >= 21.0.13.1" is true, and the workaround may stay forever. Options:
    • add a JIRA follow-up for the removal and link it in the comment, or
    • once the fixed image is published, pin to a specific tag (e.g. eclipse-temurin:21.0.13.1_2-jre or a digest) and remove the ENV in the same change. Pinning also makes builds reproducible. Dependabot (already configured in .github/dependabot.yml) can keep a pinned Docker tag up to date if a docker ecosystem entry is added.
  3. Rebuild without cache. Buildx may reuse a cached eclipse-temurin:21-jre layer. That isn't a problem for this workaround, but when the fixed image comes out, make sure the removal PR's build actually pulls the new base image (pull: true / --pull) before you drop the flag.

Performance

Turning off the intrinsic means Base64 runs in the plain Java implementation, which is slower. This app mostly receives GitHub webhooks and calls the Wire SDK, so it doesn't decode much Base64 and the impact should be negligible. On arm64 nodes, or CPUs without AVX-512 VBMI, the flag changes nothing.

Security

  • The flag only affects the runtime image. The gradle:9.0.0-jdk21 build stage is unaffected because nothing in it is exposed at runtime.
  • The JVM prints Picked up JAVA_TOOL_OPTIONS: ... to stderr at startup. That's harmless, but if any log-based alerting matches on stderr output at startup, expect this line.

Tests

There's nothing to unit-test here. A cheap guard against regressions would be a CI step that runs the built image with java -XX:+PrintFlagsFinal -version | grep 'UseBASE64Intrinsics.*false'. That's optional for a temporary workaround.

Summary: the fix is correct and well-scoped. The main action item is bumping the prod image tag so the mitigation actually reaches production. Tracking the removal with a ticket or by pinning the base image is a nice-to-have.

@alexandreferris
alexandreferris merged commit 4d797ef into main Nov 20, 2026
5 checks passed
@alexandreferris
alexandreferris deleted the fix/WPB-30191-disable-base64-intrinsics branch November 20, 2026 16:11
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.

2 participants