Skip to content
Java4Shell — CVE-2026–114938 Understandings | by Jaseer VK

Java4Shell — CVE-2026–114938 Understandings | by Jaseer VK

Medium • November 24, 2026

An easy-to-understand explanation of how a tiny counting mistake inside Java’s Base64 decoder can lead to memory corruption, and how an attacker may turn it into Remote Code Execution.

Imagine a shelf with exactly 50 slots reserved for you. Your neighbour’s shelf stands right to it.

Now imagine a helper is told to put away “-1 items”. A sensible helper would do nothing. But what if the helper reads “-1” as “put away everything” and starts filling 64 slots?

Your 50 slots overflow, and the extra items land on your neighbour’s shelf.

That is the basic idea behind Java4Shell (CVE-2026–114938) , a heap out-of-bounds write inside the Java runtime itself.

Java4Shell: HotSpot Base64 Heap Out-of-Bounds Write (CVE-2026–114938)

Java4Shell: HotSpot Base64 Heap Out-of-Bounds Write (CVE-2026–114938)

The bug was reported by Calif and disclosed on 17 November 2026 , the same day OpenJDK published its advisory and Oracle shipped patches. Oracle rates it CVSS 3.1: 8.1 (High) , and early reports using CVSS 4.0 give 9.2 .

Let’s understand how this works step by step.

1. First, Understand What Base64 Is

Many systems can only carry plain text, such as emails, JSON and web forms. When an app needs to send a file, an image or a login token through them, it first converts the data into harmless letters and numbers.

That conversion is called Base64 .

The = at the end is padding . It simply fills the last empty space, like bubble wrap in a box.

Java decodes Base64 constantly, for example when it reads a login token, an API payload or an uploaded image. That is why a bug here matters so much.

2. What Is a JIT Intrinsic? (Java’s “Speed Mode”)

Java does not run everything slowly. The Java runtime, HotSpot , starts by interpreting code, then compiles the methods that run often. Its most aggressive compiler is called C2 .

For some library methods, C2 does not compile the Java code at all. It swaps in an intrinsic : a small piece of hand-written machine code that uses special CPU instructions to go faster.

For Base64 decoding on x86–64 CPUs with AVX-512 VBMI , the intrinsic works like this:

A masked store writes data into memory, but only the bytes selected by a mask . Think of the mask as a stencil that says, “write only here”.

If the stencil is wrong, the write goes where it should not.

3. What Is a Heap Out-of-Bounds Write?

A program keeps its objects in an area of memory called the heap . Each buffer gets a fixed amount of space.

An out-of-bounds write happens when the program writes beyond the end of that space.

The overwritten neighbour may be anything the application uses. This is memory corruption .

4. What Is the Bug in CVE-2026–114938?

Now let’s connect the concept to the actual vulnerability.

When the decoder handles the final tail, it calculates how many bytes it should write. The code assumes the tail contains at least one full group of 4 characters before padding is removed.

But what if the tail is just = , == , X= or XY= ?

A negative count is meaningless for a mask. The hardware only looks at the low 8 bits of that number, so -1 turns into 255. A value of 64 or more selects nothing to clear, and the mask ends up with every bit set .

Take 64 A characters followed by one = (65 characters in total):

Step 1: Java allocates a 50-byte output array.

Step 2: The first 64 characters decode into 48 bytes, written at positions 0 to 47.

Step 3: The tail is the single = , so the byte count becomes -1 and the mask becomes all ones.

Step 4: The decoder writes 64 bytes starting at position 48. Positions 48 and 49 are inside the array. The remaining 62 bytes land outside it .

Step 5: The decoder notices the input is invalid and Java throws an IllegalArgumentException .

On older OpenJDK 17 builds, the trigger needs 128 A characters plus = .

Important: The error is thrown after the overwrite. The application sees a normal “invalid input” failure, but the memory has already been damaged.

Important: The error is thrown after the overwrite. The application sees a normal “invalid input” failure, but the memory has already been damaged.

5. How Can This Lead to Remote Code Execution?

This is the most critical part of understanding the vulnerability chain.

The overwrite on its own is small and made of mostly fixed bytes, so it gives an attacker very little control. What the attacker can influence is where it lands .

If the overwrite damages the right neighbouring object, it can be turned into something more powerful:

The published research describes the following sequence:

Step 1: The attacker warms up the decoder. Java only uses the fast intrinsic after C2 compiles it. The attacker sends valid Base64 repeatedly until that happens.

Step 2: The attacker arranges the heap. The exploit sends requests in timed pieces and creates many objects, so the decoder’s output buffer ends up to the object it wants to damage. It checks the response size to see whether the layout worked and retries if not.

Step 3: The malformed tail is sent. The overwrite hits the neighbouring object and corrupts its size field.

Step 4: Memory is leaked. The application now writes or returns more data than it should, so the response carries extra heap memory. This leak is nicknamed JavaBleed and can expose private keys, tokens and personal data.

Step 5: Control is taken. With the ability to read and write heap memory, the attacker may alter application data or reach the JVM’s compiled code, which leads to code execution.

Does One Request Give the Attacker a Shell?

Not necessarily. This is an important distinction.

Get Jaseer VK’s stories in your inbox

Join Medium for free to get updates from this writer.

Remember me for faster sign in

