Security Advisory: Java4Shell workaround for SonarQube

Hi all,

Following the disclosure of Java4Shell (CVE-2026-114938), we’re sharing security guidance for SonarQube Server and SonarQube Community Build users.

This is a vulnerability in the Java runtime, not in Sonar’s own code. It affects the hardware-accelerated Base64 decoder in OpenJDK 17.0.6 and later, including Java 21 and 25. On affected x86-64 processors with AVX-512 VBMI support, it is reported to allow remote code execution without authentication. ARM-based hosts are not affected. We have no evidence of exploitation or related issues at this time.

What you need to do

SonarQube Server and SonarQube Community Build

Apply the temporary Java workaround below to your deployment. This is a proactive measure to protect your workflows. Supported Server versions 2026.5, 2026.1 LTA, and 2025.4 LTA, Community Build, and older versions may be affected when running on vulnerable Java and hardware.

The workaround adds -XX:-UseBASE64Intrinsics to the Web, Compute Engine, and Search processes, disabling the affected Base64 acceleration. We recommend applying it without waiting to check your host CPU. We expect no noticeable performance impact on SonarQube.

Follow the instructions for your installation type. If you already set any of the options below, append the flag to the existing value, separated by a space. Do not replace your existing options.

ZIP installations (Linux, Windows, macOS)

In conf/sonar.properties, add:

sonar.web.javaAdditionalOpts=-XX:-UseBASE64Intrinsics
sonar.ce.javaAdditionalOpts=-XX:-UseBASE64Intrinsics
sonar.search.javaAdditionalOpts=-XX:-UseBASE64Intrinsics

Restart SonarQube for the change to take effect. ZIP installations run on your own Java, so also update it when your JDK vendor ships a fixed build.

  • Use javaAdditionalOpts, not javaOpts, which replaces SonarQube’s default memory settings.

  • Environment variables take precedence over sonar.properties. If you already set SONAR_WEB_JAVAADDITIONALOPTS, SONAR_CE_JAVAADDITIONALOPTS or SONAR_SEARCH_JAVAADDITIONALOPTS, append the flag there instead.

  • Setting JAVA_TOOL_OPTIONS does not apply this workaround to the Server processes because SonarQube ignores it.

  • For Data Center Edition, apply the Web and Compute Engine settings on application nodes and the Search setting on search nodes.

Docker deployments

Add these environment variables to your SonarQube container configuration:

SONAR_WEB_JAVAADDITIONALOPTS="-XX:-UseBASE64Intrinsics"
SONAR_CE_JAVAADDITIONALOPTS="-XX:-UseBASE64Intrinsics"
SONAR_SEARCH_JAVAADDITIONALOPTS="-XX:-UseBASE64Intrinsics"

For Docker Compose, add them under your service’s environment settings:

services:
  sonarqube:
    environment:
      SONAR_WEB_JAVAADDITIONALOPTS: "-XX:-UseBASE64Intrinsics"
      SONAR_CE_JAVAADDITIONALOPTS: "-XX:-UseBASE64Intrinsics"
      SONAR_SEARCH_JAVAADDITIONALOPTS: "-XX:-UseBASE64Intrinsics"

Merge these settings into your existing configuration, preserving other settings and any existing JVM options. Recreate the container to apply the changes. For Docker Compose, run docker compose up -d.

For Data Center Edition, set the Web and Compute Engine variables on datacenter-app containers and the Search variable on datacenter-search containers.

Kubernetes and Helm deployments

For the sonarqube chart, add the following to your existing values file:

env:
  - name: SONAR_WEB_JAVAADDITIONALOPTS
    value: "-XX:-UseBASE64Intrinsics"
  - name: SONAR_CE_JAVAADDITIONALOPTS
    value: "-XX:-UseBASE64Intrinsics"
  - name: SONAR_SEARCH_JAVAADDITIONALOPTS
    value: "-XX:-UseBASE64Intrinsics"

For the sonarqube-dce chart (Data Center Edition), use:

applicationNodes:
  env:
    - name: SONAR_WEB_JAVAADDITIONALOPTS
      value: "-XX:-UseBASE64Intrinsics"
    - name: SONAR_CE_JAVAADDITIONALOPTS
      value: "-XX:-UseBASE64Intrinsics"
searchNodes:
  env:
    - name: SONAR_SEARCH_JAVAADDITIONALOPTS
      value: "-XX:-UseBASE64Intrinsics"

Merge these entries with your existing environment settings and append the flag to any existing values for these variables.

Apply the change using your current chart version:

helm upgrade <release> sonarqube/<chart> --version <your-current-chart-version> -f values.yaml

Replace <release>, <chart>, and <your-current-chart-version> with your deployment’s values. The changed pod specification restarts the pods.

Do not use jvmOpts, jvmCeOpts, SONAR_WEB_JAVAOPTS or SONAR_CE_JAVAOPTS for this workaround; the chart builds those values itself.

Scanners and CI agents

For scanners running on affected x86-64 CI agents that analyze untrusted code, we recommend the same Java flag. Set the following in your CI agent or job environment before running analysis:

export SONAR_SCANNER_JAVA_OPTS="-XX:-UseBASE64Intrinsics"

If SONAR_SCANNER_JAVA_OPTS already has a value, append the flag rather than replacing existing options. The command above uses shell syntax. Configure the equivalent environment variable for your CI system or operating system.

To cover every JVM on a CI agent, including the build tool, you can also set JAVA_TOOL_OPTIONS=-XX:-UseBASE64Intrinsics on the agent, preserving any existing options. Apply it only to agents that run Java 17 or later. Java 8 does not recognize the option and will not start with it. This agent-level setting does not replace the SonarQube Server configuration described above.

Verify the workaround

On Linux, run the following on the host or inside the container:

grep -la -- '-XX:-UseBASE64Intrinsics' /proc/[0-9]*/cmdline

Check that the flag is present for all three SonarQube processes: Web, Compute Engine and Search. For Data Center Edition, check Web and Compute Engine on application nodes and Search on search nodes.

On any platform, you can also check the Launch process[WEB_SERVER] and Launch process[COMPUTE_ENGINE] lines in logs/sonar.log or the container log. Confirm that the flag appears in both JVM commands.

What’s next

We are monitoring Java vendor updates and preparing the relevant SonarQube updates. We will post to this advisory with confirmed patch versions, rebuilt Docker images and upgrade guidance as they become available.

The workaround can remain in place after patching or be removed.

For help, contact Sonar Support or ask in this thread.

1 Like