[CVE-2026–114938] Java4Shell Deep Dive -How a Single ‘=’ Turns Into a 64-Byte Heap Overflow
A hand-written AVX-512 assembly routine in OpenJDK's Base64 decoder miscalculates the output size for a short padded tail, underflowing it to -1, which the mask-building instruction reads as 255 and turns a zero-byte write into a full 64-byte out-of-bounds write. On its own this corrupts the adjacent heap object and typically crashes the JVM, and the disclosing firm claims to have built product-specific pre-authentication remote code execution on top of it.
Published on medium.com
On November 17, 2026, security firm Calif disclosed a memory-corruption vulnerability in OpenJDK’s Base64 decoder that can escalate to pre-authentication remote code execution. It’s called Java4Shell, tracked as CVE-2026–114938.
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.
On November 17, 2026, security firm Calif disclosed a memory-corruption vulnerability in OpenJDK's Base64 decoder that can escalate to pre-authentication remote code execution. It is called Java4Shell, tracked as CVE-2026-114938. CISA issued a same-day alert urging immediate patching.
This post walks through why a single trailing = character turns into a 64-byte out-of-bounds write, building up from the Base64 and AVX-512 basics you need.
TL;DR
- Root cause: HotSpot's hand-written AVX-512 VBMI assembly stub for
java.util.Base64decoding miscalculates the output size for a short padded tail, underflowing it to-1. That-1gets read as255by thebzhiqinstruction, which turns the "write 0 bytes" mask into "write all 64 bytes", spilling into the next heap object. - Affected: OpenJDK 17.0.6+ and the 18 to 27 line on unpatched builds, only on x86-64 CPUs with AVX-512 VBMI (Intel Ice Lake+, AMD Zen 4+)
- Severity: CVSS 4.0 9.2 (Calif), CVSS 3.1 8.1 (Oracle, high attack complexity)
- CWE: Not yet assigned. Closest fit is an integer underflow (CWE-191) leading to an out-of-bounds write (CWE-787).
- Fix: JDK-8393212, committed under embargo on Oct 14 as the deliberately bland "Base64 optimization improvements," released Nov 17.
- Status: No in-the-wild exploitation reported as of Nov 17. RCE has only been demonstrated by Calif in specific products; no weaponized chain is public.

Context: Base64 padding, intrinsics and masked stores
Base64 turns 3 bytes into 4 characters. When the input is not a multiple of 3 bytes, = padding is appended so the total length is always a multiple of 4.

The required output size is:
output bytes = (char count ÷ 4) × 3 − padding count
The key fact: valid Base64 is always a multiple of 4 characters long. This bug's trigger is a length that is not a multiple of 4 but still ends in =, an input that should be rejected outright. The problem is it gets rejected after the vulnerable write already happened.
Intrinsics: hot methods get replaced with hand-tuned assembly
java.util.Base64.Decoder.decode0() calls decodeBlock() internally. Once that method gets hot enough, HotSpot's C2 compiler swaps out the Java bytecode for a hand-written assembly stub, an intrinsic. Any server that decodes Base64 continuously (auth headers, JWTs, file uploads) will hit this state quickly.
The stub is only generated on CPUs with both AVX-512 VBMI and BW support. Otherwise the slower-but-safe scalar Java path is used. The MIME decoder always uses the scalar path, regardless of CPU.
AVX-512: 64 bytes at a time
AVX-512 registers are 512 bits, 64 bytes. The stub decodes input 64 characters at a time.
Masked stores: a stencil with only some holes punched
When writing results to memory, the stub provides a 64-bit mask alongside the data. Only bytes where the mask bit is 1 get written; bytes where it is 0 are left untouched, like a stencil where only some holes are cut.
The mask is built from "number of bytes to write" via bzhiq, which keeps the low N bits and zeroes the rest. Critically, bzhiq only reads the low 8 bits of its index, and if that value is 64 or higher, nothing gets cleared at all.

