CVE-2026-114938 Java4Shell: Pre-Auth RCE in OpenJDK Base64 Decoder — Analysis & Mitigation
CVE-2026-114938 Java4Shell: Pre-Auth RCE in OpenJDK Base64 Decoder — Analysis & Mitigation
On November 17, 2026, the security firm Calif disclosed a critical vulnerability in OpenJDK that it named Java4Shell. Tracked as CVE-2026-114938, the flaw is a heap out-of-bounds write in the hardware-accelerated Base64 decoder that HotSpot uses to speed up java.util.Base64. A single malformed Base64 string, supplied before any login, can corrupt the Java heap — and Calif demonstrated that the corruption can be turned into remote code execution in the default setups of some of the most widely deployed Java applications on the internet. This analysis explains what the flaw is, how it works in general terms, who is exposed, how to check your own systems, and what to patch first.
The short version: if you run OpenJDK 17.0.6 or later, or OpenJDK 21, 25 or 27, on an x86-64 server whose CPU supports AVX-512 VBMI, you are affected. Upgrade to the fixed builds released on November 17, 2026 — 17.0.21.1, 21.0.13.1, 25.0.5.1 or 27.0.1.1 — rebuild any container images that bundle Java, and restart every JVM. If you cannot patch immediately, a single JVM flag, -XX:-UseBASE64Intrinsics, disables the vulnerable code path. Standard Java 8 and Java 11 are not affected.
What Is Java4Shell?
Java4Shell is a memory-corruption vulnerability in the OpenJDK Base64 decoder. Base64 is the encoding Java applications use constantly: HTTP Basic authentication credentials, SAML artifacts, CSRF tokens, JSON Web Tokens, MIME attachments and API keys are all routinely Base64-decoded before a user is authenticated. That is what makes this flaw so dangerous — the vulnerable code runs on data an attacker controls, before any login check.
The bug lives in a hand-written, hardware-accelerated routine inside the HotSpot compiler. When the just-in-time compiler sees a hot Base64 decode loop on a capable CPU, it swaps the portable Java decoder for a vectorized native stub that uses AVX-512 VBMI instructions to decode many bytes at once. The flaw is in that stub, in the component OpenJDK lists as hotspot/compiler. Because the bug is in the JVM itself rather than in any application, no application code change can dodge it — every Java application running on a vulnerable JVM is exposed through the same path.
Calif found the flaw with AI assistance and reported it to Oracle ahead of the scheduled fix. The name Java4Shell follows the pattern of earlier landmark Java flaws: a single crafted input, no authentication, and a straight line to code execution. The vulnerable code was introduced as a performance optimization in OpenJDK pull request #4368, merged on June 25, 2021 — which means the flaw has been present in every affected release line for more than five years before anyone noticed it.
How CVE-2026-114938 Works
To understand the flaw, it helps to know how Base64 decoding works. Valid Base64 input comes in groups of four characters, each group decoding to three bytes, with = padding filling out the final group when the input length is not a multiple of three. The decoder computes how many output bytes a given input will produce, allocates a destination buffer of that size, and then writes the decoded bytes into it.
The bug is in how the accelerated decoder handles malformed padding. When the input ends with padding that should not be there — for example, a complete set of valid groups followed by a stray = — the decoder strips the padding with a subtraction that goes negative. That underflow produces a wrong output length, and the mask the decoder builds from it opens wider than the destination buffer. The vector write then lands past the end of the allocated buffer, corrupting adjacent memory on the Java heap.
At best, that corruption crashes the JVM, which is a denial of service. At worst, an attacker who controls the decoded data can overwrite heap structures — object headers, array lengths and pointers — in a way that eventually redirects execution to attacker-controlled code. That is how a decoding error becomes remote code execution. Calif demonstrated pre-authentication remote code execution in the default setups of Keycloak, Jira, Confluence, JFrog Artifactory, Jenkins and PingFederate, and post-authentication code execution in Kafka, Solr, Elasticsearch, Gerrit and Spinnaker. Each target needs its own exploit chain, the attack is sensitive to network latency, and a failed attempt can crash the JVM — but the demonstrations prove the path from a malformed Base64 string to code execution is real.
Calif has published a bounded trigger that proves a JVM is vulnerable, and crash-level proof-of-concept code is public. The full application exploit chains are being held back by the researchers for now, which is the window defenders have: inventory and patch before those chains circulate. There is also a client-side route — a Java client that decodes Base64 from a malicious server over a TLS connection can be attacked the same way — so the exposure is not limited to servers.
Impact and Exposure
The exposure is large because Java is everywhere, but it is narrower than the headline suggests, and defenders should understand the two conditions that must both be true. First, the JVM must be a vulnerable build: OpenJDK 17.0.6 or later, or any release of the 21, 25 or 27 lines before the November 17 fixes, from any vendor — Oracle, Temurin, Corretto, Zulu, Microsoft, Red Hat, Liberica, SapMachine or GraalVM. Second, the server must run on an x86-64 CPU that exposes the AVX-512 VBMI instructions — Intel Xeon from Ice Lake onward, or AMD EPYC from Zen 4 onward, which includes common cloud instance types. ARM servers are not affected, and neither are older x86-64 CPUs without those instructions.
Both conditions must hold, and the application must also decode attacker-controlled Base64 — which, as noted above, most web applications do before login. Red Hat notes that HTTP Basic credentials, SAML artifacts, CSRF tokens and MIME encoded words are routinely decoded before authentication, which is why internet-facing identity and collaboration software tops the priority list: Keycloak, Jira, Confluence, Artifactory, Jenkins and PingFederate first, then Kafka, Solr, Elasticsearch, Gerrit and Spinnaker, and then every product, appliance or container image that bundles its own Java runtime.
Two facts keep the situation from being worse. First, as of late November 2026, the flaw has not been added to CISA's Known Exploited Vulnerabilities catalog, and Cisco and AWS have said they know of no malicious use. Second, fixed packages reached the major Linux distributions within days: by November 20, RHEL 8, 9 and 10, Debian, Ubuntu, Alpine and Amazon Linux had shipped fixed Java packages. That is not a reason to relax. A public crash proof of concept already exists, the full exploit chains are only being held back rather than impossible, and history says the window between disclosure and weaponization is short.
Who Is Affected
| OpenJDK line | Affected versions | Fixed build |
|---|---|---|
| 17 | 17.0.6 through 17.0.21.0 | 17.0.21.1 |
| 21 | 21 through 21.0.13.0 | 21.0.13.1 |
| 25 | 25 through 25.0.5.0 | 25.0.5.1 |
| 27 | 27 through 27.0.1.0 | 27.0.1.1 |
| 18–20, 22–24, 26 | Every release (end-of-life lines) | No fix — upgrade to a supported line |
| 8 and 11 | Not affected | No change needed |
Two scoring disagreements are worth understanding, because they explain why different advisories quote different numbers for the same flaw. OpenJDK and the CVE record publish a CVSS 3.1 score of 8.1, with a high attack-complexity metric, because exploitation needs both a vulnerable CPU and an application that decodes attacker-supplied Base64. Calif, the discoverer, scores it 9.2 under CVSS 4.0, and Red Hat's preliminary score is 9.8. Atlassian also scores it 9.2. The gap is a judgement about how common the preconditions are, not a disagreement about the bug. For an internet-facing Java application, the preconditions are common enough that the higher scores are the honest ones to plan around — and this post carries both, so readers can see the full picture.
One trap deserves a warning. The Java version a server reports does not always tell you whether it is patched. Vendors ship fixed builds under the same feature version, and container images bundle their own JVMs, so checking java -version on the host is not enough. Check the exact build number, check the Java bundled inside every container image and appliance, and confirm against your vendor's advisory. A server that looks old but is actually fixed can be left alone, but a server that looks fine while its container still carries a vulnerable JVM is the one that gets compromised.
How to Detect It
Detection is harder than usual for this flaw, and defenders should know why before they start hunting. The attack traffic is an ordinary-looking request carrying a malformed Base64 value — a credential, a token, a SAML artifact — inside an encrypted TLS connection. Web access logs show almost nothing distinctive about an attempt, and the vulnerable code runs before authentication, so there is no failed-login trail to follow either.
Start with JVM stability, because a memory-corruption attempt usually leaves crashes behind before anything else. Look for JVM crashes, heap corruption errors and unexpected JVM restarts on Java services, and correlate them with inbound traffic. Repeated crashes on a Java service that decodes attacker-controlled Base64, especially alongside spikes in connections, should be investigated rather than dismissed as routine instability. A failed exploitation attempt can crash the JVM, so a cluster of crashes may be the first sign that someone is working through the exploit chain.
Next, inventory rather than hunt. The most reliable detection for this flaw is knowing where vulnerable JVMs run. List every Java runtime in the environment — hosts, containers, appliances and build pipelines — and record the exact build and the CPU it runs on. Anything on OpenJDK 17.0.6 or later, or on the 21, 25 or 27 lines before the November 17 builds, running on an x86-64 CPU with AVX-512 VBMI, is exposed. Prioritize internet-facing identity and collaboration software first, then anything that decodes Base64 from untrusted input, then the long tail of bundled JVMs in appliances and images.
Then check processes and the network. A Java process that spawns a shell, or any unexpected child process running under the application user, is the loudest single signal of a successful compromise. Look for new or modified files under the application directory outside a change window, and for outbound connections from Java servers to unfamiliar hosts after a burst of requests. If the endpoint was reachable from the internet, check the host for compromise before patching over it — patching removes the hole, but it does not remove an attacker who already got in.
How to Fix It
Patching is straightforward, and the order matters. First, upgrade the Java runtime to a fixed build: 17.0.21.1, 21.0.13.1, 25.0.5.1 or 27.0.1.1, or your Linux distribution's fixed package. Oracle's fixed releases shipped on November 17, 2026, and the major distributions followed within days. Rebuild every container image that bundles Java — patching the host JVM does nothing for a container that carries its own — and restart every JVM. A running JVM keeps using the old, vulnerable code until it restarts, so the restart step matters as much as the upgrade.
If you cannot upgrade immediately, disable the vulnerable code path with a single JVM flag: -XX:-UseBASE64Intrinsics. That turns off the hardware-accelerated Base64 decoder and falls back to the portable implementation, which is not affected. Vendors confirm the flag has no meaningful performance impact for most applications, and it works on every affected version, so it is the right emergency mitigation while patching is scheduled. End-of-life lines — 18 through 20, 22 through 24 and 26 — have no fix at all and must be upgraded to a supported line.
After patching, verify rather than assume. Confirm the running build number on every JVM, including the ones inside containers, and re-run the exposure check. Calif's bounded trigger can prove whether a JVM is still vulnerable, which is more reliable than trusting a version string. Treat any internet-facing Java service that was reachable before the patch as potentially probed: review its logs and process history for the crash and compromise signals described above.
Lessons for Defenders
The first lesson is about where trust lives in a Java stack. Applications assume the JVM is a safe foundation, and most of the time it is — but Java4Shell is a reminder that the runtime itself is attack surface. A flaw in a standard-library decoder reaches every application that uses it, without a single line of application code being wrong. Runtime patching belongs in the same priority tier as application patching, and container images that bundle their own JVM need the same discipline as the hosts they run on.
The second lesson is about performance optimizations. The vulnerable code was a hand-written, hardware-specific fast path, introduced to make Base64 decoding faster on modern CPUs. Hand-written vector code is exactly the kind of code where a small arithmetic mistake becomes a memory-safety catastrophe, and it is also the kind of code that is hardest to review — the bug survived five years in one of the most scrutinized codebases in the world. When a fast path handles untrusted input, it deserves the same scrutiny as any parser.
The third lesson is about preconditions. Java4Shell needs a specific CPU, a specific JVM range and attacker-controlled Base64 — and yet it still reaches the most important Java applications on the internet, because those preconditions are ordinary in production. "It needs a modern server CPU" is not a meaningful defense when modern server CPUs are the default. Score a vulnerability by how common its preconditions are in your environment, not by how many conditions it has.
Frequently Asked Questions
Is Java4Shell being exploited in the wild?
As of late November 2026, no exploitation in the wild has been reported, and the flaw is not in CISA's Known Exploited Vulnerabilities catalog. Calif has demonstrated pre-authentication remote code execution in the lab and is holding back the full exploit chains. The absence of reported exploitation is a window, not a verdict.
Am I affected if my server uses an ARM CPU?
No. The vulnerable code only runs on x86-64 CPUs with AVX-512 VBMI instructions. ARM servers, and older x86-64 CPUs without those instructions, do not take the vulnerable path. Check your CPU flags before assuming either way.
Does Java 8 or Java 11 need patching?
No. Standard Java 8 and Java 11 do not contain the vulnerable code. Oracle's Java SE 8 Enterprise Performance Pack has a fixed build, 8u513-perf, for the performance-pack variant only.
What does the -XX:-UseBASE64Intrinsics flag do?
It disables the hardware-accelerated Base64 decoder and makes the JVM use the portable Java implementation instead. That removes the vulnerable code path entirely, with no meaningful performance impact for most applications. It is the recommended emergency mitigation while patching is scheduled.
Why do different advisories show different CVSS scores?
OpenJDK and the CVE record score it 8.1 under CVSS 3.1, with high attack complexity, because exploitation needs a vulnerable CPU and an application that decodes attacker-controlled Base64. Calif scores it 9.2 under CVSS 4.0 and Red Hat's preliminary score is 9.8, reflecting the view that those preconditions are common in production. Both scores describe the same flaw.
Related posts:
- CVE-2026-123007 NGINX2Root: Unauthenticated RCE in NGINX HTTP/2 — Analysis & Mitigation
- Session Forgery: Cross-Environment Token Trust — Analysis
- CVE-2026-96889: Next.js Image Optimization RCE Vulnerability — Analysis & Mitigation
- CVE-2026-108598: Floci Velocity SSTI RCE — Analysis
- CVE-2026-108551: OpenAPI TypeScript Codegen Handlebars Injection — Analysis
Report by Faizan Akhtar — The Cyber Security Researcher

Comments
Post a Comment