diff --git a/changelog/unreleased/PR#5364-java4shell-solr-opts-mitigation.yml b/changelog/unreleased/PR#5364-java4shell-solr-opts-mitigation.yml new file mode 100644 index 00000000000..40813dff566 --- /dev/null +++ b/changelog/unreleased/PR#5364-java4shell-solr-opts-mitigation.yml @@ -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 diff --git a/solr/bin/solr.in.cmd b/solr/bin/solr.in.cmd index cc488390828..b1467f18d16 100755 --- a/solr/bin/solr.in.cmd +++ b/solr/bin/solr.in.cmd @@ -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 diff --git a/solr/bin/solr.in.sh b/solr/bin/solr.in.sh index 569066fede4..9e00aebfb5c 100644 --- a/solr/bin/solr.in.sh +++ b/solr/bin/solr.in.sh @@ -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 diff --git a/solr/docker/templates/Dockerfile.body.template b/solr/docker/templates/Dockerfile.body.template index 6d3de192e5d..ccdfabc1eab 100644 --- a/solr/docker/templates/Dockerfile.body.template +++ b/solr/docker/templates/Dockerfile.body.template @@ -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; \