That last row is the entire bug.
Setup: what has to be true for the vulnerable path to run
Several conditions have to line up to actually reach the vulnerable tail logic:
- Length threshold: the vector path only engages above a certain length.
- 17u: above 128 characters. For a
=-terminated 1 to 3 char tail, valid lengths are64k+1to64k+3(k ≥ 2), i.e. 129 to 131, 193 to 195, 257 to 259 and so on. - 21 / 25 / 27: threshold is 31 bytes, so 65 characters (one full 64-char block plus a short padded tail) is enough.
- 17u: above 128 characters. For a
- Decoder type: Basic or URL decoder only. MIME always takes the scalar path.
- Valid characters: any
=or invalid character inside a 64-char chunk bails out to the Java path early, so every character before the tail must be valid Base64. - Warm-up: the stub must already be JIT-compiled.
Because valid encoders never produce lengths like these, this input pattern simply does not show up in normal traffic. Unpadded Base64 (like JWT segments) does not end in = either, so it is distinguishable from that too.
Finding it: the vulnerable flow
Per public write-ups, the chain looks like this:
java.util.Base64$Decoder.decode0()callsdecodeBlock()- Once hot, C2 swaps in the HotSpot-generated stub (
generate_base64_decodeBlockinstubGenerator_x86_64.cpp) - Entry gate:
avx512_vbmi && avx512bw, plusUseAVX=3andUseBASE64Intrinsics=true(both defaults on qualifying CPUs) - Input is processed in 256-char, then 64-char chunks
- The remaining 1 to 63 character tail is handled at label
L_finalBit, finishing with a masked store
Step 5 is where it breaks. Below is a reconstructed pseudocode for understanding the flow, not literal assembly; exact registers and ordering vary by build.
// The 64-char-chunk passes are done; a 1–3 char tail (including "=") remainsint out_size = (tail_len / 4) * 3; // tail < 4 chars, so this is 0out_size -= padding_count; // subtract '=' count → 0 - 1 = -1 (underflow)uint64_t mask = bzhi(~0ULL, out_size & 0xFF); // only low 8 bits used: -1 → 255masked_store_64B(dst, decoded_vector, mask); // mask is all-ones → full 64-byte write
A tail with 0 bytes to write should produce a mask of all zeros. Instead, subtracting padding underflows the size to -1, bzhiq reads that as 255, and the mask stays all-ones. The result is the exact opposite of intent: a full 64-byte write.
Walking the numbers: "A"×64 + "=" (65 characters)

Reports place the overflow at 62 bytes for a = tail and 63 bytes for a == tail. The same logic applies to a 3-char A== tail: output size becomes 0 − 2 = −2, giving index 254, mask still all-ones.

Diagram 1 walkthrough
- ① Crafted input: The payload is "64 valid chars +
=" sent somewhere the server Base64-decodes before authentication (a Basic auth header, SAML assertion, upload field, etc.). Length 65 is not a multiple of 4, so it should be rejected outright. - ② JIT handoff: The vulnerable path only exists once
decodeBlockis hot enough for C2 to swap in the assembly stub, which is why an attacker warms the server up with valid Base64 first. - ③ Tail miscalculation: the four boxes trace the chain: a 1-char
=tail → output size0 − 1 = -1→bzhiqindex255→ mask all 64 bits set. The code box below condenses this to three lines. - ④ Out-of-bounds write: the bar shows blue for the 48 valid output bytes, a dashed line for the 50-byte array boundary, and red for the 62 bytes that spill past it. The masked store starts at offset 48 and writes 64 bytes, so
48 + 64 = 112, 62 bytes beyond the array. - ⑤ Result: on its own, this corrupts the next object's header and typically crashes the JVM during garbage collection (denial of service). RCE is what Calif claims to have built per-product on top of this primitive.
Exploitation
Step 1: what the bug gives you on its own
- The spilled bytes are a fixed value, independent of attacker-controlled data. The attacker can influence where the write lands (via length and heap layout), not what gets written.
- The overflow corrupts the next object's header, typically crashing the JVM with a SIGSEGV during GC. Standalone, this is a pre-auth denial of service.
Step 2: Calif's claimed path to code execution
Calif states there is no universal exploit, each target needs its own work. The publicly described outline has five stages:
- Corrupt one array's length, so the application's own subsequent writes into it go out of bounds with attacker-chosen bytes
- Corrupt a second array that gets echoed back in a response, leaking heap memory (Calif calls this "JavaBleed")
- Repair the damaged object headers so the JVM keeps running
- Groom the heap remotely into a usable layout
- Steer the resulting writes at the JVM's Code Cache
Every target needs its own decoder entry point, a writable buffer, a readable feedback channel, a workable heap layout, and the right application behaviour, which is why the claimed impact is product-specific. Calif says it demonstrated pre-auth RCE against default configurations of Keycloak, Jira, Confluence, Artifactory, Jenkins, and PingFederate, and post-auth RCE against Kafka, Solr, Elasticsearch, Gerrit, and Spinnaker. No shell code or weaponized chain has been published, and this post does not reconstruct one. There are also reports that a Java client making a TLS connection to a malicious server can be exposed.
Root cause
The mistake is in the output-size arithmetic for the short padded tail. The stub computes (tail_len / 4) * 3 and then subtracts the padding count. For a tail shorter than four characters the first term is zero, so subtracting one or two = characters underflows the signed size to -1 or -2. That value is then passed to bzhiq as the mask width, and because bzhiq only reads the low 8 bits of its index, -1 becomes 255 and -2 becomes 254. Both are 64 or higher, so nothing is cleared and the mask stays all-ones. The masked store then writes a full 64 bytes where zero bytes were intended.
The input that should be rejected outright is rejected only after the vulnerable write has already happened. The scalar Java path would have handled the same input safely; The bug exists only in the hand-written assembly stub, which is selected on CPU feature flags and JIT warm-up.
Impact
On its own the primitive is a pre-authentication denial of service: the corrupted object header typically crashes the JVM during garbage collection. Escalation to code execution is claimed by Calif but is product-specific and requires the five-stage chain above. No weaponized chain is public, and no in-the-wild exploitation had been reported as of Nov 17. The affected population is limited to unpatched builds on x86-64 CPUs with AVX-512 VBMI, with the Basic or URL decoder reachable from attacker input and the stub already JIT-compiled.
Checking your exposure
All four conditions must be true for the vulnerable path to actually execute:
- x86-64 CPU with AVX-512 VBMI (Windows x64 gets the same generated code)
- An affected, unpatched build
UseAVX=3andUseBASE64Intrinsics=true(defaults on qualifying CPUs)- Attacker input reaches
java.util.Base64's Basic or URL decoder
/proc/cpuinfo does not exist outside Linux, and an empty result can look misleadingly "safe." Ask the JVM itself instead, and check each binary separately if a host runs more than one Java install:
java -Xlog:os+cpu -version 2>&1 | grep -oE 'avx512f|avx512bw|avx512_vbmi|bmi2' | sort -ujava -XX:+PrintFlagsFinal -version 2>/dev/null | grep -E ' (UseAVX|UseBASE64Intrinsics) '
If all four CPU features show up and UseAVX = 3, UseBASE64Intrinsics = true, that JVM is exposed. Products like Jenkins, Jira, Confluence, Keycloak, and Elasticsearch often bundle their own JRE, so check the actual running process, not just java -version:
jcmd <PID> VM.version

