byte[] decoded = java.util.Base64.getDecoder().decode(encoded);A Base64 decoder should return bytes or reject the input. In the affected Java runtime, an optimized decoder can write past the end of its output array before an exception reaches the application.
That is the failure behind Java4Shell (CVE-2026-114938), disclosed on 17 November 2026. It can corrupt memory and, on some configurations, allow remote code execution. Both the Java build and the processor matter; CERT-EU lists the affected scope.
Start by finding the JVM your service actually runs. Then check its vendor build, exposed CPU features and Base64 input paths. The commands below collect that evidence and help verify the replacement after a patch.
The boundary Java was supposed to keep#
The JVM normally checks Java array access against the array bounds. For frequently used operations, it can substitute a specialized implementation called an intrinsic. This Base64 intrinsic uses CPU vector instructions to decode several bytes at a time.
The failure is in the handling of a partial block and its padding. A faulty write mask permits a store beyond the allocated output array. An exception afterward cannot undo that store. Cloudflare’s technical explanation describes the incorrect mask and resulting out-of-bounds write.
Cloudflare gives a concrete case: a 50-byte output array receives a 64-byte store starting at offset 48. Only two bytes remain in the array, so 62 bytes land outside it. You can inspect that boundary with arithmetic alone:
public final class BoundaryModel {
public static void main(String[] args) {
long capacity = 50;
long offset = 48;
long storeSize = 64;
boolean fits = offset >= 0 && offset <= capacity
&& storeSize >= 0 && storeSize <= capacity - offset;
System.out.println("Fits inside array: " + fits); // false
System.out.println("Bytes remaining: " + (capacity - offset)); // 2
System.out.println("Bytes beyond boundary: "
+ (storeSize - (capacity - offset))); // 62
}
}Run BoundaryModel.java with java BoundaryModel.java. It calculates the space remaining and the size of the overrun using Cloudflare’s example. The code is an arithmetic model; the runtime fix belongs in the JVM implementation.
By the time a catch block receives the exception, the native write has already happened. Adding exception handling around this call leaves the faulty runtime in place.
Check Point’s analysis explains the extra memory-layout work needed to turn corruption into code execution. Calif, the discovering team, demonstrated pre-authentication RCE against affected configurations of Keycloak, Jenkins, Jira and Confluence. Exposure for a particular installation still depends on its runtime, hardware and reachable decoding paths.
Build, processor and input path#
Start with services that accept untrusted traffic. For each service, record these three answers:
| Check | Evidence to collect | What it tells you |
|---|---|---|
| Runtime | Vendor, full build and the JVM used by the service | Whether that vendor lists the build as affected or fixed |
| Hardware and execution path | CPU features exposed to the guest; relevant JVM options | Whether the vulnerable optimized implementation can be selected |
| Input reachability | Which request or message paths perform Base64 decoding | Whether untrusted input can reach that implementation |
The published affected families include unpatched Java 17 builds from 17.0.6, plus affected 21, 25 and 27 builds. Hardware exposure requires x86-64 with AVX-512 VBMI support. ARM64 is outside this particular flaw’s hardware path. Sophos summarizes these prerequisites.
Java 8 needs a closer look too: Oracle lists the Enterprise Performance Pack build 8u511b33-perf. Match the full distribution and build against its vendor advisory. OpenJDK distributors use their own package versions.
Inspect the process you actually run#
On a host with the JDK tools available, use the service’s Java process ID. Run as the appropriate service user, with permission to attach. In containers, use tools in the same process namespace. jcmd may be absent from a minimal runtime or attach may be disabled.
# Replace 12345 with the service's Java PID.
jcmd 12345 VM.version
jcmd 12345 VM.flagsjcmd reports the JVM attached to that PID. A shell’s java -version can point to a different installation—a useful distinction on hosts with several JDKs. See Oracle’s jcmd reference for attachment requirements.
For an image you are about to deploy, run this program with the Java executable inside that image. It prints four runtime properties and checks a normal Base64 decode. Use the version output to compare against the vendor advisory; the decode result alone cannot determine vulnerability.
import java.nio.charset.StandardCharsets;
import java.util.Base64;
public final class RuntimeCheck {
public static void main(String[] args) {
for (String key : new String[] {
"java.vendor", "java.runtime.version", "java.vm.name", "os.arch"
}) {
System.out.println(key + "=" + System.getProperty(key));
}
String text = new String(
Base64.getDecoder().decode("c3RhdHVzPXJlYWR5"),
StandardCharsets.UTF_8
);
if (!"status=ready".equals(text)) {
throw new IllegalStateException("Unexpected decoding result");
}
System.out.println("Valid-input smoke check: PASS");
}
}Download RuntimeCheck.java and run java RuntimeCheck.java with the intended JDK. This launches a new JVM. To inspect a service that is already running, use the PID-based commands above.
Check CPU features where the service runs#
On Linux, the following read-only check lists the four CPU flags identified in Calif’s advisory:
grep -m1 '^flags' /proc/cpuinfo \
| tr ' ' '\n' \
| grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'If all four flags appear, the hardware prerequisites are present; check the JVM build and options next. An unreadable /proc/cpuinfo leaves this check unresolved. Use the platform’s CPU inspection tools on other operating systems, and repeat the check after moving a workload to another host.
Patch the runtime, then prove the service loaded it#
The Canadian Cyber Centre’s fixed-version table lists these Oracle Java SE releases:
| Oracle Java SE line | Fixed release listed on 17 November |
|---|---|
| 8 Enterprise Performance Pack | 8u513-perf |
| 17 | 17.0.21.1 |
| 21 | 21.0.13.1 |
| 25 | 25.0.5.1 |
| 27 | 27.0.1.1 |
Use your distributor’s advisory for its supported fixed build. For vendor-packaged software, check whether the product ships its own runtime and follow its supported update procedure.
For containers, replace the affected runtime in the image, rebuild it, and roll out that image. A restart of the same old image still gives you the old runtime. For host installations, a package update can leave an existing Java process running until the service is restarted.
After rollout, use the new PID to collect the full runtime build and compare it with the vendor advisory. Then exercise normal authentication and API paths in your test environment. Record both the build and the smoke-check result.
What if an immediate patch is not possible?
Calif describes -XX:-UseBASE64Intrinsics as a temporary way to disable the affected optimization. Sophos explicitly says it has not validated that option. The Canadian alert also suggests considering -XX:UseAVX=2; Calif warns that this option can prevent startup on ARM.
Check vendor guidance and test startup and normal workloads before using either option. Applying a JVM flag requires a process restart. Keep hardware-specific settings separate in a mixed fleet, and schedule the vendor-fixed runtime as the permanent update.
What should be in the completion record?#
Attach the following to the change ticket so the next operator can check which instances were replaced:
Service / environment:
Runtime vendor and full build BEFORE:
Vendor advisory and fixed build:
Replacement package version or immutable image digest:
Rollout / restart time:
Runtime vendor and full build from the NEW PROCESS:
Normal application smoke-check result:
Remaining instances or exceptions:Mark inaccessible services and unknown builds unverified. If there are signs of compromise, track the incident investigation separately from this patch record.
Keep the running JVM build alongside the application version in your release record. Maven’s dependency list may never show the component that needed this patch.