65 Characters to RCE: Inside the Java4Shell Vulnerability
Pierluigi Paganini
November 18, 2026
Calif disclosed Java4Shell, a critical OpenJDK Base64 bug enabling pre-auth RCE in Jenkins, Jira, Keycloak and more. Patches are out. Update now.
Calif researchers disclosed Java4Shell, a memory-corruption bug, tracked as CVE-2026-114938 (CVSS score of 9.2), in OpenJDK’s Base64 decoder. OpenJDK is the world’s most common Java runtime. OpenJDK (Open Java Development Kit) is the open-source implementation of the Java platform. It provides the tools and components needed to develop and run Java applications, including the Java Virtual Machine (JVM), libraries and development tools. It is widely used in enterprise systems, servers and cloud environments.
Base64 shows up everywhere: authentication, file uploads, network messages. To decode it fast, OpenJDK uses special x86-64 instructions that process many bytes at once, and the bug lives in that hand-written machine code. A single malformed string triggers it: 64 “A” characters followed by one equals sign, or 128 on older OpenJDK 17.
The flaw sits in how the decoder handles padding at the end of a Base64 string. When the trailing characters are “=”, “==” or similar, the code can compute a negative output length, and that underflow turns into a write of all 64 bytes instead of the few that should go out. For a 65-character trigger, OpenJDK allocates a 50-byte buffer and ends up writing 62 bytes past its end.
“At runtime, the decoded buffer length is calculated as (ceil(inp_len / 4) * 3) - padding. When the bug is triggered, with 65 bytes ([64 bytes] + '=') as input, that calculation allocates a 50-byte buffer. During decoding the bug makes output_mask == -1 for evmovdqub, so 64 bytes are written starting at offset 48, an out-of-bounds write past the end of the buffer.” reads the report published by Calif. “On OpenJDK 17, the trigger input is 'A' * 128 + '=' instead of 'A' * 64 + '=', because the length threshold to reach the code path is higher.”
Calif demonstrated that attackers could execute code remotely, without authentication, on Keycloak, Atlassian Jira, Atlassian Confluence, JFrog Artifactory, Jenkins and PingFederate, all using their default settings. Remote code execution was also possible after authentication on Apache Kafka Broker, Apache Solr, Elasticsearch, Gerrit and Spinnaker. Applications built with Struts and Spring Boot were also vulnerable. A client-side attack could even target a Java program simply by making it connect to a malicious server over TLS.
The attacker can initially control only where data is written, while most of the data itself is fixed. Calif bypassed this limitation using a technique often seen in browser attacks: corrupting the length of a nearby array so it can store attacker-controlled data. This turns a limited write operation into a much more powerful one. By applying the technique to another array, Calif also achieved the ability to read memory. This allows attackers to expose sensitive data from the Java process before executing code, a technique Calif calls JavaBleed.
Getting two objects to land next to each other in memory took real engineering. Calif used a timing trick over the network, holding back parts of an HTTP request until earlier data was acknowledged, so it could control when the server allocated memory. They even rented a VM in the same region as the target, because a stable, low-latency connection matters more than clever TCP tuning.
“For the current attack path to achieve optimal stability and reliability in exploitation, Calif turned to physics and utilized money to solve the problem, rather than experimenting with TCP/IP stack configuration.” continues the report. “In other words, Calif rented another VM in the same region as our target.”
An AI coding assistant found the bug. Researcher Quang Luong pointed OpenAI’s Codex at OpenJDK’s internals and told it to audit the JIT compiler, intrinsics and cryptography, and most early results were useless.
“It took our own Quang Luong an hour to discover the vulnerability, and two more hours to develop the first working exploit.” Calif states. “The total token cost was less than $200.”
Total AI cost: under $200, which buys you a serious headache for a lot of enterprise software.
There’s no universal exploit here. Every target needs its own delivery path, a writer, a reader and an application action, so a patch for one product doesn’t tell you about the next. Calif published a safe proof of concept that overwrites bytes inside a harmless array, and is holding back the weaponized chains until more systems are patched.
Java4Shell affects OpenJDK 17.0.6 and later, plus Oracle Java SE, Amazon Corretto, Eclipse Temurin, Microsoft Build of OpenJDK, Azul Zulu, BellSoft Liberica, SAP SapMachine and Red Hat OpenJDK. It also needs specific hardware: an x86-64 CPU with AVX-512 VBMI, found in Intel Xeon chips from Ice Lake onward and AMD Zen 4 or newer. ARM64 systems are safe from this one.
Oracle shipped a fix on 17 November as part of its November Critical Patch Update, which covers 655 vulnerabilities total. Update your Java runtime now. If you can’t patch immediately, start OpenJDK with -XX:-UseBASE64Intrinsics to disable the accelerated decoder, or -XX:UseAVX=2 on x86-64 hosts to turn off AVX-512, but treat both as a stopgap, not a fix.
Calif frames the bigger problem as one of unused complexity: features built for a few applications ship to everyone, and everyone inherits the risk.
“This is where AI can help to make that work practical at a scale we could not previously afford.
The same centaur hacker that discovered PHP2Shell and Java4Shell can comb a large codebase and flag dead code, bloated features, and needless optimizations. We call this vibe-uncoding: identify the parts a system actually needs, then remove everything else to reduce its attack surface.” the report concludes.
“With AI, everyone is asking, “What can we build?” But maybe the right question for security is, “What can we delete?””
Below is a demo video of the exploits running published by Calif:
Follow me on Twitter: @securityaffairs and Facebook and Mastodon
(SecurityAffairs – hacking, newsletter)
Click Here For The Original Source.
——————————————————–