Diagram 2 walkthrough
- ① Four exposure conditions: CPU, version, flags, and input reachability all have to line up. Miss any one (ARM, a non-VBMI CPU, the MIME decoder) and the vulnerable path never runs.
- ② The patch: adding
cmpl(length, 4)andjcc(less, L_bruteForce)keeps 1 to 3 character tails out of the vector path entirely. With 4+ characters, the output size is always at least 1, so thebzhiqindex stays in valid range. - ③ Response priority: patch first ([redacted] / [redacted] / [redacted] / [redacted], or any vendor build containing JDK-8393212). If that is not immediate,
-XX:-UseBASE64Intrinsicsdisables the stub (just restart the JVM; Base64 decoding gets slower). The last resort is-XX:UseAVX=2, which disables AVX-512 entirely, a bigger performance hit, and it will not let the JVM start on ARM. - ④ Detection signals: input patterns, logs, and crash dumps, detailed below.
Fix
The patch adds a single length check at the top of L_finalBit:
+ // A padded Base64 tail shorter than one complete block is handled by Java.+ __ cmpl(length, 4);+ __ jcc(Assembler::less, L_bruteForce);
If fewer than 4 characters remain, execution jumps to L_bruteForce, the scalar (Java) path. The important detail is that this check runs before the output-size and mask computation.
- A tail of 4+ characters gives a starting size of
(length ÷ 4) × 3 ≥ 3 - Padding subtracts at most 2, so size is always ≥ 1
- So the
bzhiqindex is always in valid range - A tail made entirely of
=fails validation anyway and falls to the scalar loop
This is a minimal fix for the one underflow, it does not touch whether the vector path correctly decodes every 4 to 63 character tail otherwise.

Release timing and version labels vary by vendor, so check each vendor's own advisory for the actual fixed build. If you build from source, confirm JDK-8393212 is in your tree; a distro package whose version number looks current can still predate the fix. After patching, rebuild container images, restart every Java process, and confirm the running build with jcmd.
Stopgap mitigation before patching
Not an official Oracle workaround, but widely recommended. Requires a JVM restart; for containers, set it in the image or pod spec (JAVA_TOOL_OPTIONS).

