Skip to content
OriginalSecurity

Java4Shell: 65 characters of Base64 can take over a Java server

A memory bug in OpenJDK's hardware-accelerated Base64 decoder turns 65 characters into unauthenticated remote code execution on Java 17 and newer. Patches shipped November 17 — the race is who installs them first.

A Byzantine-style mosaic wall in gold, lapis blue, terracotta and ivory: a regular diamond pattern of small tiles, with one large dark tile set wrong near the lower right and the rows around it askew
One tile set wrong, and the pattern loses its place — what a single malformed character does to a carefully ordered decoder.
On this page

In brief

  • A malformed Base64 tail — 64 A's plus one '=' — makes OpenJDK's AVX-512 decoder write 62 bytes past a 50-byte buffer.
  • Calif demonstrated unauthenticated remote code execution in default setups of Keycloak, Jira, Confluence, Artifactory, Jenkins, and PingFederate.
  • Only OpenJDK 17.0.6 and newer on x86-64 CPUs with AVX-512 VBMI are affected; ARM64 and standard Java 8 and 11 are not.
  • Oracle shipped fixed builds November 17 — 17.0.21.1, 21.0.13.1, 25.0.5.1, 27.0.1.1 — and a JVM flag disables the vulnerable path.
  • No exploitation in the wild had been reported as of November 18, and the flaw is not in CISA's Known Exploited Vulnerabilities catalog.

Sixty-five characters. That is all it takes: 64 capital A's, followed by a single =. Feed that string to the Base64 decoder in an affected Java runtime and the decoder writes 62 bytes past the end of its buffer — into memory it does not own. From there, the researchers who found the flaw say, an attacker can work up to remote code execution without logging in.

The flaw is Java4Shell, CVE-2026-114938, disclosed on November 17 by the security firm Calif. The same day, Oracle shipped patched Java builds and the U.S. Cybersecurity and Infrastructure Security Agency issued an alert strongly urging organizations to patch immediately. As of November 18, no exploitation in the wild had been reported, and the flaw had not been added to CISA's Known Exploited Vulnerabilities catalog.

A memory bug in the safest language

Java's pitch has always been memory safety: the language manages memory for you and checks every access, so the buffer overflows that plague C and C++ cannot happen in Java code. That pitch is true about Java code. It says nothing about the code underneath it, much of which is written in C, C++, and — in this case — hand-written assembly. To decode Base64 faster, OpenJDK's HotSpot virtual machine uses specialized AVX-512 VBMI instructions on supported x86-64 processors, processing many bytes at once instead of one at a time. The bug lives in that optimized routine, in the code that handles the final few characters of the input.

Base64 encodes binary data as text, in groups of four characters that decode to three bytes, with a = at the end as padding for an incomplete final group. Calif's write-up traces the failure to the padding math: for an input of 64 A's plus one =, the decoder computes a negative output length, which underflows into a full 64-byte write mask. OpenJDK allocates a 50-byte result array for that input; the routine writes 64 bytes starting at offset 48, sending 62 bytes past the end. Java eventually rejects the malformed input and throws an exception — but by then, neighboring objects in the heap may already be corrupted.

What Calif demonstrated

Calif did not stop at crashing the JVM. Its write-up says the team demonstrated remote code execution, in default configurations, against six deployed applications without authentication: Keycloak, Atlassian Jira, Atlassian Confluence, JFrog Artifactory, Jenkins, and PingFederate. With a login, the list grows: Apache Kafka Broker, Apache Solr, Elasticsearch, Gerrit, and Spinnaker. The team also reports working exploits against sample applications built on Apache Struts and Spring Boot.

The lists are Calif's own demonstrations, not observed attacks, and the firm says they are non-exhaustive. Ordinary features such as authentication and file uploads can expose the vulnerable decoder, because Base64 shows up everywhere: login tokens, encoded file uploads, network messages.

