News

Java4Shell: Sonar Recommends a Temporary Workaround for SonarQube

Sonar's advisory says Java4Shell (CVE-2026-114938) may affect the SonarQube Server and Community Build runtime. Here is the temporary workaround.

3 min read

On 17 November 2026, Sonar published a security advisory about Java4Shell (CVE-2026-114938), which affects operators of SonarQube Server and SonarQube Community Build. The update of 20 November also covers the SonarQube MCP Server.

What is Java4Shell, and how does it affect SonarQube?

According to Sonar, the flaw lies in the Java runtime, not in Sonar’s own code. It affects the hardware-accelerated Base64 decoder in OpenJDK 17.0.6 and later versions (including Java 21 and 25). On x86-64 processors that support AVX-512 VBMI, it is reported to allow unauthenticated remote code execution. ARM-based machines are not affected. Sonar is currently not aware of any exploitation or related incident.

What does Sonar recommend?

  • Server and Community Build: the supported Server versions (2026.5, 2026.1 LTA and 2025.4 LTA), the Community Build and older versions may be affected if they run on a vulnerable Java version and vulnerable hardware. The -XX:-UseBASE64Intrinsics flag must be set for the Web, Compute Engine and Search processes, without checking the processor beforehand. Sonar does not expect a noticeable performance impact.
  • Configuration for ZIP installations: in the conf/sonar.properties file, use the sonar.web.javaAdditionalOpts, sonar.ce.javaAdditionalOpts and sonar.search.javaAdditionalOpts properties; SonarQube must be restarted for the change to take effect. A ZIP installation runs on its own Java, so it must also be updated when the JDK vendor releases a fixed build.
  • Configuration in Docker: use the SONAR_WEB_JAVAADDITIONALOPTS, SONAR_CE_JAVAADDITIONALOPTS and SONAR_SEARCH_JAVAADDITIONALOPTS environment variables (with Docker Compose, in the environment section of the service); the container must be recreated.
  • Configuration on Kubernetes and with Helm: the same environment variables go into the env section of the values file (for the sonarqube-dce chart, under applicationNodes and searchNodes). jvmOpts, jvmCeOpts, SONAR_WEB_JAVAOPTS and SONAR_CE_JAVAOPTS cannot be used, because the chart builds these itself.
  • General rules: javaOpts is not suitable, because it overrides SonarQube’s default memory settings. The flag must be appended to existing values, separated by a space, rather than replacing them. Environment variables take precedence over the sonar.properties file. JAVA_TOOL_OPTIONS has no effect on the Server processes, because SonarQube ignores it.
  • Scanners and CI agents: on x86-64 agents that analyze untrusted code, the same flag is recommended, for example through the SONAR_SCANNER_JAVA_OPTS variable. For SonarScanner for .NET, SONAR_SCANNER_OPTS or JAVA_TOOL_OPTIONS can be used, only with Java 17 or later. Setting JAVA_TOOL_OPTIONS at the agent level covers every JVM on the agent (including the build tool), but only on agents running Java 17 or later: Java 8 does not recognize the option and will not start with it. This setting does not replace the Server configuration.
  • MCP Server (20 November 2026): if you have enabled the MCP Server, JAVA_TOOL_OPTIONS=-XX:-UseBASE64Intrinsics must be set separately in its standalone container (with Helm, in the mcp.env section of the values file), and the container must then be redeployed. The Server’s JVM settings are not applied automatically in the MCP container. If JAVA_TOOL_OPTIONS already contains options, the flag must be appended.

Verification and next steps

On Linux, you can check for the flag on the machine or inside the container with the command grep -la -- '-XX:-UseBASE64Intrinsics' /proc/[0-9]*/cmdline: it must appear for all three processes (Web, Compute Engine, Search). On any platform, you can also look at the Launch process[WEB_SERVER] and Launch process[COMPUTE_ENGINE] lines in logs/sonar.log or in the container log; the flag must appear in both JVM commands.

Sonar is monitoring Java vendor updates and will publish the confirmed fixed versions, the rebuilt Docker images and the upgrade guidance later. The flag can stay in place after the fix, but it can also be removed.

Action required: on affected installations, set the flag (for Data Center Edition, the Web and Compute Engine settings on the application nodes and the Search setting on the search nodes), verify it on the running processes, and follow Sonar’s advisory for the fixed versions.

Sources

Original announcement

Stevan Vanderwerf profile picture

Stevan Vanderwerf, SonarSourcer (Sonar)

Originally published on the Sonar Community forum on 18 November 2026: Security Advisory: Java4Shell workaround for SonarQube

About the editor

Dr. Kabai Márton Tamás

Dr. Kabai Márton Tamás, Owner and Managing Director, Szitár-Net Kft.

Source: Sonar Community

Back to all news

Edited by

Dr. Márton Tamás Kabai

Managing Director, Szitár-Net Kft.

Managing Director of Szitár-Net Kft. The company has worked with automated source code analysis for more than 10 years and, as the official SonarSource partner in Hungary, helps banks, public institutions and large enterprises adopt SonarQube. His talks cover code quality, cybersecurity compliance and secure AI-assisted development.

More articles LinkedIn Work with us

More news

SonarSource Partner