Since the vulnerable decode happens pre-auth, network ACLs or a VPN in front of the service are also effective. Input size limits are not: the trigger is as short as 65 characters on newer lines, shorter than a typical Basic auth value or JWT.
Detection signals
-
The input itself: Base64 ending in
=with a length that is not a multiple of 4. On 17u,length mod 64being 1 to 3 while ending in=is a tighter signal; on mixed fleets, use 65 characters as the floor. -
Logs: a spike in
java.util.Base64throwingIllegalArgumentExceptionfrom request-handling code (the trigger always throws after the write). -
Responses: unusually large or binary-looking responses from endpoints that normally echo back decoded input.
-
Crashes: repeated
hs_errfiles showing a SIGSEGV inside a GC copy routine with a compiledBase64$Decoder.decode0frame on the stack, especially clustered by source IP, since a failed heap-grooming attempt crashes the JVM and the attacker retries. -
Traffic: high-frequency Base64-decode-triggering requests from a single source (the warm-up and precise heap-grooming phases).
-
A positive result is a JVM crash with an
hs_errfile pointing at a GC copy routine and aBase64$Decoder.decode0frame. -
A positive result is a running process on an unpatched build with
UseAVX = 3andUseBASE64Intrinsics = true.
The signals during recon are CPU feature flags (avx512_vbmi, avx512bw), the JVM flags UseAVX=3 and UseBASE64Intrinsics=true, and any pre-auth endpoint that decodes Base64: Basic auth headers, SAML assertions, upload fields. Bundled JREs are easy to miss, so enumerate the actual running process rather than the system Java.
The hedges matter: no weaponized chain is published, the RCE is product-specific, and the affected population is limited to unpatched builds on AVX-512 VBMI hardware with the stub already warm.
What happened, in plain words
On 17 November 2026, a security company called Calif told the world about a serious flaw in OpenJDK, the free, open-source version of Java that a huge number of servers run. The flaw is in the part of Java that decodes Base64, a way of turning ordinary text into a safe alphabet of characters so it can travel through systems that only expect text. The flaw is called Java4Shell and is tracked as CVE-2026-114938. A CVE is a public catalogue number given to a known security flaw so everyone can refer to the same thing.
Calif says the flaw can be pushed all the way to pre-authentication remote code execution. That phrase sounds heavy, so let us unpack it. "Remote" means an attacker does it over the network, from another machine. "Code execution" means the attacker gets their own instructions to run on the victim's server, which is about as bad as it gets. "Pre-authentication" means the attacker does not need a username or password first: they can do it before logging in. CISA, the US government agency that coordinates cybersecurity warnings, put out an alert the same day telling people to patch immediately.
This post explains why a single trailing = character, the padding character in Base64, turns into a 64-byte out-of-bounds write. An out-of-bounds write means the program writes data past the end of the memory area it was given, into memory that belongs to something else. We build up from the Base64 and AVX-512 basics you need, assuming no prior security knowledge.
TL;DR
- Root cause: HotSpot, the part of Java that runs programs, contains a hand-written assembly routine for decoding Base64 using a CPU feature called AVX-512 VBMI. For a short padded tail it miscalculates how many output bytes to write, underflowing the count to
-1. An instruction calledbzhiqreads that-1as255, which turns a "write 0 bytes" mask into "write all 64 bytes", spilling into the next object in memory. - Affected: OpenJDK 17.0.6+ and the 18 to 27 line on unpatched builds, only on x86-64 CPUs with AVX-512 VBMI (Intel Ice Lake+, AMD Zen 4+).
- Severity: CVSS 4.0 9.2 (Calif), CVSS 3.1 8.1 (Oracle, high attack complexity). CVSS is a scoring system for how bad a flaw is; higher is worse.
- CWE: Not yet assigned. CWE is a catalogue of weakness types. Closest fit is an integer underflow (CWE-191) leading to an out-of-bounds write (CWE-787).
- Fix: JDK-8393212, committed under embargo on 14 October as the deliberately bland "Base64 optimization improvements", released 17 November. An embargo is an agreement to keep something secret until a set date.
- Status: No in-the-wild exploitation reported as of 17 November. RCE has only been demonstrated by Calif in specific products; no weaponized chain is public.

Context: Base64 padding, intrinsics and masked stores
Base64 in one minute
Computers store data as bytes, and a byte is eight bits, a number from 0 to 255. Some systems only carry text, so we need a way to turn arbitrary bytes into ordinary printable characters. Base64 does exactly that: it uses 64 safe characters (A to Z, a to z, 0 to 9, plus + and /) and turns every 3 bytes into 4 characters. Think of it like packing a fragile object into a standard-sized box so it can go through any postal system.
When the input is not a multiple of 3 bytes, = padding is appended so the total length is always a multiple of 4.

The required output size is:
output bytes = (char count ÷ 4) × 3 − padding count
Line by line: take the number of Base64 characters, divide by 4 (because every group of 4 characters represents 3 bytes), multiply by 3 to get the number of bytes those characters stand for, then subtract the number of = padding characters, because padding does not represent real data.
The key fact: valid Base64 is always a multiple of 4 characters long. This bug's trigger is a length that is not a multiple of 4 but still ends in =, an input that should be rejected outright. The problem is it gets rejected after the vulnerable write already happened. That ordering, check after write, is the heart of the whole story.
Intrinsics: hot methods get replaced with hand-tuned assembly
Java programs are normally run by a virtual machine, a program that reads Java instructions and carries them out. To go faster, the virtual machine watches which methods (blocks of code) run most often. When one is "hot" enough, a compiler inside the virtual machine, called C2, replaces the general Java version with a hand-written, highly optimised version for the specific CPU. That replacement is called an intrinsic. The everyday comparison: a general recipe versus a chef who has made the dish a thousand times and has a memorised shortcut.
java.util.Base64.Decoder.decode0() calls decodeBlock() internally. Once that method gets hot enough, HotSpot's C2 compiler swaps out the Java bytecode for a hand-written assembly stub, an intrinsic. Assembly is the low-level language the CPU itself understands. Any server that decodes Base64 continuously (auth headers, JWTs, file uploads) will hit this state quickly. A JWT is a token, a small signed string a server hands out to prove you logged in; its parts are Base64-encoded.
The stub is only generated on CPUs with both AVX-512 VBMI and BW support. Otherwise the slower-but-safe scalar Java path is used. "Scalar" means one item at a time, the plain, careful way. The MIME decoder always uses the scalar path, regardless of CPU. MIME is a variant of Base64 used for email attachments.
AVX-512: 64 bytes at a time
AVX-512 is a set of instructions built into certain modern CPUs that let them work on a whole row of data in one go. Its registers, the CPU's tiny scratch pads, are 512 bits, 64 bytes. The stub decodes input 64 characters at a time. The everyday comparison: instead of carrying boxes one by one, you use a forklift that moves a whole pallet.
Masked stores: a stencil with only some holes punched
When writing results to memory, the stub provides a 64-bit mask alongside the data. Only bytes where the mask bit is 1 get written; bytes where it is 0 are left untouched, like a stencil where only some holes are cut. This is how the forklift knows to place only some of the boxes on the pallet.
The mask is built from "number of bytes to write" via bzhiq, which keeps the low N bits and zeroes the rest. In plain words, bzhiq takes a number N and produces a mask with the first N bits set to 1 and everything after set to 0. Critically, bzhiq only reads the low 8 bits of its index, and if that value is 64 or higher, nothing gets cleared at all. The low 8 bits are the last eight binary digits of a number, so a number can be "cut down" to a smaller value when read this way.

That last row is the entire bug. A value of 64 or more means the mask stays all ones, so all 64 bytes get written.
Setup: what has to be true for the vulnerable path to run
Several conditions have to line up to actually reach the vulnerable tail logic. "Tail" means the last few characters left over after the routine has processed the input in big chunks.
- Length threshold: the vector path only engages above a certain length. "Vector path" means the fast, many-at-once code path.
- 17u: above 128 characters. For a
=-terminated 1 to 3 char tail, valid lengths are64k+1to64k+3(k ≥ 2), i.e. 129 to 131, 193 to 195, 257 to 259 and so on. "17u" means the 17 update line of OpenJDK. - 21 / 25 / 27: threshold is 31 bytes, so 65 characters (one full 64-char block plus a short padded tail) is enough.
- 17u: above 128 characters. For a
- Decoder type: Basic or URL decoder only. MIME always takes the scalar path. The Basic decoder is the one used for HTTP Basic authentication, where a username and password are sent as Base64; the URL decoder is a variant that uses URL-safe characters.
- Valid characters: any
=or invalid character inside a 64-char chunk bails out to the Java path early, so every character before the tail must be valid Base64. - Warm-up: the stub must already be JIT-compiled. JIT means just-in-time, the process of turning Java into machine code while the program runs.
Because valid encoders never produce lengths like these, this input pattern simply does not show up in normal traffic. Unpadded Base64 (like JWT segments) does not end in = either, so it is distinguishable from that too.
Finding it: the vulnerable flow
Per public write-ups, the chain looks like this:
java.util.Base64$Decoder.decode0()callsdecodeBlock()- Once hot, C2 swaps in the HotSpot-generated stub (
generate_base64_decodeBlockinstubGenerator_x86_64.cpp) - Entry gate:
avx512_vbmi && avx512bw, plusUseAVX=3andUseBASE64Intrinsics=true(both defaults on qualifying CPUs) - Input is processed in 256-char, then 64-char chunks
- The remaining 1 to 63 character tail is handled at label
L_finalBit, finishing with a masked store
Step 5 is where it breaks. Below is a reconstructed pseudocode for understanding the flow, not literal assembly; exact registers and ordering vary by build. Pseudocode is a simplified sketch of code, written for humans rather than for a machine.
// The 64-char-chunk passes are done; a 1–3 char tail (including "=") remainsint out_size = (tail_len / 4) * 3; // tail < 4 chars, so this is 0out_size -= padding_count; // subtract '=' count → 0 - 1 = -1 (underflow)uint64_t mask = bzhi(~0ULL, out_size & 0xFF); // only low 8 bits used: -1 → 255masked_store_64B(dst, decoded_vector, mask); // mask is all-ones → full 64-byte write
Line by line:
- The comment says the big 64-character passes are finished and a short tail of one to three characters, including
=, is left. int out_size = (tail_len / 4) * 3;works out how many output bytes the tail should produce. Because the tail is shorter than four characters, the division gives 0, so the result is 0.out_size -= padding_count;subtracts the number of=characters. With one=, that is 0 minus 1, which in a signed integer wraps around to-1. This wrap is the underflow.uint64_t mask = bzhi(~0ULL, out_size & 0xFF);builds the mask.~0ULLis all ones.out_size & 0xFFkeeps only the low 8 bits, so-1becomes255.bzhiwith an index of 255 clears nothing, so the mask stays all ones.masked_store_64B(dst, decoded_vector, mask);performs the write. With an all-ones mask, all 64 bytes are written to memory.
A tail with 0 bytes to write should produce a mask of all zeros. Instead, subtracting padding underflows the size to -1, bzhiq reads that as 255, and the mask stays all-ones. The result is the exact opposite of intent: a full 64-byte write.
Walking the numbers: "A"×64 + "=" (65 characters)

