Posts

Addressing Java4Shell in Liberica JDK

Updated

Pasha Finkelshteyn

7

Addressing Java4Shell in Liberica JDK

TLDR

  • Oligo's Java4Shell disclosure describes a memory corruption vulnerability in Java's built-in Base64 decoder, tracked as CVE-2026-114938.
  • Exposure depends on the JDK build, an x86-64 host with AVX-512, and whether untrusted Base64 data reaches the affected JVM code. The reported decoder path does not run in 32-bit JVM builds.
  • Follow BellSoft's updates to find a Liberica JDK build containing the correction, then update and restart affected JVMs. For deployments that cannot update immediately, HotSpot's Base64 intrinsic can be disabled temporarily.

What happened

Oligo has disclosed Java4Shell, CVE-2026-114938, as a flaw in the JDK's Base64 decoder. An application can encounter the vulnerable path while decoding data it did not create itself: for example, a token, message, or document field received from another system. The question for operators is whether that input reaches an affected JDK on a processor that uses the relevant optimized decoder.

On some x86 systems, HotSpot uses a CPU-specific intrinsic for part of Base64 decoding. A malformed input can cause that optimized path to write beyond its intended destination. Java may ultimately reject the input as invalid, but that exception comes too late to undo a native memory write. A JVM crash is one possible consequence of memory corruption.

The vulnerability sits in the runtime, so updating an application dependency cannot by itself correct the affected JDK.

Which deployments need attention?

Three conditions matter together:

  1. The application runs a JDK build containing the affected decoder implementation.
  2. The x86-64 host and JVM enable the AVX-512 decoding path.
  3. An attacker can cause malformed Base64 data to reach a decoding operation in that JVM.

The processor condition also applies in containers: the JDK runs inside the container, but HotSpot selects CPU instructions according to the host it runs on. Inventory the actual JDK binaries and hosts used in production, including container images. The JDK version alone is not enough to classify a deployment, and a CPU model alone does not tell you whether an application accepts untrusted encoded input.

Applications that decode only trusted, internally generated data have a different exposure profile from services that decode client-controlled fields. Input validation can reduce the paths by which malformed data reaches the decoder, but do not assume that a later IllegalArgumentException proves the native path was safe.

BellSoft products to check

Oligo's technical analysis identifies the x86-64 AVX-512 Base64 path. Check these BellSoft products where they run an affected build on an AVX-512 host:

32-bit Liberica JDK builds do not execute this x86-64 AVX-512 path. The product name alone cannot establish exposure: verify the deployed build, architecture, CPU features, and whether untrusted input reaches Base64 decoding.

OpenJDK and Liberica JDK updates

Liberica JDK is BellSoft's OpenJDK distribution. We closely follow security disclosures and fixes in OpenJDK and the wider open-source community, and check how they apply to Liberica JDK. For Java4Shell, follow BellSoft's updates on the Base64 decoder correction.

Run java -version using the Java executable for each service, including the copy inside its container. Compare the complete build identifier with BellSoft's release notes. A major version cannot establish whether the fix is present. Update the JDK, rebuild images that bundle it, and restart the service; a running JVM keeps using code loaded at startup.

Temporary HotSpot mitigation

If an affected HotSpot deployment cannot move to a fixed build immediately, disable the Base64 intrinsic at startup:

-XX:-UseBASE64Intrinsics

In OpenJDK's x86 stub generator, UseBASE64Intrinsics controls registration of the Base64 decode stub. Disabling it leaves the Java Base64 API available. Decoding may be slower.

On x86-64 servers, another temporary option is to limit HotSpot to AVX2:

-XX:UseAVX=2

This turns off AVX-512 for the entire JVM, so it can affect other optimized code as well as Base64 decoding. Use it only in x86-64 startup configurations. An ARM64 JVM does not recognize UseAVX and will fail to start if the option is passed to it.

Check that the exact JDK build you deploy starts successfully with the chosen option, then restart every affected JVM and verify its startup configuration; a running process keeps its original options.

These workarounds address the affected HotSpot path and do not cover separate native decoders used by an application or its dependencies. Measure any performance change on your own workload, then remove the temporary setting after updating to a fixed JDK and verifying the deployed build.

Subcribe to our newsletter

figure

Read the industry news, receive solutions to your problems, and find the ways to save money.

Further reading