Java4Shell CVE-2026–114938: Reproducing the OpenJDK Base64 Memo
A malformed Base64 input to the HotSpot JVM's x86-64 Base64 intrinsic causes an output-length calculation to go negative, producing an incorrect AVX-512 store mask and a 62-byte out-of-bounds write before Java throws an exception. The public lab proves only the bounded out-of-bounds write, while researchers demonstrated application-specific remote code execution against products such as Keycloak.
Java returned to the security spotlight on November 17, 2026, when CVE-2026–114938 was disclosed. The vulnerability, now widely referred to as Java4Shell, is not an injection flaw like Log4Shell.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a tail handler in the native Base64 intrinsic computes output size as (remaining/4)*3 and subtracts one for padding, so a fragment containing only '=' yields -1, which the BZHI mask construction treats as all bits set and the vector store writes 64 bytes.
Impact
The lab demonstrates only a bounded 62-byte out-of-bounds write inside an allocated array; researchers demonstrated application-specific remote code execution against products such as Keycloak, but the public lab does not prove a shell, and native ARM64 or x86-64 hosts without AVX-512 VBMI do not enter the vulnerable path.
What the attacker needed
Affected JDK build; x86-64 CPU with AVX-512 VBMI and BMI2; Base64 intrinsic enabled; untrusted data reaches the decoder
The fix
The permanent remedy is to upgrade to a fixed vendor build and restart every JVM; disabling the Base64 intrinsic with -XX:-UseBASE64Intrinsics is a temporary mitigation, and the OpenJDK patch redirects a padded tail shorter than one complete block to the Java fallback.
How it was found
- Check the host exposes the required AVX-512 and BMI2 CPU flags.
- Clone the repository and check out the pinned snapshot.
- Run the preflight check to confirm architecture, flags and Docker.
- Run the verify target to build and start the vulnerable and mitigated services.
- Send the same malformed Base64 body to both the intrinsic-enabled and intrinsic-disabled endpoints.
- Compare the responses: the vulnerable service reports 62 bytes changed past the expected output, the mitigated one reports zero.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Java normally protects programs from writing outside the memory it has reserved for a value. In this bug, a fast native routine inside the Java virtual machine miscounts how much output a malformed Base64 string needs, so it writes past the end of the intended area. The program then reports an error, but the memory has already been changed.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.