Reports place the overflow at 62 bytes for a = tail and 63 bytes for a == tail. The same logic applies to a 3-char A== tail: output size becomes 0 − 2 = −2, giving index 254, mask still all-ones.

Diagram 1 walkthrough
- ① Crafted input: The payload is "64 valid chars +
=" sent somewhere the server Base64-decodes before authentication (a Basic auth header, SAML assertion, upload field, etc.). Length 65 is not a multiple of 4, so it should be rejected outright. A SAML assertion is a signed XML document used for single sign-on; it is Base64-encoded. - ② JIT handoff: The vulnerable path only exists once
decodeBlockis hot enough for C2 to swap in the assembly stub, which is why an attacker warms the server up with valid Base64 first. Warming up means sending harmless requests until the fast path is compiled. - ③ Tail miscalculation: the four boxes trace the chain: a 1-char
=tail → output size0 − 1 = -1→bzhiqindex255→ mask all 64 bits set. The code box below condenses this to three lines. - ④ Out-of-bounds write: the bar shows blue for the 48 valid output bytes, a dashed line for the 50-byte array boundary, and red for the 62 bytes that spill past it. The masked store starts at offset 48 and writes 64 bytes, so
48 + 64 = 112, 62 bytes beyond the array. An array is a fixed-size block of memory; its boundary is where it ends. - ⑤ Result: on its own, this corrupts the next object's header and typically crashes the JVM during garbage collection (denial of service). RCE is what Calif claims to have built per-product on top of this primitive. Garbage collection is the JVM's automatic memory cleaner; an object header is the small bookkeeping area at the start of every object.
Exploitation
Step 1: what the bug gives you on its own
- The spilled bytes are a fixed value, independent of attacker-controlled data. The attacker can influence where the write lands (via length and heap layout), not what gets written. The heap is the pool of memory the JVM uses for objects.
- The overflow corrupts the next object's header, typically crashing the JVM with a SIGSEGV during GC. SIGSEGV is the operating system's signal that a program touched memory it should not have. Standalone, this is a pre-auth denial of service: the attacker can knock the service over without logging in.
Step 2: Calif's claimed path to code execution
Calif states there is no universal exploit, each target needs its own work. The publicly described outline has five stages:
- Corrupt one array's length, so the application's own subsequent writes into it go out of bounds with attacker-chosen bytes
- Corrupt a second array that gets echoed back in a response, leaking heap memory (Calif calls this "JavaBleed")
- Repair the damaged object headers so the JVM keeps running
- Groom the heap remotely into a usable layout. Grooming means arranging memory deliberately so later writes land where you want.
- Steer the resulting writes at the JVM's Code Cache. The Code Cache is where the JVM keeps compiled machine code; overwriting it is one route to running your own instructions.
Every target needs its own decoder entry point, a writable buffer, a readable feedback channel, a workable heap layout, and the right application behaviour, which is why the claimed impact is product-specific. Calif says it demonstrated pre-auth RCE against default configurations of Keycloak, Jira, Confluence, Artifactory, Jenkins, and PingFederate, and post-auth RCE against Kafka, Solr, Elasticsearch, Gerrit, and Spinnaker. No shell code or weaponized chain has been published, and this post does not reconstruct one. There are also reports that a Java client making a TLS connection to a malicious server can be exposed. TLS is the encryption layer behind HTTPS.
Root cause
The mistake is in the output-size arithmetic for the short padded tail. The stub computes (tail_len / 4) * 3 and then subtracts the padding count. For a tail shorter than four characters the first term is zero, so subtracting one or two = characters underflows the signed size to -1 or -2. That value is then passed to bzhiq as the mask width, and because bzhiq only reads the low 8 bits of its index, -1 becomes 255 and -2 becomes 254. Both are 64 or higher, so nothing is cleared and the mask stays all-ones. The masked store then writes a full 64 bytes where zero bytes were intended.
The existing defences did not stop it because the input validation that rejects a non-multiple-of-4 length runs after the vector path has already performed the store. The scalar Java path would have handled the same input safely; the bug exists only in the hand-written assembly stub, which is selected purely on CPU feature flags and JIT warm-up, not on input shape.
Impact
On its own the primitive is a pre-authentication denial of service: the corrupted object header typically crashes the JVM during garbage collection. Escalation to code execution is claimed by Calif but is product-specific and requires the five-stage chain above. No weaponized chain is public, and no in-the-wild exploitation had been reported as of 17 November. The affected population is limited to unpatched builds on x86-64 CPUs with AVX-512 VBMI, with the Basic or URL decoder reachable from attacker input and the stub already JIT-compiled.
Checking your exposure
All four conditions must be true for the vulnerable path to actually execute:
- x86-64 CPU with AVX-512 VBMI (Windows x64 gets the same generated code)
- An affected, unpatched build
UseAVX=3andUseBASE64Intrinsics=true(defaults on qualifying CPUs)- Attacker input reaches
java.util.Base64's Basic or URL decoder
/proc/cpuinfo does not exist outside Linux, and an empty result can look misleadingly "safe." Ask the JVM itself instead, and check each binary separately if a host runs more than one Java install:
java -Xlog:os+cpu -version 2>&1 | grep -oE 'avx512f|avx512bw|avx512_vbmi|bmi2' | sort -ujava -XX:+PrintFlagsFinal -version 2>/dev/null | grep -E ' (UseAVX|UseBASE64Intrinsics) '
Line by line:
java -Xlog:os+cpu -versionstarts Java and asks it to log what it knows about the operating system and CPU, then print its version.2>&1sends error output to the same place as normal output so nothing is lost.| grep -oE 'avx512f|avx512bw|avx512_vbmi|bmi2'pipes that output intogrep, which searches text.-oprints only the matching words,-Eallows the pattern with alternatives, so it prints any of the four CPU feature names it finds.| sort -usorts the results and removes duplicates.java -XX:+PrintFlagsFinal -versionstarts Java again and asks it to print all its internal settings, then the version.2>/dev/nullthrows away error messages.| grep -E ' (UseAVX|UseBASE64Intrinsics) 'keeps only the two settings we care about.
If all four CPU features show up and UseAVX = 3, UseBASE64Intrinsics = true, that JVM is exposed. Products like Jenkins, Jira, Confluence, Keycloak, and Elasticsearch often bundle their own JRE, so check the actual running process, not just java -version. A JRE is a Java runtime environment, the bundle needed to run Java programs.
jcmd <PID> VM.version
Line by line: jcmd is a tool that talks to a running Java process. <PID> is the process ID, the number the operating system gives each running program. VM.version asks that process to report its own version, which is the only reliable answer when a product ships its own Java.

