Java4Shell: 65 Characters That Turned a Base64 Decoder Into a Shell
Last Tuesday, a string 65 characters long could take over a Jenkins server. No login. No password guessing. Just 64 letter A's and an equals sign, sent to the right endpoint, and the Java process on the other end would start doing what the sender wanted.
I read the disclosure twice because the first time I thought I had misread it. The bug was not in Jenkins. It was not in Jira, or Keycloak, or any of the other products the researchers broke into. It was in Java itself, in the part that decodes Base64, which is about as basic as a function gets. If you have ever written a login flow, you have leaned on Base64. Your auth headers are Base64. Your tokens are Base64. Your file uploads often are. The researchers at Calif found a way to make that decoder write past the end of its own buffer, and then they turned that small overflow into code execution on six products at once, all with default settings, all without logging in.
The flaw is CVE-2026-114938. Calif calls it Java4Shell. Oracle and OpenJDK shipped fixes on November 17, the same day the details went public, a little earlier than planned, because the details had leaked.
What actually broke
Modern Java does not decode Base64 with a plain loop. On x86-64 machines with AVX-512 VBMI instructions, HotSpot uses a hand-written, vectorized fast path. It is the kind of code that exists because somebody measured it and found it meaningfully faster, and it is the kind of code where a small arithmetic mistake hides for years because the fast path only runs on specific hardware and the tests pass everywhere else.
The mistake is in how the decoder calculates the output length when the input ends with an unexpected number of padding characters. Feed it a malformed string, something like 64 A's followed by a single =, and the length calculation underflows to a negative number. The decoder then writes 62 or 63 bytes past the end of the output array. Java does reject the input. It just rejects it after the write has already happened.
That ordering is the whole bug. The check exists. It runs too late.
Calif's Quang Luong found it. Oracle's patch notes also credit Albert Yang. The researchers demonstrated full pre-authentication takeovers on default installations of Keycloak, Atlassian Jira, Atlassian Confluence, JFrog Artifactory, Jenkins, and PingFederate. With a login, the list grows: Apache Kafka Broker, Apache Solr, Elasticsearch, Gerrit, Netflix Spinnaker, Apache Tomcat, and custom Spring Boot apps. They are holding back the attack code for the six products. Other labs have reproduced crashes and a memory leak so far, not the code execution, which tells you something honest about this bug: the crash is easy, the takeover is work.
Why this one is not Log4Shell, and why it still matters
Every writeup reaches for the Log4Shell comparison, and it is only half right. The reach is similar. Java runs a huge share of business software, and the vulnerable code is on by default. But Log4Shell needed one string pasted into one log line. Java4Shell needs three things to line up at once: the right processor, the right Java version, and an exploit built for each individual product, because every application arranges its heap differently and handles Base64 in its own way.
The researchers get past the corrupted bytes by arranging the server's memory so the overflow stretches a neighboring array, then use that array to write bytes of their choosing and a second array to read memory back. They call the reading part JavaBleed, and it is the Heartbleed-shaped half of the story: a leak that can spill private keys and tokens out of a running server. One researcher, samczsun, showed the scarier direction: any Java program that reaches out to a hostile server over TLS becomes open to takeover, even when it exposes no services of its own. Your server does not have to be listening. It only has to talk to the wrong peer.
The hardware filter is what keeps this from being a fire for everyone. The vulnerable path only runs on Intel Xeon chips from Ice Lake onward, Sapphire Rapids, Emerald Rapids, Granite Rapids, and AMD processors from Zen 4 and newer. ARM64 machines are immune. If your servers are ARM, or old Intel, or running Java older than 17.0.6, this particular bug cannot touch you. That is genuinely good news, and it is also the reason the scoring is split: Calif rates it 9.2 under CVSS 4.0, Red Hat rates it 9.8, and Oracle rates it 8.1 under CVSS 3.1, calling it hard to exploit but requiring no login. All three can be true at once. The severity depends on where you stand.
The part that should bother builders
I build a messenger. My server is Node, my Android app is Kotlin, my phone is ARM. This bug did not touch my code directly, and I checked that before I wrote a word of this, because the worst thing a security writer can do is cry wolf about his own stack. But I still spent an evening on it, because the lesson is not about Java. The lesson is about the layer underneath your code that you never think about.
Nobody audits the Base64 decoder. It is too boring. It has been in the runtime since forever, it has tests, and it is the kind of function you would bet your reputation on without a second thought. The bug lived in OpenJDK from 17.0.6, released in January 2023, until last week. Almost four years. The fast path was the vulnerability, and the fast path was the point: somebody optimized a boring function, the optimization had a bug, and the bug sat in every Java distribution built from OpenJDK. Oracle Java SE, Temurin, Corretto, Zulu, Liberica, SapMachine, Red Hat OpenJDK, Microsoft's build. All of them.
That is the shape of modern supply chain risk. It is not always a compromised package or a typosquatted library. Sometimes it is a three-year-old arithmetic error in a function so fundamental that nobody thinks to question it, sitting under the login page of half the enterprise.
And the fix is not dramatic. Update to 17.0.21.1, 21.0.13.1, 25.0.5.1, or 27.0.1.1, depending on your line. If you cannot patch yet, the JVM flags -XX:-UseBASE64Intrinsics or -XX:UseAVX=2 turn the fast path off. Restart the service after patching. Then do the unglamorous part that actually matters: find every Java runtime you run, including the ones bundled inside other products. The Jenkins you forgot about in a corner. The Keycloak that came with something else. The build server that has not been touched in a year. Those are the ones that stay vulnerable, because nobody owns them.
Scanning started within a day of disclosure, and at least two security firms say they hold working exploits. The window between "researchers published" and "somebody weaponizes it" is not a grace period anymore. It is a race, and the people running it do not sleep.
What I would do this weekend
If you run Java anywhere, check three things in order. First, what Java version is actually running, on every box, including the ones you did not set up yourself. Second, what CPU it runs on, because AVX-512 VBMI is the gate. Third, whether anything internet-facing decodes untrusted Base64 before authentication, which is nearly everything with a login page, an upload form, or a token endpoint.
Then patch, restart, and move on. This is not a week-long project. It is an afternoon. The bug is fixed upstream, the workaround is one flag, and the only way to lose is to not look.
What stays with me is simpler than any of that. The most dangerous code in your stack is the code you trust the most. Not the dependency you vetted suspiciously. Not the new library with twelve stars. The Base64 decoder. The function you would never think to read. Somebody finally read it, and it had been wrong for almost four years.
Check yours.
Sources: Calif's Java4Shell writeup; Oracle and OpenJDK security advisories, November 17, 2026; The Hacker News; Wiz; VulnCheck's reproduction notes.
Top comments (0)