Java4Shell: Could a Base64 String Hijack Your Java Server?
- ✓Java4Shell (CVE-2026-114938) is a heap buffer overflow in Java's built-in Base64 decoder. It sits inside OpenJDK itself, not in a library, and OpenJDK and Oracle have both confirmed and patched it.
- ✓Calif, the firm that found it, showed pre-auth remote code execution against Keycloak, Jira, Confluence, Jenkins, JFrog Artifactory and PingFederate, all running default settings.
- ✓It affects OpenJDK 17.0.6 and later, including the 21, 25 and 27 lines, but only on x86-64 CPUs with AVX-512 VBMI. ARM servers are not affected.
- ✓Oracle's fixed builds are 17.0.21.1, 21.0.13.1, 25.0.5.1, 27.0.1.1 and 8u513-perf. Other vendors, like Temurin, Corretto and Zulu, ship on their own schedules.
- ✓Oracle scores it 8.1 (CVSS 3.1), and Calif scores it 9.2 (CVSS 4.0). As of November 17, no in-the-wild attacks had been reported, and it wasn't in CISA KEV.
A bug in Java's own Base64 decoder, called Java4Shell (CVE-2026-114938), leaked before its patch was ready. On November 17, after Oracle shipped fixed builds, Calif published the full technical write-up, titled "Java4Shell: Write once, RCE everywhere." Now that the details are out, attackers can study them too.
The reason this bug matters is where that decoder sits. When a Java server like Tomcat is set up to use Basic auth, it runs that decoder on the login header before it even checks who's logging in. Calif proved the point by taking over six well-known products without a password.
What sets Java4Shell apart from Log4Shell and Spring4Shell is where it lives. Log4Shell was in a logging library, and Spring4Shell was in a framework. Java4Shell is in the Java runtime itself, not in your code or your dependencies. So the fix isn't a library upgrade. It's a JDK update.
It also means you'll have to look in a different place to find it. An application dependency list often leaves out the JDK, so you'll want to check your runtime and container inventory too.
What's confirmed so far?
OpenJDK's Vulnerability Group lists the 17, 21, 25 and 27 release lines as affected, and Calif puts the starting point at OpenJDK 17.0.6. Oracle has patched its own builds, and here's where things stand by vendor:
| Vendor / edition | Affected | Fixed builds |
|---|---|---|
| Oracle Java SE | 17.0.21.0.3, 21.0.13.0.3, 25.0.5.0.3, 27.0.1.0.3 (Oracle says earlier versions are likely affected too) | 17.0.21.1, 21.0.13.1, 25.0.5.1, 27.0.1.1 |
| Oracle Java 8 Enterprise Performance Pack | 8u511b33-perf | 8u513-perf |
| Oracle GraalVM | GraalVM for JDK 17.0.21.0.3 and 21.0.13.0.3; GraalVM EE 21.3.20.0.3 | See Oracle's advisory |
| OpenJDK-based builds (Temurin, Corretto, Zulu, Microsoft, Liberica, SapMachine, Red Hat) | 17.0.6 and later, per Calif | Check each vendor's advisory |
| Standard Java 8 and Java 11 | Not listed as affected by OpenJDK | Apply your vendor's November update anyway |
You'll also see two severity scores for this one bug. Oracle rates it 8.1 using CVSS 3.1 and marks the attack complexity as high, while Calif rates it 9.2 using CVSS 4.0. Those are different CVSS versions, so the numbers can't be compared directly. Either way, it's serious.
Why 17.0.6 is the starting point. The AVX-512 Base64 decoder (JDK-8268276) first shipped in mainline JDK 18, and it was then backported into OpenJDK 17.0.6. Oracle JDK 17 got it in 17.0.7, and Oracle's Java 8 Enterprise Performance Pack picked it up in 8u371-perf, which is why that edition is on the affected list while regular Java 8 isn't.
Which of your services need attention first?
Start where attackers start, with the services they can reach from the internet. Make a list of every internet-facing host that runs a Java stack. Tomcat, Jetty, Spring Boot and WebLogic often give themselves away through headers and default error pages, so they're usually easy to spot. Then run each host through three checks.
Check 1: the Java build. Find the build each service is actually running and compare it to the table above. Don't forget JDKs bundled inside vendor appliances and container base images, since those are easy to miss.
Check 2: the CPU. The vulnerable decoder only runs on x86-64 chips with AVX-512 VBMI. That includes Intel Xeon Ice Lake, Sapphire Rapids, Emerald Rapids and Granite Rapids, plus AMD Zen 4 and newer. Skylake and Cascade Lake chips don't have VBMI. In AWS terms, m5 (Skylake or Cascade Lake) is out, while c6i and m6i (Ice Lake), m7i (Sapphire Rapids) and m7a (Zen 4 "Genoa") are in. ARM servers like Graviton aren't affected at all.
Check 3: untrusted Base64 reaching the decoder. This check takes the most work, because it depends on your own code. Calif says ordinary features like authentication and file uploads can expose the decoder, since both often carry Base64 data. Basic auth is a good place to start. Apache Tomcat's BasicAuthenticator decodes the incoming Authorization header with java.util.Base64.getDecoder().decode(), and the server has to decode that header before it knows who's logging in. Researcher Kevin Breen says Tomcat Basic auth and the java-jwt library both offer pre-login paths. From there, go through token handling and file uploads one at a time, and find out whether untrusted data can reach the decoder.
There's one more path to know about. Calif says a Java program can also be compromised when it makes a TLS connection to a server an attacker controls, even if the program doesn't offer any service of its own. So outbound Java clients count too, not just servers.
To check a running service, point jcmd at the actual process. Don't start a new JVM to check, because a new JVM might use a different build or different flags.
# Which build is this process running?
jcmd <PID> VM.version
# How was it started? (look for -XX:UseAVX or Base64 flags)
jcmd <PID> VM.command_line
# Which flags is it actually using?
jcmd <PID> VM.flags -all | grep -E 'UseAVX|UseBASE64Intrinsics'
# Does the host CPU have the required features? (Linux; all four must appear)
grep -o -w -E 'avx512f|avx512bw|avx512vbmi|bmi2' /proc/cpuinfo | sort -u
Run jcmd as the same OS user and group that started the JVM, and run it inside the container if the service lives in one. If all four CPU flags show up and the build is in the affected range, treat the service as vulnerable. Calif also published a small test program that prints "REPRODUCED" on affected JDK and CPU combinations. It confirms the bug is present, but not whether a specific app can be reached, so run it in a test environment, not in production.
What should you do now?
Once you've run the checks, you'll find that not every service needs the same urgency. Sort each one into one of three groups:
-
Patch now: an affected build on a VBMI-capable x86-64 CPU. Start with anything internet-facing, especially products Calif named, like Keycloak, Jira, Confluence, Jenkins, Artifactory and PingFederate.
-
Patch on your normal cycle: an affected build on hardware without VBMI, or on ARM. Java4Shell can't trigger there, but the November update fixes other bugs too, so don't skip it.
-
Not sure yet: you can't confirm the build or the CPU. Treat it as "patch now," because unknown doesn't mean safe.
After you've sorted your services, work through these steps:
-
Apply the fixed builds. Oracle's builds are out now. For Temurin, Corretto, Zulu and other OpenJDK distributions, follow each vendor's advisory. After you patch, rebuild your images, restart your JVMs and confirm the new build with jcmd
VM.version. -
Inventory your Java runtimes. Include runtimes and container images, not just your application dependencies.
-
Cut exposure you don't need. Use firewall rules, security groups and IP allowlists to close off any access the business doesn't use.
-
Watch for crashes. Calif says a failed exploit attempt can crash the JVM, though attackers can often retry. Unexpected JVM restarts and new
hs_err_pid*.logfiles (especially SIGSEGV crashes) on internet-facing hosts are worth checking. Crashes have lots of other causes, so one crash on its own isn't proof of an attack. -
Think about your secrets. Calif also describes a memory leak it calls "JavaBleed," which can expose heap contents like tokens, private keys and personal data before any code runs. If a vulnerable, internet-facing service shows signs of probing, consider rotating the credentials and keys it holds. That's our advice, not vendor guidance.
What about a stopgap? If you can't patch right away, Calif names two JVM startup flags. -XX:-UseBASE64Intrinsics turns off the fast Base64 path, and -XX:UseAVX=2 turns off AVX-512 entirely. Only use UseAVX=2 on x86-64, because Java on ARM won't start with that flag. Neither Oracle nor OpenJDK mentions these flags in its advisory, so treat them as a bridge to patching, not a replacement. Both need a restart to take effect, and UseAVX=2 can slow some workloads down. After the restart, confirm the setting with jcmd
A WAF rule is another stopgap people reach for, but don't rely on one unless you know it covers every input that gets Base64-decoded. That's a tall order, because the bad input could sit in almost any field.
How does Java4Shell work?
First, a quick refresher. Base64 turns binary data into text. Four characters normally stand for three bytes, but the final group can stand for fewer, and the = padding at the end tells the decoder how short that last group is.
Because Java decodes Base64 so often, HotSpot swaps the busy parts of java.util.Base64 for hand-tuned assembly, called intrinsics. In 2021, OpenJDK added an AVX-512 version of the decoder (JDK-8268276) that works through big chunks of data at once. The backport request cited about a 19x speedup, which is why customers asked for it in Java 17.
According to Calif, the bug is in how that fast decoder handles padding at the end of the input. When the input ends in =, the code works out an output length of zero and then subtracts again, so the length underflows to -1. That broken number turns the decoder's write mask into "write everything," so it writes a full 64 bytes. With a 65-byte input (64 Base64 characters plus one =), Java sets aside a 50-byte result, and the decoder writes 62 bytes past the end of it. Java only rejects the bad input after the neighboring memory is already corrupted.
This matters because Java code normally can't overflow a buffer at all. Here, the overflow happens in the JVM's own assembly, below the safety checks the language gives you. Calif showed that, with careful work, attackers can turn that overwrite into full code execution.
Has this decoder had bugs before?
It has. In 2021, right after the decoder landed, a 24-hour stress run crashed with a SIGSEGV (JDK-8273108), and fixes from that ticket were merged into the decoder's code when it was backported to Java 17. Then in 2024, JDK-8321599 ("Data loss in AVX3 Base64 decoding") showed the decoder dropping the last byte of its output on CPUs with AVX-512BW and VBMI. That bug was reproduced on an AWS c6i instance and fixed in OpenJDK 17.0.11 and 21.0.3, Oracle JDK 17.0.12 and 21.0.3, and JDK 22. Neither ticket was a security issue, but both show this code has tripped over the edges of its data before.
How can Strobes help?
With a bug like this, the hardest part is the first step: knowing which of your internet-facing services run Java at all. Strobes attack surface management helps with that, so you can run the three checks on a real list instead of a guess. If a service still lands in the "not sure yet" group, controlled testing can help settle it, as long as you agree on limits first. Calif notes that a failed attempt can crash the target, and a failed test doesn't prove the service is safe, so testing should never hold back a fix that clearly applies.
Related reading
- HTTP2Shell (CVE-2026-111497): the Brotli RCE hitting Node.js, Python and more
- PHP2Shell (CVE-2026-109618 and CVE-2026-109619): leaked PHP flaws and what to do now
- wp2shell: a pre-auth RCE in WordPress core
- Top 7 CVEs of October 2026
- Vulnerability validation: why most of your scanner backlog is noise
FAQ
Is Java4Shell the same as Log4Shell? No. Log4Shell (CVE-2021-44228) was a bug in the Log4j logging library. Java4Shell is a memory-corruption bug in OpenJDK's own Base64 decoder, so it can affect apps that never used Log4j.
Will Java4Shell be the next Log4Shell? Probably not on the same scale. Log4Shell could be triggered with one string in a log line, on almost any server. Calif says Java4Shell has no universal exploit, so each app needs its own, and it only works on certain x86-64 CPUs. Still, Calif took over six major products without a password, so treat it as critical wherever your hardware and build match.
Is there a public exploit for CVE-2026-114938? Calif published a test program that triggers the bug safely but doesn't take control of a system, and it's holding back its app-specific exploits for now. Researcher Kevin Breen says he built a working exploit but hasn't released it. As of November 17, Tenable knew of no attacks in the wild, and the bug wasn't in CISA KEV.
Does Java4Shell affect Java 8 or Java 11? OpenJDK doesn't list standard Java 8 or Java 11 as affected. The exception is Oracle's Java 8 Enterprise Performance Pack, which contains the same decoder and is fixed in 8u513-perf. Oracle's November update still covers Java 8 and 11 for other bugs, so apply your vendor's update for those versions too.
Are ARM servers like AWS Graviton affected? No. Calif says ARM64 systems aren't affected, because the vulnerable code only runs on x86-64 chips with AVX-512 VBMI.
Can a WAF block Java4Shell? Don't count on it. A rule would need to cover every input that gets Base64-decoded, including login headers, tokens and file uploads.
Where do I get the fix? Oracle's fixed builds came out on November 17, 2026: 17.0.21.1, 21.0.13.1, 25.0.5.1, 27.0.1.1 and 8u513-perf. If you run Temurin, Corretto, Zulu, Microsoft, Liberica, SapMachine or Red Hat OpenJDK, check that vendor's advisory for its fixed build.