The malformed Base64 is only the trigger. Turning it into RCE needs extra techniques such as heap grooming and memory disclosure, and each application needs its own exploit , built around how that app uses Base64 and what it sends back.

Important: Not every memory corruption bug leads to RCE. Some only crash the application. Successful RCE depends on whether the attacker can reliably convert the corruption into control over execution. At disclosure, no exploitation in the wild had been confirmed.

Important: Not every memory corruption bug leads to RCE. Some only crash the application. Successful RCE depends on whether the attacker can reliably convert the corruption into control over execution. At disclosure, no exploitation in the wild had been confirmed.

A reverse proxy that buffers whole requests (like NGINX by default) can break some timed-request variants. It is not a full defence: the published Elasticsearch exploit fits in a single request, and WebSocket traffic skips the buffering.

A system is exposed only when all three conditions are true:

It runs a vulnerable Java build .

It runs on an x86–64 CPU with AVX-512 VBMI (the flags avx512f , avx512bw , avx512vbmi and bmi2 are present).

The application decodes Base64 sent by an outside user (which most web apps do).

CPUs that have these features include Intel Xeon Ice Lake, Sapphire Rapids, Emerald Rapids and Granite Rapids, and AMD EPYC and Ryzen Zen 4 or newer. ARM64 is not affected.

OpenJDK 17.0.6 and later is affected, along with every distribution built from it: Oracle Java SE, Oracle GraalVM, Amazon Corretto, Eclipse Temurin, Microsoft Build of OpenJDK, Azul Zulu, BellSoft Liberica, SAP SapMachine and Red Hat OpenJDK.

Oracle lists these Java SE versions as vulnerable: 8u511b33-perf , 17.0.21.0.3 , 21.0.13.0.3 , 25.0.5.0.3 and 27.0.1.0.3 . Older OpenJDK 7, 8 and 11 builds are reported as lacking the vulnerable decoder, but always confirm with your vendor.

In Kubernetes, remember that a safe pod becomes exposed when it is scheduled onto a node with an AVX-512 VBMI CPU.

7. What Is the Impact?

Successful exploitation may allow a remote, unauthenticated attacker to:

Crash the Java process and cause a Denial of Service.

Leak sensitive data from the heap, such as private keys, tokens and personal information (JavaBleed).

Execute arbitrary code in specific applications, with the privileges of the Java process.

Researchers tested popular Java products such as Jenkins, Atlassian Jira, Confluence and Keycloak, and confirmed some versions as vulnerable.

Crucially, the application itself does not need to contain a security flaw. The defect exists inside the Java runtime.

8. How Can Organizations Protect Themselves?

The primary and recommended action is to update Java to a patched build.

Affected and Fixed Versions for CVE-2026–114938 from the OpenJDK Advisory

Affected and Fixed Versions for CVE-2026–114938 from the OpenJDK Advisory

Product Affected Versions Fixed Versions OpenJDK 17 17.0.6 and later, before the fix 17.0.21.1 OpenJDK 21 Builds before the fix 21.0.13.1 OpenJDK 25 Builds before the fix 25.0.5.1 OpenJDK 27 Builds before the fix 27.0.1.1 Amazon Corretto Builds based on the affected OpenJDK 17.0.21.1.2 , 21.0.13.1.2 , 25.0.5.1.2 , 27.0.1.1.4 Oracle Java SE 8u511b33-perf , 17.0.21.0.3 , 21.0.13.0.3 , 25.0.5.0.3 , 27.0.1.0.3 See Oracle's November 2026 Critical Security Patch Update

Also remember these two traps:

Containers: a patched host does not patch the Java inside a Docker image. Rebuild images on an updated base image.

Bundled Java: many products ship their own JDK. Updating the system Java will not fix them, so apply the vendor’s patch.

Patch internet-facing systems first.

What Should Defenders Watch For?

A failed attempt can crash the JVM, and the attacker can simply try again. Useful signals to hunt for in a SIEM:

Repeated crashes or restarts of an internet-facing Java service, including new hs_err_pid*.log files.

Bursts of Base64 decoding errors on the same endpoint.

Unusually large responses from endpoints that echo decoded data.

These signals suggest possible exploitation but do not prove it. The relevant MITRE ATT&CK technique is T1190 (Exploit Public-Facing Application) .

CVE-2026–114938 demonstrates how a subtle counting mistake can escalate into a critical security vulnerability.

The defect begins when a fast Base64 routine turns a negative length into a mask that writes 64 bytes where it should write none. The damage happens before Java reports the error, and with the right heap layout it can open the door to data leaks and code execution.

The fundamental takeaway is that even the smallest helper functions deserve security attention. Check your Java versions, patch your runtimes (including containers and bundled JDKs), and use the JVM flags as a temporary shield if you cannot update yet.

References and Further Reading

OpenJDK Vulnerability Advisory, 2026–11–17

Calif: Java4Shell Write-up

Oracle Critical Security Patch Update, November 2026

CISA Alert: Critical Java Vulnerability Requires Immediate Patching

Picus Security: Java4Shell Explained

Help Net Security: Java4Shell OpenJDK Flaw

GitLab: How to Find and Fix Java4Shell

Buy Me a Coffee: buymeacoffee.com/jaseervk

GitHub: github.com/jaseervk

Portfolio:

Blog: blog.jaseervk.com

: .com/in/jaseer-vk-

Medium: