Java4Shell: Reproducing the Overflow and What It Means for Databases
We reproduced the Java4Shell (CVE-2026-114938) overflow on vulnerable hardware, tested the mitigation, and mapped the Java-based databases and data tools to check.

Key Takeaways
- Java4Shell affects OpenJDK 17, 21, 25, and 27 on CPUs with AVX-512 VBMI, causing a heap buffer overflow in Base64 decoding.
- Varonis reproduced the exact overflow and confirmed the JVM flag -XX:-UseBASE64Intrinsics fully eliminates it as a stopgap mitigation.
- Since the bug lives in the JVM, any Java-based database or tool that decodes Base64, including Elasticsearch and Jira, may be exposed.
A new Java vulnerability nicknamed Java4Shell started making the rounds last week. Whether you're exposed depends on two things: your Java version and your CPU. If you run OpenJDK 17, 21, 25, or 27 on a processor that supports AVX-512 VBMI, you probably want to read this.
The short version: a bug in how OpenJDK decodes Base64 on those chips can corrupt memory, and several widely used enterprise products, including Keycloak, Jira, and Confluence, are exposed to it before authentication. Much of the early coverage has focused on those application servers. We also looked at a largely overlooked aspect: what Java4Shell means for Java-based databases.
It was important not to simply repeat what had already been published. We wanted to see it with our own eyes, on real hardware, and understand exactly what is (and isn’t) true about the risk. So we spun up a test VM with the exact CPU generation this bug needs, installed the vulnerable JDK build, and reproduced the overflow ourselves. Let’s walk through the findings.
What’s actually broken
OpenJDK has a fast path for decoding Base64 strings that uses AVX-512 VBMI instructions, a set of vector instructions available on recent Intel (Ice Lake and newer) and some AMD chips (Zen 4 and newer). This fast path was added as a performance optimization, decoding Base64 using raw SIMD instructions instead of doing it byte-by-byte in a loop.
The problem is how that fast path computes the size of its output write mask. When the decoder receives malformed input — specifically, input with bad or incomplete padding at the end, such as a stray = sign — the internal length calculation underflows. Instead of computing a small, correct mask, it computes essentially “write everything,” which on a wide-vector instruction means writing a full 64-byte block regardless of how much output was supposed to be produced there.
In practice, that means: give the decoder a string like 64 (or 128 on JDK 17) A characters followed by a single stray =, and instead of writing the ~48 or ~96 bytes it’s supposed to write, it writes 64 bytes past the end of the buffer it allocated. That’s a classic heap buffer overflow, triggered through a code path nobody expected to be reached by an attacker: a plain old Base64 decode call.
Researchers at Calif have published write-ups describing a full exploitation chain built on top of this primitive, involving heap grooming to control what sits next to the overflow, a memory disclosure trick (some are calling it “JavaBleed”) to read adjacent heap content, and ultimately remote code execution against specific application targets. It’s a serious, carefully engineered attack chain, and it is why this bug has a near-maximum CVSS score for the pre-auth cases.
What we reproduced — and what we didn’t
We provisioned a cloud VM on hardware that actually supports the AVX-512 VBMI instruction set (confirmed via proc/cpuinfo: avx512f, avx512bw, avx512vbmi, bmi2), installed the latest vulnerable Temurin 17 build, and installed a clean pre-vulnerability build alongside it for comparison. Then we ran the published, safe trigger input — the malformed Base64 string, nothing fancier than that — against both builds and watched what happened in memory.
On the clean build, decoding the malformed input correctly produces 96 bytes and nothing else. We filled the output buffer with a sentinel byte pattern beforehand, and after the decode call, everything past byte 96 was still untouched sentinel. Exactly what you’d expect from working code.
On the vulnerable build, with the same input and buffer setup, the decoder wrote real decoded data 64 bytes past where it should have stopped. We can show this byte-for-byte: positions 96 through 159 in the output buffer, which should have stayed as our sentinel value, instead contain genuine decoded output bytes. Position 160 onward is untouched. That’s a precise, repeatable 64-byte out-of-bounds write that lines up exactly with the root cause described in the public write-ups.
.png)
We also tested the documented mitigation, the JVM flag -XX:-UseBASE64Intrinsics, which turns off the Base64 intrinsic and falls back to the plain Java implementation. With that flag set, the vulnerable build behaves exactly like the clean one. Overflow gone. That’s a useful, low-friction stopgap for anyone who can’t patch immediately.
What we deliberately did not do: build the heap grooming, memory disclosure, or remote code execution stages described in the public research. Those steps require carefully shaping the heap layout and leaking live process memory, and turning that into a working exploit against a brand-new, still-being-patched CVE isn’t something we’re going to publish instructions for.
Our goal here was to verify that the bug is real, that it’s exactly as described, and that the mitigation actually works, not to hand anyone a working exploit.
Why this matters even without a working RCE in hand
Java4Shell matters because the vulnerable code path, Base64 decoding, is everywhere. It’s used in HTTP header parsing, JWT handling, Basic Auth, SAML assertions, and a dozen other places that process attacker-controlled input before any authentication happens.
A memory corruption bug in that code path, on hardware common in cloud data centers, is worth patching even if some downstream applications turn out not to be exploitable for full RCE.
What about databases?
Since the bug is in the JVM and not in any one product, any Java-based database may be exposed, depending on whether attacker-controlled Base64 reaches the vulnerable path. Elasticsearch and Solr are on the list below, and Cassandra, Neo4j, HBase, and embedded databases like H2, HSQLDB, and Derby are in the same position. They all decode Base64 somewhere, whether it's auth headers, tokens, or client requests.
Oracle is a different story, and we want to be clear about it. Java4Shell does not hit the Oracle database engine. The problem is the JVM — not Oracle's DBMS code. Where Oracle shops can get caught is in the Java tooling around the database, such as SQL Developer, WebLogic, or Enterprise Manager. If one of those runs on an affected JDK, on a CPU with AVX-512 VBMI, it's exposed. The fix is the same: update to a fixed JDK build (or apply the -XX:-UseBASE64Intrinsics mitigation until you can).
If you run databases, start with an inventory: which of them, and which of their tools, run on Java, which JDK build each one uses, and whether the host has AVX-512 VBMI.
What you can do about it
If you're running OpenJDK 17.0.6 and up, 21, 25, or 27 on x86-64 hardware with AVX-512 VBMI (most recent server CPUs), check your exposure. Install the fixed build for your distribution.
The fixed Oracle builds are:
17.0.21.121.0.13.125.0.5.127.0.1.1
Fixed builds end in .1, and the same version number without the suffix is still vulnerable. A matching version number does not mean you're patched. For example, the 17.0.21 build that we tested was vulnerable.
If you can’t patch or restart right away, set -XX:-UseBASE64Intrinsics as a stopgap. In our test, it eliminated the overflow.
If you want to rule things out quickly: ARM64 machines (Apple Silicon and AWS Graviton, for example), x86 machines without AVX-512 VBMI, Java 11, and standard OpenJDK 8 are not affected. The bug needs both the affected JDK and the matching CPU feature.
Pay particular attention if you run Keycloak, Jira, Confluence, Artifactory, Jenkins, or PingFederate, since those are the products called out as exposed pre-authentication. Post-auth exposure has also been flagged for Kafka, Solr, Elasticsearch, Gerrit, and Spinnaker.



