November 18, 2026
Java4Shell (CVE-2026–114938): When Java’s Base64 Decoder Forgot How Memory Works
By Shah Kaif | “How a simple Base64 decoding operation turned into a critical memory-corruption vulnerability — and why your CPU might…

By Shah kaif
5 min read
By Shah Kaif | "How a simple Base64 decoding operation turned into a critical memory-corruption vulnerability — and why your CPU might decide whether you're vulnerable." | Linkedin
Imagine spending years writing Java because you trust the JVM to handle memory safely.
You don't manually allocate and free memory like you would in C or C++. You don't normally worry about buffer overflows. You let the JVM do its job.
Then someone discovers that a seemingly innocent Base64 decoding operation can overwrite memory outside its allocated array.
Well, that is an uncomfortable Monday morning for Java developers.
Welcome to Java4Shell (CVE-2026–114938).
This vulnerability is a good reminder that even a memory-managed language can inherit memory-corruption problems from the low-level code underneath it.
And the interesting part? You don't necessarily need a complicated application vulnerability. Sometimes, the problem is hiding inside the runtime itself.
Let's take a look — starting with what I actually found on my own test laptop, because it's a faster way into this bug than the textbook definition.
Quick reference: affected versions and exploitation prerequisites
Before the deep dive, here's the checklist version for anyone who just needs to know where they stand.
Vulnerable JDK / Java SE versions
Product Vulnerable Build Patched Build
----------------------------------------------------------------------------
Oracle Java SE 17 17.0.21.0.3 17.0.21.1
Oracle Java SE 21 21.0.13.0.3 21.0.13.1
Oracle Java SE 25 25.0.5.0.3 25.0.5.1
Oracle Java SE 27 27.0.1.0.3 27.0.1.1
Oracle Java 8 Enterprise Perf Pack 8u511b33-perf Nov 17 2026 update
Oracle GraalVM for JDK 17 17.0.21.0.3 Nov 17 2026 update
Oracle GraalVM for JDK 21 21.0.13.0.3 Nov 17 2026 update
Oracle GraalVM Enterprise Edition 21.3.20.0.3 Nov 17 2026 update
----------------------------------------------------------------------------
NOT AFFECTED: Standard Oracle Java SE 8 and 11 builds (per Red Hat advisory)Product Vulnerable Build Patched Build
----------------------------------------------------------------------------
Oracle Java SE 17 17.0.21.0.3 17.0.21.1
Oracle Java SE 21 21.0.13.0.3 21.0.13.1
Oracle Java SE 25 25.0.5.0.3 25.0.5.1
Oracle Java SE 27 27.0.1.0.3 27.0.1.1
Oracle Java 8 Enterprise Perf Pack 8u511b33-perf Nov 17 2026 update
Oracle GraalVM for JDK 17 17.0.21.0.3 Nov 17 2026 update
Oracle GraalVM for JDK 21 21.0.13.0.3 Nov 17 2026 update
Oracle GraalVM Enterprise Edition 21.3.20.0.3 Nov 17 2026 update
----------------------------------------------------------------------------
NOT AFFECTED: Standard Oracle Java SE 8 and 11 builds (per Red Hat advisory)Not affected: standard Java SE 8 and 11 — they get to sit this one out.
All four of these need to line up for this to actually be exploitable:
- Unpatched OpenJDK 17.0.6+ (or an affected Oracle/GraalVM build above)
- An x86–64 CPU with AVX-512 VBMI — specifically
AVX512F,AVX512BW,AVX512VBMI,BMI2. AVX2 doesn't count, and if you're on ARM64, you can stop reading and go make coffee. - The accelerated decoder actually enabled (not turned off via
-XX:-UseBASE64Intrinsicsor-XX:UseAVX=2) - Attacker-controlled input reaching
Base64.getDecoder()— Basic Auth headers, SAML, file uploads, REST/GraphQL params, CSRF tokens, take your pick
How It Works
The accelerated decoder processes Base64 input in big chunks using AVX-512 instructions, because reading one character at a time is for people who enjoy waiting. The bug shows up in how it calculates the write mask near the end of input, when padding (=) is involved.
Certain malformed padding triggers an integer underflow in that calculation. Instead of a mask sized for the correct number of output bytes, the routine produces an all-ones mask — which is the CPU equivalent of someone confidently saying "write all 64 bytes," without bothering to check whether there's actually room for 64 bytes. Spoiler: there usually isn't. The result is an out-of-bounds write into whatever heap memory happens to be sitting next door.
The JVM does eventually catch on and throw an IllegalArgumentException — but that's a bit like a bouncer turning someone away after they've already kicked the door in. The rejection is real. So is the broken door.
(Calif's writeup walks through the exact byte-offset math behind this; I'm leaving the precise numbers out here since that edges toward proof-of-concept territory. Go to the source if you want the arithmetic.)
So why doesn't Java's famous memory safety save us here? Because the optimized intrinsic is hand-written native/assembly code sitting underneath Java's safety net, not inside it. Java protects your code. It never promised the plumbing underneath was leak-proof too.
From Memory Corruption to RCE
An out-of-bounds write doesn't hand you a shell on a silver platter — you still have to work for it. Calif's research describes a chain (my paraphrase, not their exact wording): the initial corruption gives you limited, clumsy control → heap grooming nudges useful objects closer to the damaged buffer, like rearranging furniture before a guest you don't trust shows up → manipulating array metadata upgrades that into a more general write primitive → which opens the door to reading memory (tokens, keys, secrets — Calif compares this bit to Heartbleed) → and with enough of these primitives stacked up, application-specific exploitation can eventually reach code execution.
There's no one-size-fits-all exploit here. Every application's memory layout is its own weird little snowflake, so weaponizing this against any specific target is custom work, not copy-paste.
Applications discussed in the research (read as "plausibly exposed," not "guaranteed pwned"):
- Pre-auth: Keycloak, Jenkins, Jira, Confluence, Artifactory, PingFederate
- Post-auth: Kafka Broker, Solr, Elasticsearch, Gerrit, Spinnaker
And no, your desktop app doesn't get a pass just because it's not listening on a port. A Java client that opens a TLS connection to a malicious server can have corrupted data pushed right back at it — turns out being the one who calls out doesn't make you safe from what calls back.
Detecting Exposure
1. Figure out which JVM is actually running your app (your default java -version is often lying by omission):
java -version
jcmd -l
jcmd PID VM.versionjava -version
jcmd -l
jcmd PID VM.version2. Check CPU flags (Linux):
grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' | grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' | grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'All four need to show up. On cloud instances, check from inside the guest — the hypervisor decides what your VM actually gets to see, not whatever the provider's marketing page brags about.
3. Trace the code paths:
Base64.getDecoder() / getUrlDecoder() / getMimeDecoder()Base64.getDecoder() / getUrlDecoder() / getMimeDecoder()Finding one of these in your codebase proves nothing by itself. Follow the data and see if anything an attacker touches actually ends up here.
4. Verify behavior safely: Run Calif's bounded reproducer in a disposable lab JVM. If it reproduces, you've confirmed the memory-corruption behavior on that runtime and hardware — you have not proven RCE against your app. That's a separate, much harder exercise.
Mitigation
Patch first. Upgrade to the vendor-fixed build above and actually check the full build number — "I installed Java 17" is not the same sentence as "I installed the patched Java 17."
Can't patch right now? Buy time with:
-XX:-UseBASE64Intrinsics # turns off the vulnerable decoder path (preferred)
-XX:UseAVX=2 # blocks AVX-512 entirely (bigger performance hit)-XX:-UseBASE64Intrinsics # turns off the vulnerable decoder path (preferred)
-XX:UseAVX=2 # blocks AVX-512 entirely (bigger performance hit)Also: inventory every bundled JVM hiding in your containers, rebuild images after patching instead of just patching the host and hoping, restart processes after flag changes (a flag that isn't loaded is just a wish), and go check your auth and upload endpoints before anything else.
Takeaways
- Memory-safe languages still lean on unsafe native code somewhere underneath — the safety net has a floor, and that floor is C++.
- CPU architecture is now officially part of your attack surface. Two servers can run the exact same app and still have completely different exposure, just because of what silicon they happen to sit on.
- A thrown exception is not the same as "nothing happened." Sometimes the damage is already done by the time the error message shows up to apologize.
- Version-number fingerprinting alone tells you almost nothing. You need runtime, CPU, and code path all checked together — one out of three doesn't count.
References:
- Red Hat — CVE-2026–114938 Security Advisory
- Oracle — JDK 21 Release Notes
- Calif — Original Research · Red Hat Advisory · Oracle's November 2026 CPU advisory
As of November 18, 2026. Verify affected builds against your vendor's advisory before acting — and maybe give your Base64 decoder a little more respect going forward.