Diagram 2 walkthrough
- ① Four exposure conditions: CPU, version, flags, and input reachability all have to line up. Miss any one (ARM, a non-VBMI CPU, the MIME decoder) and the vulnerable path never runs. ARM is a different CPU family used in many phones and some servers.
- ② The patch: adding
cmpl(length, 4)andjcc(less, L_bruteForce)keeps 1 to 3 character tails out of the vector path entirely. With 4+ characters, the output size is always at least 1, so thebzhiqindex stays in valid range. - ③ Response priority: patch first ([redacted] / [redacted] / [redacted] / [redacted], or any vendor build containing JDK-8393212). If that is not immediate,
-XX:-UseBASE64Intrinsicsdisables the stub (just restart the JVM; Base64 decoding gets slower). The last resort is-XX:UseAVX=2, which disables AVX-512 entirely, a bigger performance hit, and it will not let the JVM start on ARM. - ④ Detection signals: input patterns, logs, and crash dumps, detailed below.
Fix
The patch adds a single length check at the top of L_finalBit:
+ // A padded Base64 tail shorter than one complete block is handled by Java.+ __ cmpl(length, 4);+ __ jcc(Assembler::less, L_bruteForce);
Line by line:
- The comment explains the intent: a padded Base64 tail shorter than one complete block is handled by Java, the safe scalar path.
__ cmpl(length, 4);compares the remaining length with 4.__ jcc(Assembler::less, L_bruteForce);jumps to the labelL_bruteForce, the scalar path, if the length is less than 4.
If fewer than 4 characters remain, execution jumps to L_bruteForce, the scalar (Java) path. The important detail is that this check runs before the output-size and mask computation.
- A tail of 4+ characters gives a starting size of
(length ÷ 4) × 3 ≥ 3 - Padding subtracts at most 2, so size is always ≥ 1
- So the
bzhiqindex is always in valid range - A tail made entirely of
=fails validation anyway and falls to the scalar loop
This is a minimal fix for the one underflow, it does not touch whether the vector path correctly decodes every 4 to 63 character tail otherwise.

Release timing and version labels vary by vendor, so check each vendor's own advisory for the actual fixed build. If you build from source, confirm JDK-8393212 is in your tree; a distro package whose version number looks current can still predate the fix. After patching, rebuild container images, restart every Java process, and confirm the running build with jcmd.
Stopgap mitigation before patching
Not an official Oracle workaround, but widely recommended. Requires a JVM restart; for containers, set it in the image or pod spec (JAVA_TOOL_OPTIONS). A stopgap is a temporary measure until the real fix is in place. JAVA_TOOL_OPTIONS is an environment variable, a named setting the operating system passes to programs, that Java reads at startup.

