Skip to content
Phạm Nam

Search

Type a keyword to search the posts.

Go back
en

Java4Shell CVE-2026-114938: Pre-auth RCE in OpenJDK's Base64 — Check and Patch Now

Java4Shell CVE-2026-114938: a pre-auth RCE flaw in OpenJDK Base64 decoder, CVSS 9.2. How to check your CPU and Java version and patch to a fixed build.

10 min read—

Java4Shell CVE-2026-114938: Pre-auth RCE in OpenJDK’s Base64 — Check and Patch Now

On 17/11/2026, research firm Calif disclosed Java4Shell (CVE-2026-114938), a memory corruption flaw in OpenJDK’s Base64 decoder. The same day, Oracle and OpenJDK released patches, and CISA issued an alert urging immediate patching.

What makes this flaw unusual: it is not in a library or an application, but in the JVM itself — the thing that runs almost every enterprise Java program. And the person who found it, according to Calif, took about one hour with the help of an AI coding agent.

30-second summary: running OpenJDK 17.0.6 or later (or 21, 25, 27) on an x86-64 CPU with AVX-512 VBMI means you may be affected by Java4Shell. Patch to Oracle 17.0.21.1 / 21.0.13.1 / 25.0.5.1 / 27.0.1.1, or the equivalent patched build from your vendor, then restart every JVM. If you cannot patch yet, disable the vulnerable code path with -XX:-UseBASE64Intrinsics. As of 18/11/2026, there are no reports of exploitation in the wild, and the CVE is not in CISA KEV.

What is Java4Shell

Java4Shell, CVE-2026-114938, is a heap out-of-bounds write in the hardware-accelerated Base64 decoder of the HotSpot JVM on x86-64.

Base64 is a common way to represent binary data as text. It shows up in authentication (tokens, Basic Auth), file uploads, and messages sent over the network. To decode fast, OpenJDK uses the CPU’s AVX-512 VBMI instructions to process many bytes at once. The flaw is in that hand-written assembly: when handling the padded tail, it computes the write mask wrong, the output length overflows into a negative number, and a 64-byte write runs past the end of the destination buffer.

The trigger string, according to Calif, is just 64 A characters followed by one =:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=

On older OpenJDK 17, the trigger string is 128 A characters followed by =. With a 65-character input, OpenJDK allocates a 50-byte buffer, but the write runs to 64 bytes, overflowing by 62 bytes. Java eventually rejects the bad input, but by then the adjacent memory may already have been overwritten.

Calif calls the next step JavaBleed: from the overflow write, they built a heap read capability (which can leak PII, private keys and tokens), then escalated to remote code execution. The researchers state clearly there is no single exploit for every application — each application needs its own exploit chain, because how Base64 is used and how the heap is laid out differ.

Severity scores differ by source:

SourceScoreNote
Oracle / OpenJDK (CVSS 3.1)8.1 HighAV:N/AC:H/PR:N/UI:N
Calif (CVSS 4.0)9.2 Critical
Red Hat (preliminary, CVSS 3.0)9.8 Critical
NVDNot yet scoredAs of 18/11/2026

Oracle notes in the CVE record that the flaw is hard to exploit (AC:H), but needs no login (PR:N). Calif scores it higher because they demonstrated successful RCE on real applications.

Who is affected: all 3 conditions must be true

Not every machine running Java is affected. A system is only considered at risk when all 3 conditions are true at the same time — this is how the Keycloak team described it on 18/11, and it is the clearest way to check:

  1. Java version: OpenJDK 17.0.6 or later, or the 21, 25, 27 lines unpatched (up to 17.0.21.0.3 / 21.0.13.0.3 / 25.0.5.0.3 / 27.0.1.0.3). Java 8 and standard Java 11 are not affected by this CVE. The only exception is Oracle Java SE 8u511b33-perf.
  2. CPU: x86-64 with all 4 flags avx512f, avx512bw, avx512vbmi, bmi2. Intel Xeon Ice Lake, Sapphire Rapids, Emerald Rapids, Granite Rapids; AMD Zen 4 and later. ARM64 is not affected.
  3. JVM: running the Base64 intrinsics, not limited down to AVX2.

Java lines 18–20, 22–24 and 26 are out of support and will not receive a patch for this CVE. If you still run those lines, the only option is to move to a patched LTS release.

