Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions changelog/unreleased/PR#5364-java4shell-solr-opts-mitigation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc
title: >
Mitigate CVE-2026-114938 ("Java4Shell"), a JDK-level Base64 decoder RCE, until JDK vendors ship a
patched build: -XX:-UseBASE64Intrinsics is now enabled by default in the Docker image, and
documented as an opt-in commented-out setting in solr.in.sh/solr.in.cmd for other distributions
type: security # added, changed, fixed, deprecated, removed, dependency_update, security, other
authors:
- name: Marc Byrd
links:
- name: PR#5364
url: https://github.com/apache/solr/pull/5364
9 changes: 9 additions & 0 deletions solr/bin/solr.in.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,15 @@ REM Some previous versions of Solr use an outdated log4j dependency. If you are
REM then enable the following setting to address CVE-2021-44228
REM set SOLR_OPTS=%SOLR_OPTS% -Dlog4j2.formatMsgNoLookups=true

REM CVE-2026-114938 ("Java4Shell") is a heap-overflow RCE in the JDK's AVX-512 Base64 decoder
REM intrinsic. It affects OpenJDK 17.0.6+, 21, 25 and 27 (not 8 or 11) running on x86-64 hosts with
REM AVX-512 VBMI support; Solr's BasicAuthPlugin and PKIAuthenticationPlugin both decode
REM request-supplied Base64 input. If your JDK vendor has not yet shipped a build with the fix
REM (17.0.21.1, 21.0.13.1, 25.0.5.1, 27.0.1.1 or later), enable the following setting as an interim
REM mitigation. It disables the intrinsic in favor of the plain decoder and is safe on any platform,
REM including ones unaffected by this CVE.
REM set SOLR_OPTS=%SOLR_OPTS% -XX:-UseBASE64Intrinsics

REM The bundled plugins in the "modules" folder can easily be enabled as a comma-separated list in SOLR_MODULES variable
REM set SOLR_MODULES=extraction,ltr

Expand Down
9 changes: 9 additions & 0 deletions solr/bin/solr.in.sh
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,15 @@
# then enable the following setting to address CVE-2021-44228
#SOLR_OPTS="$SOLR_OPTS -Dlog4j2.formatMsgNoLookups=true"

# CVE-2026-114938 ("Java4Shell") is a heap-overflow RCE in the JDK's AVX-512 Base64 decoder
# intrinsic. It affects OpenJDK 17.0.6+, 21, 25 and 27 (not 8 or 11) running on x86-64 hosts with
# AVX-512 VBMI support; Solr's BasicAuthPlugin and PKIAuthenticationPlugin both decode
# request-supplied Base64 input. If your JDK vendor has not yet shipped a build with the fix
# (17.0.21.1, 21.0.13.1, 25.0.5.1, 27.0.1.1 or later), enable the following setting as an interim
# mitigation. It disables the intrinsic in favor of the plain decoder and is safe on any platform,
# including ones unaffected by this CVE.
#SOLR_OPTS="$SOLR_OPTS -XX:-UseBASE64Intrinsics"

# The bundled plugins in the "modules" folder can easily be enabled as a comma-separated list in SOLR_MODULES variable
#SOLR_MODULES=extraction,ltr

Expand Down
7 changes: 7 additions & 0 deletions solr/docker/templates/Dockerfile.body.template
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ RUN set -ex; \
mkdir -p -m0770 /var/solr; \
chown -R "$SOLR_USER:0" /var/solr;

# Interim mitigation for CVE-2026-114938 ("Java4Shell"), a heap-overflow RCE in the JDK's AVX-512
# Base64 decoder intrinsic (OpenJDK 17.0.6+/21/25/27 on x86-64 hosts with AVX-512 VBMI). Enabled by
# default in this image, unlike the commented-out example in solr.in.sh, since users who just pull
# the published image don't necessarily read that file. Remove once the image is rebuilt on a JDK
# carrying the fix (17.0.21.1/21.0.13.1/25.0.5.1/27.0.1.1+), or override SOLR_OPTS to drop it.
RUN echo 'SOLR_OPTS="$SOLR_OPTS -XX:-UseBASE64Intrinsics"' >> /etc/default/solr.in.sh;

RUN set -ex; \
apt-get update; \
apt-get -y --no-install-recommends install curl acl procps wget netcat-openbsd tini jattach; \
Expand Down
Loading