Skip to content
Memory corruption Write-up Advanced

CVE-2026-114938 (Java4Shell): Heap overflow in OpenJDK’s Base64 decoder

A hand-written assembly routine in HotSpot's Base64 decoder miscalculates a store mask for padded input, writing past the end of a heap buffer. An attacker who can feed malformed Base64 to the decoder could crash the JVM and, with application-specific heap manipulation, potentially achieve code execution.

Alina Podoba Follow

Published on mend.io

On November 17, 2026, OpenJDK and Oracle released fixes for CVE-2026-114938, a memory corruption flaw in the HotSpot JVM that its reporters named Java4Shell. The bug sits in the hand-written x86-64 routine the JVM uses to speed up Base64 decoding, and it affects Java 17 (from 17.0.6), 21, 25, and 27.

Alina Podoba, on mend.io

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The assembly stub miscalculates the store mask for the padded tail of the input, so its masked store writes past the end of the destination array.

Impact

The out-of-bounds write usually crashes the JVM, giving unauthenticated denial of service, and with application-specific heap manipulation the reporters claim it can lead to pre-authentication or post-authentication remote code execution in several products; no exploitation in the wild has been confirmed.

What the attacker needed

Affected Java build; CPU with AVX-512 VBMI; attacker-controlled Base64 input; decoding method made hot first

The fix

It was fixed in vendor builds; where patching is not yet possible, the vulnerable optimisation can be disabled with a JVM flag.

How it was found

  1. Send enough valid Base64 to the JVM so the decoding method becomes hot and C2 compiles it with the intrinsic.
  2. Send a malformed Base64 string whose final group carries padding, causing the out-of-bounds write before the input is rejected.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Java has a fast, hand-written routine for decoding Base64 (a way of turning binary data into plain text characters). When the input ends with padding characters, that routine writes a few bytes too far into memory, corrupting data next to it. At minimum this crashes the program; in some setups it could let an attacker run their own code.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.