Skip to content

Mitigate CVE-2026-114938 ("Java4Shell"): default-on in Docker, opt-in in solr.in.sh - #5364

Open
CloudMarc wants to merge 4 commits into
apache:mainfrom
CloudMarc:java4shell-solr-opts-mitigation
Open

CloudMarc wants to merge 4 commits into
apache:mainfrom
CloudMarc:java4shell-solr-opts-mitigation

Conversation

@CloudMarc

@CloudMarc CloudMarc commented Nov 18, 2026 •

Copy link
Copy Markdown

What

Two changes for CVE-2026-114938 ("Java4Shell"), a critical heap-overflow RCE in the JDK's AVX-512 Base64 decoder intrinsic:

  1. solr.in.sh/solr.in.cmd: documents -XX:-UseBASE64Intrinsics as an opt-in, commented-out SOLR_OPTS setting, mirroring the existing pattern this repo already uses for CVE-2021-44228 (the log4j2.formatMsgNoLookups line a few lines above it).
  2. solr/docker/templates/Dockerfile.body.template: enables the same flag by default (not commented out) in the Docker image's /etc/default/solr.in.sh, since someone who just pulls the published image doesn't necessarily read solr.in.sh first. I confirmed via apache/solr-docker's own README that its Dockerfile is generated from this exact template at release time, and that repo explicitly refuses manual edits — so this is the actual source of truth for the published image's behavior.

Why

Disclosed 2026-11-17. Affects OpenJDK 17.0.6+, 21, 25 and 27 (not 8 or 11) on x86-64 hosts with AVX-512
VBMI (Intel Ice Lake+ Xeon, AMD Zen 4+ EPYC/Ryzen). The disclosing researchers (Calif) demonstrated
post-auth RCE against Apache Solr specifically. Both BasicAuthPlugin and PKIAuthenticationPlugin
call Base64.getDecoder().decode() directly on request-supplied input, which is real exposed surface
regardless of exactly which code path the researchers used.