Every distribution built from OpenJDK inherits this code: Oracle Java SE, Amazon Corretto, Eclipse Temurin, Microsoft Build of OpenJDK, Azul Zulu, BellSoft Liberica, SAP SapMachine, Red Hat build of OpenJDK. But “same image, different CPU” can give different results: the same Keycloak 26.8.2 image can be safe on a machine without AVX-512 VBMI, and exposed on a machine with it. So do not just look at the image tag — check the CPU and the live JVM flags (see the check section below).

Which applications have been demoed with RCE

Calif says the list is not complete, but they demonstrated successful RCE on the default configuration of these applications:

Pre-auth RCE — no login needed:

  • Keycloak
  • Atlassian Jira
  • Atlassian Confluence
  • JFrog Artifactory
  • Jenkins
  • PingFederate

Post-auth RCE — login needed:

  • Apache Kafka Broker
  • Apache Solr
  • Elasticsearch
  • Gerrit
  • Netflix Spinnaker

The team also demonstrated it on sample applications using Apache Struts and Spring Boot. And there is another direction: client-side. A Java program that opens a TLS connection to a malicious server can also be compromised, even though it exposes no service of its own.

Why can a Base64 flaw reach pre-auth RCE? Because these applications decode Base64 from unauthenticated input: login tokens, the Authorization header, file uploads. Login does not protect you, because the vulnerable code runs before the application gets a chance to check permissions.

Note: these are the research team’s lab demos, not attacks observed in the wild. As of 18/11/2026, there are no reports of exploitation in the wild, and the CVE is not in CISA KEV. GreyNoise recorded 69 Java4Shell-shaped requests from 4 IPs since 17/11, but no successful intrusion into their sensors. Calif published a crash-causing PoC, but withheld the weaponized exploit chain per product. VulnCheck says it has a full exploit for customers, and Upwind says it reproduced RCE itself — both are claims not yet verified independently.

Found with Codex in about an hour

The story of how this flaw was found is as notable as the flaw itself.

Researcher Quang Luong of Calif used OpenAI Codex to audit HotSpot, focusing on the JIT compiler, intrinsics, common APIs and crypto code. He directed Codex to review those areas like a real security researcher would. The first results Codex returned were mostly false positives — unreachable or not exploitable. After more precise prompting, Codex pointed out the memory corruption flaw in the Base64 decoder itself.

According to Calif: about 1 hour to find it, 2 more hours for the first exploit, total token cost under 200 USD. Jenish Rakholiya improved the exploit, and AI agents then built near-automatically the exploit chains for each product, based on the pipeline and strategy the team had prepared in advance.

The New York Times says the model behind Codex in this run was GPT-6 Cyber. Calif only names Codex, not the model name, so this article records it that way and treats the model name as not independently verified.

However you look at it, this is the second time in a short period that Calif used AI to find a serious flaw — the previous one was PHP2Shell. And it is also a reminder: AI did not find the flaw on its own. Luong chose the audit direction, filtered out false positives, and decided to dig into Base64. Calif calls that a “centaur hacker”: half human, half AI.

How to check whether you are affected

1. Check the Java version

Run on every machine, every container, every base image — including Java bundled inside third-party applications, because it may not appear separately in your software inventory:

java -version

Compare with the table: 17.0.6–17.0.21.0.3, 21–21.0.13.0.3, 25–25.0.5.0.3, 27–27.0.1.0.3 are affected. Standard Java 8 and 11 are not.

Inside a container, do not trust the outer tag. Check the JDK inside the image:

docker run --rm <image> java -version

2. Check whether the CPU has AVX-512 VBMI

On Linux:

grep -m1 '^flags' /proc/cpuinfo | grep -qw avx512vbmi \
  && echo 'AVX-512 VBMI available'

All 4 flags avx512f, avx512bw, avx512vbmi, bmi2 are needed. On a virtual machine, these flags depend on whether the host exposes them to the VM.

3. Check the flags of the running JVM

The Keycloak team documents how to check the live JVM flags. The general way for any running JVM:

jcmd <pid> VM.flags | grep -i -E 'UseBASE64Intrinsics|UseAVX'

If UseBASE64Intrinsics is on and the JVM is not limited to AVX2, together with the 2 conditions above, the system is considered at risk.

How to patch

Oracle patches

Oracle released patches on 17/11/2026 in the November 2026 Critical Security Patch Update (655 flaws across all Oracle products, of which 11 are Java SE):

Java linePatched build
1717.0.21.1
2121.0.13.1
2525.0.5.1
2727.0.1.1
8 (perf)8u513

Only Oracle builds with the .1 suffix are patched builds.