Calif's write-up is candid about the difficulty: the initial corruption writes mostly fixed bytes, and only the landing position is controllable. The team built its chain in stages — corrupting one array's length to create a "writer" that accepts chosen bytes, then a "reader" that leaks heap contents back in the response, a technique it calls JavaBleed. Each target needs its own profile: a decoder route, a live writer, a feedback path, a heap layout, and an application action. There is no universal point-and-shoot exploit, and the attack is sensitive to network conditions.

Calif is holding back the application-specific exploits for now, saying it will publish them later, after everyone has had a chance to upgrade. It did publish a self-contained proof of concept that only triggers the bug inside a real 4096-byte array — safe to run, and it prints REPRODUCED on an affected JDK.

Who is affected, and how to tell

The scope is wide but specific. Java4Shell affects OpenJDK builds from 17.0.6 onward, including the 21, 25, and 27 lines, and every distribution built from OpenJDK — Corretto, Temurin, Microsoft's build, Zulu, Liberica, SapMachine, Red Hat OpenJDK, Oracle Java SE, and GraalVM for JDK. Oracle's list also includes its Java 8 Enterprise Performance Pack build, 8u511b33-perf. Standard Java 8 and 11 are not affected.

But the version is only half the test. The vulnerable code runs only on x86-64 processors with AVX-512 VBMI support — Intel Xeon from Ice Lake through Granite Rapids, and AMD EPYC and Ryzen from Zen 4 onward. ARM64 systems are not affected at all. On Linux, Calif gives a one-line check: look for the avx512f, avx512bw, avx512vbmi, and bmi2 flags in /proc/cpuinfo. All four must be present.

That hardware condition is the good news: much of the Java fleet is simply not exposed.

Calif rates the flaw 9.2 under CVSS 4.0, critical; Oracle rates it 8.1 under CVSS 3.1, high, with high attack complexity. The scores differ on how much weight to give the difficulty of exploiting it.

The patch race

Oracle released fixed builds on November 17 as part of its November Critical Patch Update: 17.0.21.1, 21.0.13.1, 25.0.5.1, 27.0.1.1, and 8u513-perf for the Java 8 Performance Pack. Amazon Corretto shipped fixed builds the same day. Other distributions release on their own schedules — some fixed builds were still rolling out on November 18 — so check your vendor's advisory rather than assuming a build number from another distribution applies to yours.

If patching cannot happen immediately, there is a clean mitigation: starting the JVM with -XX:-UseBASE64Intrinsics disables the hardware-accelerated Base64 path entirely, and -XX:UseAVX=2 disables AVX-512 (x86-64 only — OpenJDK on ARM does not recognize it and will fail to start).

That hidden-runtime problem is the real operational headache. Java4Shell is a flaw in the runtime, not in a library, so dependency scanners that read application packages will not find it. The fix is a new Java runtime and a restart of every service that uses it, including the ones whose Java you never installed yourself.

Found in three hours, for under $200

The discovery story is almost as notable as the bug. Calif researcher Quang Luong says he audited OpenJDK's HotSpot with help from OpenAI's Codex, directing it at the JIT compiler, intrinsics, widely used APIs, and cryptography. It took about an hour to find the flaw and two more hours to build the first working exploit, for less than $200 in tokens.

Calif calls the combination the "centaur hacker" — AI brings the horsepower, the researcher brings the context. This is the firm's second runtime bug in short order; its earlier find, PHP2Shell, was a memory flaw in PHP's runtime discovered the same way.

The firm draws a broader lesson from both finds. The AVX-512 Base64 optimization helps applications that decode enormous amounts of data, but the code ships to everyone, including applications that decode a few hundred bytes and gain nothing from it. Calif calls the remedy "vibe-uncoding": use AI to find the parts of a system that are actually needed, and remove everything else to shrink the attack surface.

The short-term question is simpler and has a deadline measured in days: the proof of concept is public, the vulnerable versions are known, and the patch exists. Update the runtime, check the CPU flags where you cannot, and assume the systems you forgot about matter most.

More from grep.tips

All articles