Back to writing
Original post by Gagan Deep Singh, canonical on thegdsks.comAlso on Dev.toDiscuss on Dev.to

How One Base64 Bug Can Leak Your Java Heap (Java4Shell, CVE-2026-114938)

CVE-2026-114938 explained: how an AVX-512 intrinsic in HotSpot's Base64 decoder overflows 62 bytes, what has a reproduction versus a claim about RCE, and how to detect it.

7 min read

How One Base64 Bug Can Leak Your Java Heap (Java4Shell, CVE-2026-114938)#

Most Java4Shell (CVE-2026-114938) coverage on day one was either "your servers are on fire" or "it only crashes the JVM." Both skip the mechanism, and the mechanism tells you who is at risk. This post walks through why the bug exists, what the sources actually established, and what a defender can watch for.

I have not reproduced the bug. Everything below comes from public write-ups by Upwind, Endor Labs, Equixly, Qualys and Calif, and I flag where they disagree.

TL;DR#

Claim Status
Heap write past the output array on x86-64 with AVX-512 VBMI Reproduced by Endor Labs (under an emulator) and Upwind (on real hardware)
JVM crash from a remote request Consistent across sources
Pre-auth RCE in named products Claimed by Calif, no public proof-of-concept
Attacker-controlled write contents Not supported, the written bytes are constant
Exploited in the wild None reported, not in CISA KEV as of November 17

Why an intrinsic exists at all#

HotSpot ships a pure-Java Base64 decoder. When the JIT sees that decoder running hot, it can replace the Java loop with an intrinsic, a hand-written assembly stub for the target CPU. On x86-64 with AVX-512 VBMI, the stub decodes wide blocks at once.

Equixly makes two points that matter for exposure. The intrinsic replaces the Java code only after the JIT compiles the decoder, which on a busy server happens within seconds. And the vector path only engages above a length threshold. Endor Labs gives the threshold as 31 bytes on Java 21, 25 and 27, and 128 bytes on Java 17.

That is why the shortest triggers differ by version. 65 characters is enough on 21, 25 and 27. 17 needs 129.

The tail bug#

The block loop handles most of the input. The last characters, including padding, go through a tail routine. Per Upwind, a malformed string ending in a stray = makes the tail calculate a negative output length. A small write becomes a full 64-byte write, 62 bytes beyond the end of the output array. Endor Labs measured 62 bytes for a single = tail and 63 for ==.

Two properties follow from the measurements.

First, the overflow content is fixed. Endor Labs says the bytes stay the same regardless of the input data. An attacker controls the length of the input and the heap layout around the destination array, not the bytes that get written.

Second, Java still rejects the input afterwards with an IllegalArgumentException. The exception is a useful tell, as the detection section below shows, but it fires after the damage.

Upwind also ran 300,000 well-formed inputs and saw no overflow, so ordinary traffic is not at risk. The trigger is a malformed string.

What the fix looks like#

Endor Labs reports the fix as JDK-8393212, "Base64 optimization improvements," a four-line change that adds a guard before the size computation and routes short padded tails to the scalar path. Engineers committed it under embargo on October 14, 2026. Endor Labs also notes that on November 17 the public jdk17u, jdk21u and jdk25u repositories did not yet carry the fix, while Oracle's builds had shipped.

The vulnerable code arrived in 17.0.6 in January 2023 through a backport from JDK 18, and Equixly flags the 17.0.6 starting point as its own inference from backport history.

From crash to code execution#

The crash path is simple. If the 62 stray bytes land on a live object, they overwrite its header, and the usual result is a SIGSEGV inside garbage collection, per Endor Labs. Equixly warns the crash log will not mention Base64, because the garbage collector reads the damaged object later.

Calif claims much more, in five stages.

Stage Claimed step
1 Corrupt an array length
2 Corrupt a second array to leak heap contents, which Calif calls JavaBleed
3 Repair object headers so the JVM keeps running
4 Groom the heap remotely so the overflow lands on a chosen object
5 Write into the JVM code cache

Endor Labs marks every one of these as Calif's claim. Calif says there is no universal exploit, and that each target needs its own decoder route, writable buffer, readable feedback channel and heap layout. The sources I read do not discuss address space randomization at all, so I will not call it a barrier or a bypass.

This is why your exposure depends on the application and not just the JVM. A service that decodes attacker data with Base64.getDecoder() on a hot path, and reflects some of the result, has the shape Calif describes. A service that never decodes attacker input is a crash risk at worst. Whether HTTP Basic or JWT parsing in a given product qualifies is an open question in the sources, so I treat it as unknown.

What does not reach the bug#

Per the write-ups, these cases never reach the bug.

  • The MIME decoder takes the scalar path.
  • Third-party Base64 libraries that do not call java.util.Base64 do not reach the intrinsic.
  • ARM64 hosts, including Graviton, Ampere and Apple silicon, have no such stub. Equixly ran 794 crafted inputs on Temurin 17.0.21 for arm64 and saw no stray writes.
  • x86-64 without AVX-512 VBMI, such as Skylake-SP, Cascade Lake and AMD before Zen 4.

One discrepancy to know about: Equixly requires AVX-512 BW as well as VBMI, while Cyber Security News names only VBMI. Qualys lists four CPU flags (avx512f, avx512bw, avx512vbmi, bmi2) and says all four must appear.

Detection engineering#

You cannot detect this with a dependency scan, since the flaw is in the runtime. You detect it at the edge, in the logs and on the host.

Edge rules#

The malformed shape is checkable without decoding. Padded Base64 has a length divisible by 4, so a token ending in = or == with a length that is not a multiple of 4 fails on sight. Upwind's heuristic adds a size floor of 32 characters. Endor Labs suggests 65 as the lower bound when you run mixed Java versions. Equixly offers this rule for the Authorization header.

text
^Basic\s+(?:\S{4})*\S{0,2}=$

I have not tested it. Run it in log-only mode against production traffic first, because a wrong rule that blocks real logins is its own outage.

Application logs#

Every trigger throws after the write. A burst of IllegalArgumentException from java.util.Base64 in a request handler, clustered by source address, is the signal Endor Labs recommends. Paced or fragmented Base64 traffic at a high rate from one source fits the same pattern, since heap grooming needs repeated attempts.

Host signals#

  • New hs_err_pid*.log files with a SIGSEGV in a GC copy routine and a compiled Base64$Decoder.decode0 frame
  • Repeated JVM restarts of one service
  • Java processes that spawn a shell or open new outbound connections
  • Oversized or binary-looking responses from endpoints that echo decoded input, which would match the leak stage Calif describes
bash
# Recent JVM crash logs and their crash lines
find / -name 'hs_err_pid*.log' -mtime -2 2>/dev/null | while read -r f; do
  echo "$f"; grep -m1 -E '^# (SIGSEGV|Problematic frame)' "$f"
done

A crash log alone is not evidence of an attack. JVMs crash for plenty of other reasons. A cluster of crashes that line up with decode-heavy requests from one source is.

Where the sources disagree#

I kept a list while reading, and you should keep your own.

  • Oracle's status. Equixly wrote that the fix was still pending. Qualys, Upwind and Cyber Security News say Oracle shipped fixed builds on November 17.
  • Severity. Qualys attributes the 9.2 (CVSS 4.0) to the researchers, Equixly to South Korea's NCSC, and nobody has published a vector string. Cyber Security News calls the 8.1 (CVSS 3.1) the OpenJDK advisory score, and Equixly says Oracle has not said which of its November flaws carries that score.
  • Java 8. Qualys and Cyber Security News list Oracle's 8u511b33-perf Performance Pack as affected. The same sources call standard Java 8 not affected.
  • The CVE mapping. Endor Labs marks the mapping from this bug to CVE-2026-114938 as not confirmed, because it could not retrieve the OpenJDK advisory. Check the CVE record yourself before you cite it in a ticket.

The bottom line#

The mechanism is narrow: one assembly tail, one hardware feature, one malformed input shape. The reach is wide, because it sits in the runtime that bundled products carry. The honest status on November 17 is a proven crash, a claimed code execution chain and a patch that exists.

If you only do one thing, put a malformed-padding check in front of your Base64 decoding paths and an alert on the exception, then patch on your normal fast track. If a public exploit lands next week, you will already be watching the right signal.

What would you want your WAF to tell you about a bug class it cannot see inside the runtime?


GDS K S · thegdsks.com · building Glincker · follow on X @thegdsks

A bug in the runtime is a bug in everything that runs on it.

Sources: Upwind, Endor Labs, Equixly, Qualys, Cyber Security News, Calif.

This article is published here first and cross-posted to Dev.to. This page is the canonical version.
Contact