Patches per vendor (status as of the evening of 18/11/2026)

Vendors released patches at different speeds, and the status changed several times during 18/11. The table below is the latest status I could verify; before patching, check your vendor’s page directly:

VendorPatched build
Amazon Corretto17.0.21.1.2, 21.0.13.1.2, 25.0.5.1.2, 27.0.1.1.4 (17/11)
Azul Zulu17.0.21.1+2, 21.0.13.1+2, 25.0.5.1+2, 27.0.1.1+4
Eclipse Temurin17.0.21.1+2, 21.0.13.1+2, 25.0.5.1+2, 27.0.1.1+4 (released gradually during 18/11)
Microsoft Build of OpenJDK17.0.21.1, 21.0.13.1, 25.0.5.1 (afternoon 18/11)
Red Hat build of OpenJDKPortable 17.0.21.1, 21.0.13.1, 25.0.5.1; RHEL RPMs started arriving the evening of 18/11, many combos still waiting
SAP SapMachine17.0.21.1, 21.0.13.1, 25.0.5.1, 27.0.1.1
DebianPatched packages only in unstable (sid); bookworm/trixie still vulnerable
UbuntuAll openjdk packages “Needs evaluation”

A note on Docker images: Corretto on Docker Hub keeps the same version tag, so you must pull the image again to get the patch. With Temurin, the official image only updates once every binary for that version is out, so confirm the tag before redeploying.

Patching process

  1. Prioritize Internet-facing systems first: Keycloak, Jira, Confluence, Jenkins, Artifactory, PingFederate.
  2. Upgrade the JDK to a patched build, restart every JVM and container. Upgrading without restarting leaves the old process running the old code.
  3. Rebuild container images on a patched base image, redeploy.
  4. Verify again with java -version and jcmd <pid> VM.flags.
  5. Watch for unusual JVM crashes, strange runtimes, suspicious Java processes — these are the signs CISA recommends monitoring.

If you cannot patch yet: temporary mitigations

If your vendor has not released a patch yet, or you cannot restart the system right away, there are 3 layers of mitigation:

1. Disable the vulnerable code path with a JVM flag:

java -XX:-UseBASE64Intrinsics -jar app.jar

This flag disables exactly the broken Base64 intrinsic. Some sources say you also need -XX:+UnlockDiagnosticVMOptions before this flag if the JVM refuses it — I have not verified that point myself, so try it in a test environment first.

2. Limit the JVM to AVX2:

java -XX:UseAVX=2 -jar app.jar

Only works on x86-64. A JVM on ARM will not start with this flag. Microsoft notes that a JVM using only the C1 compiler is not exposed, but do not rely on that instead of patching.

3. Tighten at the application boundary (per CISA):

  • Validate and limit the size of Base64 input at the application boundary.
  • Limit unauthenticated access to endpoints that decode Base64.
  • Cloudflare released 6 managed WAF rules for Java4Shell (paid plan, log-only by default, 18/11) — enable them in log mode first, watch, then block.

Mitigation is temporary. It does not replace the patch, and it should be removed or reviewed after patching, so a temporary flag does not stay in your operational configuration.

After patching: verify again

  • java -version returns the patched build on every machine, every container.
  • jcmd <pid> VM.flags confirms the temporary mitigation flag has been removed (if you enabled one before).
  • Checking the CPU again: the machine still having AVX-512 VBMI is normal, because the flaw is fixed in code — there is no need to disable the CPU feature.
  • Watch JVM crash logs for 24–48 hours after patching, and review the JDK inventory again — especially Java bundled in third-party applications, old container images, and appliances.

Limitations of this article

This article is an advisory analysis + patching guide, based on the Calif write-up, the CISA alert of 17/11, and guidance from Adoptium, Red Hat and Keycloak. I have not set up a vulnerable JVM lab, run a PoC, or tested a patch on a specific distro, so there are no hands-on results in this article — and I will not invent any.

Vendor patch status changed by the hour on 18/11 (Temurin, Microsoft and Red Hat all changed status within one day). The vendor table above is the status as of the evening of 18/11/2026. Before patching, check the vendor page directly. The original OpenJDK advisory page returned 403 when I opened it directly on 19/11, so that part relies on quotations from other sources. NVD has not scored the CVSS yet, and the CVE is not in CISA KEV as of 18/11 — both may change in the next few days.

References


Bình luận

Bình luận được duyệt trước khi hiển thị.

Đang tải bình luận…

Để lại bình luận