· via dev.to (home feed)
Java4Shell: Critical OpenJDK Base64 decoder flaw enables pre-auth RCE in Java apps
A memory-corruption flaw in OpenJDK's hardware-accelerated Base64 decoder, disclosed as CVE-2026-114938, enables pre-auth remote code execution in widely deployed Java software. Patches and workarounds are available.
Critical flaw in OpenJDK's Base64 decoder
A memory-corruption vulnerability in the Base64 decoder that ships with OpenJDK can be turned into remote code execution, and it was disclosed on 17 November 2026 as CVE-2026-114938. According to a write-up on dev.to, Calif published the flaw with a CVSS 4.0 score of 9.2 out of 10, OpenJDK issued an advisory, and Oracle delivered patched builds in its November 2026 Critical Patch Update the same day at 21:00 UTC. The bug has been nicknamed Java4Shell.
Base64 deserves a moment here because Java applications lean on it constantly: authentication headers, session tokens, file uploads and message bodies. OpenJDK decodes it through an intrinsic — hand-tuned machine code the runtime substitutes for its generic Java loop when the processor offers faster instructions. On x86-64 chips with AVX-512 VBMI, that intrinsic handles 64 bytes per instruction, and that is where the defect sits.
How the overflow works
The flaw is in the code path that processes an input's final characters. When padding shows up where valid Base64 never places it, the routine computes a negative output length, converts it into a full 64-byte write, and for a 65-character input overruns a 50-byte result array by 62 bytes. The documented trigger is 64 "A" characters followed by "=", though the dev.to report notes that on OpenJDK 17 the same trigger needs 128 characters. The runtime does reject the malformed input and throw an exception — but only after neighbouring objects have been overwritten, which is why validation in the application changes nothing: the corruption happens inside the decoder, before application code ever sees the data.
Exploitation is described as deliberate work rather than a one-liner. The overwritten bytes are mostly fixed values, but the attacker controls where the write lands. Calif's chain begins by grooming the heap so the overflow lands in an adjacent array and enlarges it, then reads heap memory and writes chosen bytes. Each target needed its own chain, and Calif reportedly reached a first working local exploit in about three hours with AI agents assisting — a useful yardstick for how quickly copycat chains may appear now that the technical detail is public.
Which systems are exposed
Three conditions must all hold, per the write-up. The runtime must be OpenJDK 17.0.6 or newer, including distributions built from it: Amazon Corretto, Eclipse Temurin, Azul Zulu, BellSoft Liberica, Microsoft Build of OpenJDK, Red Hat OpenJDK, SAP SapMachine, plus Oracle's OpenJDK, Java SE and GraalVM for JDK builds. The processor must be x86-64 with AVX-512 VBMI, which covers Intel Xeon from Ice Lake onward and AMD EPYC or Ryzen from Zen 4 onward; Calif states that ARM64 CPUs are not affected. And the application must decode attacker-controlled Base64 with the standard Java decoder — something authentication and file uploads routinely do.
Demonstrated targets
Calif published two lists, and the split matters for triage. Pre-authentication remote code execution was demonstrated in default configurations of Keycloak, Atlassian Jira, Atlassian Confluence, JFrog Artifactory, Jenkins and PingFederate. Post-authentication execution was demonstrated against Apache Kafka Broker, Apache Solr, Elasticsearch, Gerrit and Spinnaker. Sample applications built on Apache Struts and Spring Boot were also compromised, and the researchers call both lists non-exhaustive.
One detail matters for teams that think of themselves as clients: a Java program that opens a TLS connection to a malicious server can be compromised even when it exposes no service of its own, because decoding happens on whatever the server sends back. Outbound-only integrations, batch clients and command-line tools therefore belong in the same inventory as public-facing applications.
Mitigations: WAF rules and JVM flags
Cloudflare added six rules to its Managed Ruleset, identified as efb7b8c949ac4650a09736fc376e9aee, covering malformed Base64 in a header, a query value, a body value, a path segment, a Base64url JWT component and a WebAuthn value. They ship enabled with the Log action on Pro, Business and Enterprise plans, because malformed payloads can resemble legitimate token formats; the documented path is to review matches in Security Analytics and then switch the action to Block. The limits matter just as much: a WAF only inspects HTTP requests that pass through it. Payloads the application decodes or decompresses itself, Kafka's own protocol, traffic between internal services and outbound TLS responses all reach the decoder unexamined.
For teams that cannot patch immediately, Calif documents two JVM startup options: -XX:-UseBASE64Intrinsics, which turns off the hardware-accelerated Base64 encoder and decoder, and -XX:UseAVX=2. Both, per the write-up, remove the accelerated path as a stopgap.
Why it matters
Memory safety is part of Java's core pitch: the runtime handles allocation, enforces bounds checks, and shields developers from the bug class behind decades of C exploits. Java4Shell arrived through the one layer where that promise has never applied — machine code swapped in for the runtime's generic implementation when a processor offers a faster instruction. The practical consequence is that patching runtimes, not application code, is the response, and the durable fix is unglamorous: cataloguing every Java runtime across the estate, because bundled runtimes, container images and live JVMs each ship their own copy of the decoder. With technical detail public, pre-auth chains already demonstrated against default configurations of widely deployed products, and fixes shipping, updating those runtimes outranks WAF tuning.
- #java
- #openjdk
- #security
- #vulnerability
- #rce