As of this PR, no JDK vendor has a GA build with the fix for the 17/21/25 lines. I went and checked the
actual OpenJDK source history: the real fix (8393212, a 4-line guard in
StubGenerator::generate_base64_decodeBlock()) already landed in jdk17u-dev/jdk21u-dev/jdk25u-dev
on 2026-11-12, and the GA source tags (jdk-17.0.21.1-ga, jdk-21.0.13.1-ga, jdk-25.0.5.1-ga)
were cut 2026-11-15 — but no vendor (Temurin, Zulu, Oracle's own OSS builds, Debian) has published a GA
binary build yet. Checked the Adoptium API directly: Temurin's current 25.0.5.1 tag is still
EA/beta (25.0.5.1-beta+1-ea), and it's actually built from an earlier pre-fix commit than the one that
matters, despite sharing the version string. So there's no dependency/base-image bump that resolves this
today, and operators need a flag-based mitigation in the meantime.

-XX:-UseBASE64Intrinsics is a generic HotSpot product flag (globals.hpp, checked in the JDK source),
honored identically across x86, aarch64, ppc and riscv builds — so turning it off is a safe no-op on
platforms this CVE doesn't affect, not just an x86-64-specific workaround.

Why default-on for Docker but opt-in for solr.in.sh

The tarball/solr.in.sh audience reads that file to configure their deployment, same as the existing
Log4Shell precedent. The Docker image audience often doesn't touch solr.in.sh at all — they just pull
solr:10.1.0 and run it. Given the severity (critical, post-auth RCE demonstrated against Solr) and that
the flag is a safe no-op where it doesn't apply, defaulting it on in the one artifact the project fully
controls end-to-end seemed like the right asymmetry. Open to the maintainers disagreeing on this point —
flagging it explicitly rather than assuming it's uncontroversial.

How to verify

  • ./gradlew :solr:docker:createDockerfileLocal :solr:docker:createDockerfileOfficialFull :solr:docker:createDockerfileOfficialSlim — all three generated Dockerfiles pick up the new line correctly.
  • Could not do a live docker build/docker run in this environment (no local Docker daemon) — would appreciate a maintainer or CI doing that smoke test before this merges.

Notes for reviewers

  • I couldn't find an existing SOLR JIRA ticket for this CVE (searched project=SOLR AND text~"Java4Shell", no hits), so this PR doesn't carry a SOLR-NNNNN prefix. Happy to file one if
    a committer wants it tracked that way.
  • Opening as a draft for discussion rather than asserting this is the final word on how the
    project wants to handle a JDK-level CVE with no code fix available, especially the default-on-for-Docker
    question above.
  • Changelog fragment included (type: security), following the project's documented
    writeChangelogPr workflow, styled after SOLR-17888's Tika-CVE mitigation entry.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

CVE-2026-114938 is a critical heap-overflow RCE in the JDK's AVX-512
Base64 decoder intrinsic, disclosed 2026-11-17. It affects OpenJDK
17.0.6+, 21, 25 and 27 (not 8 or 11) on x86-64 hosts with AVX-512 VBMI
support. Researchers demonstrated post-auth RCE against Solr; both
BasicAuthPlugin and PKIAuthenticationPlugin decode request-supplied
Base64 input directly.

No JDK vendor (Temurin, Zulu, Oracle's own OSS builds, Debian) has
shipped a GA patched build for the 17/21/25 lines yet, so there is no
dependency bump that fixes this. This documents the universally
recommended interim mitigation, -XX:-UseBASE64Intrinsics, in
solr.in.sh/solr.in.cmd as an opt-in commented-out setting, following
the exact same pattern already used here for CVE-2021-44228
(log4j2.formatMsgNoLookups). The flag is a generic HotSpot product flag
(globals.hpp) honored on every architecture, so enabling it is a no-op
on platforms this CVE doesn't affect.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@nick-boss-tech

Copy link
Copy Markdown
Contributor

On the dev community meeting today it was suggested that an announcement can be made in the "Security News" section of the page and that JDK is not a dependency but a requirement, like having a machine that Solr can run on, and since we can't give security advisories for all the different Operating Systems, it's not viable to do so for JDK either, and therefore an announcement could go in Security News. @epugh was mentioned as the one who should make this change.

CloudMarc and others added 2 commits November 18, 2026 15:07
Unlike bin/solr.in.sh, where the equivalent setting is left as an
opt-in comment, enable -XX:-UseBASE64Intrinsics by default in the
Docker image's /etc/default/solr.in.sh. Users who just pull the
published image don't necessarily read solr.in.sh, and this is a
shipped artifact the project already controls end to end, unlike
third-party JDK builds.

Verified via createDockerfileLocal/createDockerfileOfficialFull/
createDockerfileOfficialSlim that the rendered Dockerfiles pick this
up correctly. Could not do a live `docker build` in this environment
(no local Docker daemon).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the docker Docker image label Nov 18, 2026
@CloudMarc CloudMarc changed the title Document an interim mitigation for CVE-2026-114938 ("Java4Shell") Mitigate CVE-2026-114938 ("Java4Shell"): default-on in Docker, opt-in in solr.in.sh Nov 18, 2026
@rocketeerbkw

Copy link
Copy Markdown

JDK is not a dependency
we can't give security advisories for all the different Operating Systems, it's not viable to do so for JDK either

That's understandable from a Solr application point of view, but you also maintain and distribute a docker image that currently contains a vulnerable version of the JDK. When can we expect an advisory and update for this?

https://hub.docker.com/_/solr

the image is built and maintained in the official Solr repo github.com/apache/solr

@hossman

hossman commented Nov 18, 2026

Copy link
Copy Markdown
Member

That's understandable from a Solr application point of view, but you also maintain and distribute a docker image that currently contains a vulnerable version of the JDK. When can we expect an advisory and update for this?

there is a nuance there that is easily overlooked: the "apache solr project" does not build and publish the docker images that are found at https://hub.docker.com/_/solr (the text you quoted is regrettably misleading.)

The Dockerfile used to build and publish those docker images IS "built and maintained in the official Solr repo github.com/apache/solr" ... but the docker.io "docker-library" project uses a pointer to that Dockerfile -- provided by the apache solr project and other OSS projects like ours -- to build all "official" docker images , and regularly rebuilds them when their base image changes...

Tags in the library file are only built through an update to that library file or as a result of its base image being updated (ie, an image FROM debian:bookworm would be rebuilt when debian:bookworm is built). Only what is in the library file will be rebuilt when a base has updates.

So for example: soon as there is a new official eclipse-temurin:25-jre-noble and eclipse-temurin:17-jre-jammy base images are patched with the jdk fix, the official solr:10 and solr:9 (and any other synonym tags) tagged images will be rebuilt.

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

+1 to the PR and thanks for contributing

I don't think there's any urgency as it's something a user can do from their end with SOLR_OPTS env var or --jvm-opts CLI option. If a user is proactive/alert to Java4Shell like you, they can do this now. I expect Docker Inc & Eclipse Temurin (JDK) to release an update much faster than we can do so. You can also expect an update to our website shortly to advise users on what I said and more.

@dsmiley
dsmiley marked this pull request as ready for review November 19, 2026 02:38
@github-actions

Copy link
Copy Markdown

Automated PR readiness judgements (LLM-generated; may be wrong; not updated on later pushes).

  • ⚠️ Jira issue in title — missing: This is a security mitigation for a critical CVE (CVE-2026-114938) that changes the default behavior of the Docker image and provides a new configuration option in solr.​in.​sh, which is a user-visible change warranting a Jira issue and changelog entry.​
  • ⚠️ Changelog — differs from the entry (suggest type: fixed; PR has type: security): The change mitigates a critical Remote Code Execution vulnerability (CVE-2026-114938) by disabling a vulnerable JDK intrinsic, which is a security fix with user-visible implications (performance impact of disabling intrinsic, security posture).​
  • ⚠️ Reference Guide update — missing (confidence: medium): The PR introduces a new JVM option (`-XX:​-UseBASE64Intrinsics`) as a recommended mitigation in `solr.​in.​sh` and enables it by default in the Docker image.​ This user-facing configuration change and its rationale should be documented in the Reference Guide (e.​g.​, in the Security or Installation sections) to inform operators.​
  • ⚠️ Upgrade notes — missing: The Docker image now enables `-XX:​-UseBASE64Intrinsics` by default, which is a change in default behavior for users upgrading the Docker image.​ While likely a performance-neutral or minor regression, it is a behavioral change that operators should be aware of, especially if they rely on the intrinsic for performance or have specific JVM tuning.​
  • ✅ Tests: not needed

@dsmiley

dsmiley commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

The PR readiness judgements half sucked this time :-( Changelog -- great feedback; JIRA & upgrade notes -- no.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants