↓ Skip to main content
Security

Java4Shell (CVE-2026-114938), explained simply

Imagine a very fast mail-sorting machine. Hand it one oddly folded envelope and, before it notices something is wrong and stops, it has already pushed letters into the next few pigeonholes. That’s Java4Shell: a tiny piece of text that makes Java’s fastest Base64 decoder write where it shouldn’t.
A request carries Base64 text from a login header, a cookie or an upload. Java’s fast decoder path on an AVX-512 CPU gets 64 letters A and one equals sign, writes 64 bytes into a 50-byte space and spills 62 bytes into its neighbours before it raises an error. Three conditions must all hold: Java 17.0.6 or newer, an x86-64 CPU with AVX-512 VBMI, and a hot decoder. The fix: update the JDK, or disable the fast path with -XX:-UseBASE64Intrinsics.
How a short Base64 string corrupts memory, and the three conditions for it
New to Base64, a JIT or a buffer overflow? Each term is explained in plain words in Keywords at the end.

The short version
#

NameJava4Shell, CVE-2026-114938
Disclosed17 November 2026, with patches the same day
WhatMemory corruption in the JDK’s hardware-accelerated Base64 decoder (HotSpot, x86-64)
Worst caseRemote code execution with no login
Severity8.1 High from Oracle; 9.8 Critical from Red Hat
FixUpdate the JDK (17.0.21.1, 21.0.13.1, 25.0.5.1, 27.0.1.1 or your vendor’s equivalent)
StopgapStart Java with -XX:-UseBASE64Intrinsics

First, what is Base64?
#

Base64 is a way to write any data, even a picture or a key, using only 64 safe characters: A–Z, a–z, 0–9, + and /. The text is padded with = at the end when the data doesn’t fill the last block. You see it everywhere without noticing:

  • the Authorization: Basic ... header that carries a username and password;
  • login tokens (JWTs) and “remember me” cookies;
  • files and images sent inside JSON;
  • keys and certificates (-----BEGIN CERTIFICATE----- is Base64 inside).

Because so much arrives as Base64, servers decode it early, often before they know who you are. That detail is what makes this bug serious.

What went wrong
#

Java has an ordinary Base64 decoder written in Java. For speed, the HotSpot JVM also has a hand-written assembly version that it swaps in once a method gets busy. On modern x86-64 processors with the AVX-512 VBMI instructions, that version decodes 64 characters at a time.

According to the researchers at Calif, the trouble is in the bit that handles the last few characters. When the tail of the input is only padding (=), the length it calculates for the output drops below zero. A negative length then turns into “write everything”: a full 64-byte write into a space meant for far less.

With their trigger, 64 letter As followed by one =, the decoder writes 62 bytes past the end of a 50-byte buffer. Java does reject the input in the end, but as the researchers put it, “by then neighboring objects may already be corrupted.”

Overwriting memory next to your buffer is the classic first step towards making a program run the attacker’s instructions. That’s the “shell” in the name, which echoes Log4Shell, the 2021 Java logging bug.

An example: innocent code, exposed
#

Nothing about vulnerable code looks wrong. This is a typical way to read a Basic login header:

// "Authorization: Basic dXNlcjE6c2VjcmV0"  ->  "user1:secret"
String header = request.getHeader("Authorization");
if (header != null && header.startsWith("Basic ")) {
    byte[] raw = Base64.getDecoder().decode(header.substring(6));   // decoded BEFORE the password check
    String[] userAndPassword = new String(raw, StandardCharsets.UTF_8).split(":", 2);
    // ... check the password
}

The decode call runs for every visitor, logged in or not. On a busy server it gets called thousands of times, so the JVM switches it to the fast path. An attacker doesn’t need an account; they only need to send a header the server will decode.

The same is true of other places Base64 shows up. The Apache Shiro project explained that its remember-me cookie is decoded through java.util.Base64, so requests on that path “may reach the vulnerable code”. Their note is clear that this is a JDK bug, not a Shiro one: “changing Shiro versions alone does not fix a vulnerable JDK”.

The researchers report working pre-login exploits against default setups of well-known Java products, among them Keycloak, Jira, Confluence, Artifactory, Jenkins and PingFederate (as summarised on oss-security). They have held back the full exploit chains for now.

Am I affected?
#

All three of these must be true:

ConditionAffectedNot affected
Java versionOpenJDK 17.0.6 or newer, before the November fixOpenJDK 8 and 11 don’t contain the vulnerable code (Red Hat)
Processorx86-64 with AVX-512 VBMI: Intel Xeon Ice Lake and later, AMD Zen 4 and laterARM64 (Graviton, Apple silicon), and older x86 chips
Code pathBase64 decoding busy enough to be JIT-compiledCode that rarely decodes Base64

It doesn’t matter whose build you run. Corretto, Temurin, Microsoft, Zulu, Liberica, SapMachine, Red Hat and Oracle builds are all listed as affected.

Two quick checks on a Linux server:

# 1. Which Java? (look for 17, 21, 25 or 27)
java -version

# 2. Does this CPU have the instructions? All four names printed means yes.
grep -o -w -E 'avx512f|avx512bw|avx512vbmi|bmi2' /proc/cpuinfo | sort -u

In the cloud, the CPU depends on the instance type, so two servers running the same image can give different answers. Treat any x86-64 server as possibly affected until you’ve checked.

What to do
#

  1. Find every Java. CISA reminds us that JDKs bundled inside products, container images and appliances “may not appear as separate inventory entries”. Look inside your images, not just at the host.

  2. Update the JDK from your vendor, starting with internet-facing services. The fixed builds end in .1, for example Ubuntu’s packages are based on 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1, and Corretto 27.0.1.1.4 lists the CVE as fixed. Rebuild container images; a running container doesn’t update itself.

  3. If you can’t update today, turn off the fast path and restart:

    export JAVA_TOOL_OPTIONS="-XX:-UseBASE64Intrinsics"

    The alternative, -XX:UseAVX=2, switches off AVX-512 entirely. Use it only on x86-64: OpenJDK on ARM won’t start with it. Either flag is a stopgap, not a fix.

  4. Watch for crashes. A malformed decode can crash the JVM before it does anything worse. Unexpected hs_err crash files on a public service are worth a look.

You can confirm the stopgap took effect:

java -XX:-UseBASE64Intrinsics -XX:+PrintFlagsFinal -version | grep UseBASE64Intrinsics
#      bool UseBASE64Intrinsics   = false   {product} {command line}

How worried should you be?
#

Fair questions, fair answers:

  • Is it being exploited? When CISA recorded it on 17 November, its assessment listed exploitation as “none” so far. That can change quickly once the details are public.
  • Why two scores? Oracle gives 8.1 because it rates the attack as hard to pull off (each target needs its own memory layout). Red Hat gives 9.8 because public research already shows working exploits. Either way, it’s in the “patch this week” pile.
  • Is my laptop at risk? Much less. The risk is a server decoding untrusted Base64 from the internet, all day.

Takeaways
#

  • Java4Shell is a memory bug in Java’s fast, CPU-specific Base64 decoder, not in your code or your libraries.
  • Base64 is decoded early, often before login, so an attacker needs no account.
  • You’re exposed only with Java 17.0.6+ on an x86-64 CPU with AVX-512 VBMI and a busy decoder. Check all three.
  • Update the JDK everywhere, including inside images. Use -XX:-UseBASE64Intrinsics only until you can.

Keywords
#

TermWhat it means
CVEA public ID for one security bug, so everyone talks about the same thing
Base64A way to write any data with 64 safe text characters, padded with =
JDK / JVMThe Java toolkit, and the engine inside it that runs Java programs
HotSpotThe JVM used by OpenJDK and nearly every Java build
JIT“Just in time” compilation: the JVM turns busy code into fast machine code while it runs
IntrinsicA hand-written, CPU-specific version of a library method that the JIT swaps in for speed
AVX-512 VBMIInstructions on newer Intel and AMD server chips that process 64 bytes at once
Buffer overflowWriting past the end of the memory set aside for something, into its neighbours
Remote code execution (RCE)An attacker making your server run their instructions over the network
CVSSA 0–10 severity score; 7–8.9 is High, 9–10 Critical

References
#

Author
Samarthya
Engineer, learner, tinkerer. This is my trophy shelf of everyday work and leisure.

Related

AI from the ground up, part 4: what is a frontier model?

·8 mins
“Frontier” is borrowed from maps: the edge of the explored territory. A frontier model is one at the edge of what AI can currently do. The edge moves every few months, so the label is less a property of a model than a statement about a date. The edge of the map, as of November 2026 New terms are explained in plain words in Keywords at the end. The first three parts of this series covered the maths, the probability and the hardware behind every LLM. This part looks at the models at the very top: what makes them “frontier”, who builds them, and why the term now appears in law.

bhanuni.in: a domain, a redirect and a gallery that keeps her safe

In 2019 I booked a domain in my daughter’s name, bhanuni.in, and then did nothing with it for almost six years. It sat in a drawer like a gift card. She now draws every day (digitally & otherwise) (ponies - MLP, Sprunki, Rat-A-Tat, Sab Jholmaal hai and weekend sessions as part of a group), so the domain finally has a job: it opens her gallery. This post is all about how I wired it up, why I picked the boring option, and the precautions I take before any of her pictures go online. The redirect, and the importer every drawing goes through New to RDAP, SPF, DMARC or a proxied record? Every term in this post is explained in plain words in Keywords at the end. What I wanted # Three things, in this order:

Cloudflare Part 4: an introduction to zero trust

The old way to protect a network was a castle: a strong wall, a moat, and everyone inside trusted. Then people started working from cafés, apps moved to the cloud, and one phished VPN password could open the gate to the whole castle. Zero trust drops the castle. There is no “inside” any more, only one question asked on every request: who are you, and should you get this right now? From a trusted inside to a check on every request The first three parts were about public websites: the front desk, what it did for my domains and the free-tier checklist. This one is about the things that should not be public: an admin page, a home dashboard, a family photo area. It’s also the part I haven’t built yet, so it ends with a plan rather than a trophy.