Since the vulnerable decode happens pre-auth, network ACLs or a VPN in front of the service are also effective. An ACL is an access control list, a rule set deciding which network traffic is allowed in. Input size limits are not: the trigger is as short as 65 characters on newer lines, shorter than a typical Basic auth value or JWT.
Detection signals
-
The input itself: Base64 ending in
=with a length that is not a multiple of 4. On 17u,length mod 64being 1 to 3 while ending in=is a tighter signal; on mixed fleets, use 65 characters as the floor.modmeans the remainder after division. -
Logs: a spike in
java.util.Base64throwingIllegalArgumentExceptionfrom request-handling code (the trigger always throws after the write). An exception is Java's way of reporting an error. -
Responses: unusually large or binary-looking responses from endpoints that normally echo back decoded input. An endpoint is a specific URL the service answers on.
-
Crashes: repeated
hs_errfiles showing a SIGSEGV inside a GC copy routine with a compiledBase64$Decoder.decode0frame on the stack, especially clustered by source IP, since a failed heap-grooming attempt crashes the JVM and the attacker retries. Anhs_errfile is the crash report the JVM writes when it dies; a stack is the list of functions that were running at the moment of the crash. -
Traffic: high-frequency Base64-decode-triggering requests from a single source (the warm-up and precise heap-grooming phases).
-
A positive result is a JVM crash with an
hs_errfile pointing at a GC copy routine and aBase64$Decoder.decode0frame. -
A positive result is a running process on an unpatched build with
UseAVX = 3andUseBASE64Intrinsics = true.
The signals during recon are CPU feature flags (avx512_vbmi, avx512bw), the JVM flags UseAVX=3 and UseBASE64Intrinsics=true, and any pre-auth endpoint that decodes Base64: Basic auth headers, SAML assertions, upload fields. Recon means the information-gathering phase before any testing. Bundled JREs are easy to miss, so enumerate the actual running process rather than the system Java.
The hedges matter: no weaponized chain is published, the RCE is product-specific, and the affected population is limited to unpatched builds on AVX-512 VBMI hardware with the stub already warm.
Glossary
- OpenJDK: the free, open-source implementation of Java that many servers run.
- Base64: a way of encoding arbitrary bytes as printable characters, turning 3 bytes into 4 characters.
- Padding: the
=characters added to Base64 so the total length is a multiple of 4. - CVE: a public catalogue number for a known security flaw.
- Pre-authentication: reachable before the attacker logs in.
- Remote code execution (RCE): an attacker getting their own instructions to run on a victim's machine over the network.
- CISA: the US agency that coordinates cybersecurity warnings.
- Out-of-bounds write: writing data past the end of the memory area a program was given.
- HotSpot: the part of Java that runs programs and compiles hot code.
- Assembly: the low-level language the CPU itself understands.
- Intrinsic: a hand-written, highly optimised replacement for a general code path, chosen when a method is hot.
- JIT (just-in-time): compiling code to machine code while the program runs.
- C2: the compiler inside HotSpot that produces optimised machine code.
- Stub: a small hand-written routine that replaces a general one.
- AVX-512: a set of CPU instructions that work on 64 bytes at once.
- VBMI / BW: specific AVX-512 feature sets; the vulnerable stub needs both.
- Register: a tiny scratch pad inside the CPU.
- Mask: a pattern of bits saying which bytes to write and which to leave alone.
- Masked store: a write that only touches the bytes selected by a mask.
bzhiq: a CPU instruction that builds a mask of the first N bits; it only reads the low 8 bits of N.- Underflow: a number going below its minimum and wrapping around, here 0 minus 1 becoming
-1. - Tail: the last few characters left after the routine processes input in big chunks.
- Vector path: the fast, many-at-once code path.
- Scalar path: the plain, one-at-a-time code path, which is safe here.
- MIME decoder: a Base64 variant used for email; it always uses the scalar path.
- Basic decoder / URL decoder: the Base64 variants named as affected.
- JWT: a signed token a server hands out to prove you logged in; its parts are Base64-encoded.
- SAML assertion: a signed XML document used for single sign-on, Base64-encoded.
- Heap: the pool of memory the JVM uses for objects.
- Object header: the small bookkeeping area at the start of every object.
- Garbage collection (GC): the JVM's automatic memory cleaner.
- SIGSEGV: the operating system's signal that a program touched memory it should not have.
- Denial of service (DoS): making a service unavailable, here by crashing it.
- Heap grooming: arranging memory deliberately so later writes land where you want.
- Code Cache: where the JVM keeps compiled machine code.
- TLS: the encryption layer behind HTTPS.
- CVSS: a scoring system for how bad a flaw is.
- CWE: a catalogue of weakness types.
- Integer underflow (CWE-191): a number going below its minimum and wrapping.
- Out-of-bounds write (CWE-787): writing past the end of a memory area.
- Embargo: an agreement to keep something secret until a set date.
- JRE: a Java runtime environment, the bundle needed to run Java programs.
jcmd: a tool that talks to a running Java process.- PID: the number the operating system gives each running program.
- Environment variable: a named setting the operating system passes to programs.
- ACL: an access control list, a rule set deciding which network traffic is allowed in.
- VPN: a private network tunnel that keeps traffic off the open internet.
- Exception: Java's way of reporting an error.
- Endpoint: a specific URL the service answers on.
hs_errfile: the crash report the JVM writes when it dies.- Stack: the list of functions that were running at the moment of a crash.
- Recon: the information-gathering phase before testing.
- ARM: a different CPU family used in many phones and some servers.