[ Java4Shell CVSS 9.2 ]

[ Overview ]

This one is Calif's research, not mine. I'm writing it up because it's
the rare bug that deserves the Log4Shell-style name, and because the
first question everyone asked me today was "am I exposed?" The short
version: a remote, unauthenticated memory-corruption bug in the JVM
itself, patched by OpenJDK and Oracle on 2026-11-17, tracked as
CVE-2026-114938 and scored 9.2 critical.

The name nods to Log4Shell, but mechanically it's the opposite kind of
flaw. Log4Shell was application logic: a feature (JNDI lookup) doing
exactly what it was told. Java4Shell is a memory-safety bug in HotSpot's
JIT, reachable from almost anything that Base64-decodes untrusted bytes.
In a normal Java stack that surface is enormous: Basic-auth headers,
JWTs, SAML assertions, session cookies, API payloads. There's no library
to find and no gadget chain to assemble. The decoder is the bug.

Calif calls the heap-disclosure half of it JavaBleed, and the
comparison to Heartbleed is fair: attacker-chosen reads of server memory,
coming back in the response. From there they escalated to full remote
code execution.

[ The bug ]

HotSpot ships a hand-written x86-64 assembly intrinsic for
java.util.Base64.Decoder that chews through input in 64-byte
blocks using AVX-512 VBMI. The tail, the last partial block, is flushed
with a masked vector store (evmovdqub), and the write mask
is built from the output length. That's where it goes wrong:

  1.  A padding-only tail (=, ==, X=, XY=, ===, …)
      leaves output_len at 0, then the code subtracts for the
      padding. It underflows to -1 or -2 — as an unsigned
      value, 0xFFFF…FE or 0xFFFF…FF.
  2.  The mask is bzhiq(-1, output_len). BZHI zeroes the bits
      above a given index, but it's a no-op when the index is 64 or
      more. A giant unsigned length leaves the mask all ones.
  3.  A mask of all ones means the "masked" store isn't masked at
      all. It writes the full 64 bytes, straight past the end of
      the output buffer.

Java does reject the malformed input — it throws
IllegalArgumentException a moment later. But the 64-byte write has
already happened. The validation is downstream of the corruption, which
is the whole problem.

[ Why the numbers line up ]

When I first read the figures they looked inconsistent, so it's worth
walking through why they aren't. The canonical trigger on modern
OpenJDK 17 is 64 A characters followed by a single =:

  "AAAAAAAA…AAAA="        65 characters in

Base64 turns 4 input characters into 3 output bytes, so a 65-character
string makes the decoder allocate a 50-byte output array. By the
time it reaches the faulty tail store, 48 bytes are already written, and
the final store lands at offset 48 — where the next couple of
decoded bytes belong. Then it writes 64 bytes from there.
Where the 64 bytes land A to-scale memory strip. The decoded-output array is 50 bytes wide. The masked store begins at offset 48, two bytes before the array ends, and runs 64 bytes. Offsets 48 and 49 are inside the array; the remaining 62 bytes, offsets 50 to 111, spill into neighbouring heap objects and are all the fixed value 0x9a. one masked store = 64 bytes (mask underflowed to all-ones) output array: 50 bytes neighbouring heap objects 62 bytes clobbered (offsets 50–111, all 0x9a) 0 48 50 112
The write starts two bytes before the array ends, so offsets 48–49 are in-bounds and the other 62 bytes land in whatever the heap allocated next. Calif's PoC decodes into a 4096-byte array and checks offsets 50–111, which is exactly this spill.
So the 64-byte write and the 62-byte overflow were never in conflict:
two bytes in bounds, 62 out. On older OpenJDK 17 builds the path is
reached with 128 A characters plus = instead of 64.

[ From overflow to RCE ]

Here's the part I find clever. The overflow isn't a free write of
attacker data — it's a fixed overwrite. Byte 0 of the spill is
fully attacker-controlled, byte 1 has four controllable bits, and bytes
2 through 63 are constant; offsets 48 to 63 are always 0x9a. The only
thing the attacker really steers is where those bytes land. That makes
Java4Shell a heap-grooming problem, not a direct write primitive, and the
exploit is built out of that one constant spill:
JavaBleed: turning a fixed spill into a heap leak Three boxes left to right. First, the fixed overflow. It lands on a writer array and enlarges its length field, which turns it into a bounded write of chosen bytes. That writer corrupts a second reader array's length, giving an out-of-bounds read. The reader's contents come back in the HTTP response, leaking heap memory such as keys and tokens. 1. the fixed spill 64 bytes, mostly 0x9a, landed by grooming 2. the writer its length is enlarged → bounded write of your bytes 3. the reader its length is corrupted → out-of-bounds read HTTP response bleeds heap memory (JavaBleed) private keys, session tokens, PII
The constant spill enlarges a neighbouring array's length field (the "writer"), which upgrades it into a bounded write of chosen bytes; that writer then corrupts a second array's length (the "reader"), whose contents come back in the response. Same shape as Heartbleed, reached through a JIT bug.
Getting two arrays to sit next to the decoder's output, in the right
order, is the hard part. Calif's chain:

  Warm up        run valid decodes until the JIT compiles the fast
                  path and the vulnerable intrinsic is live (C2).
  Groom locally  control TLAB and outside-TLAB allocation and
                  spray-and-retry until the writer and reader arrays
                  land in adjacent G1 regions.
  Groom remotely send request data in stages and wait on TCP
                  ACKs, so allocation order can be steered over the
                  network. They rented a VM near the target to keep the
                  latency steady enough to do it.
  Escalate       repair corrupted objects, run data-only attacks
                  on application logic, then build arbitrary writes that
                  reach the Code Cache and JVM hooks for execution.

Two honest caveats Calif is clear about: there is no universal
exploit — every target needs its own profile, and a missed groom can
crash the JVM — and a body-buffering proxy (nginx's default) breaks
some remote chains. Neither is a reason to sleep on it. The per-product
chains were held back; the primitive is public.

[ Am I affected? ]

Two conditions, both have to be true:

  The runtime   OpenJDK 17.0.6 or newer, or any downstream build of
                  it: Temurin, Corretto, Zulu, Liberica, Microsoft
                  Build, SapMachine, Red Hat, GraalVM, Oracle Java SE.
  The CPU       x86-64 with AVX-512 VBMI. In practice that's Intel
                  Ice Lake and newer (Xeon Ice/Sapphire/Emerald/Granite
                  Rapids) and AMD Zen 4 and newer. ARM64 is not
                  affected — the bug lives in an x86-64-only intrinsic.

The CPU flags are the quick filter. On Linux:

  grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' | grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'

If all four print, the silicon qualifies. Pair that with java -version
showing 17.0.6 or newer and you have an affected host until it's patched.
Plenty of cloud instance types land on exactly this hardware, so don't
assume you're clear just because you didn't buy the CPU.

[ What I'd patch first ]

Calif demonstrated this against a long list of software, so I'd triage
by exposure. Internet-facing, pre-auth, default config goes to the front:

  Pre-auth RCE    Keycloak, Atlassian Jira, Atlassian Confluence,
                   JFrog Artifactory, Jenkins, PingFederate
  Post-auth RCE   Apache Kafka, Apache Solr, Elasticsearch,
                   Gerrit, Spinnaker

The lists aren't exhaustive — sample apps on Struts and Spring Boot
fell too. If you run an SSO or identity product from that first row on
vulnerable hardware, that's the one that ruins your week, so it's first.

This is also exactly the question cvescope exists to answer: point
it at the versions you actually run and it'll tell you which of these
are live on your estate and rank them by real exploitation evidence,
instead of you eyeballing a vendor list.

[ Fix & workarounds ]

Patch. OpenJDK published an advisory and Oracle shipped the fix on
2026-11-17. Updating the JVM is the real answer; everything below is a
stopgap for hosts you can't bounce yet.

  -XX:-UseBASE64Intrinsics   turns off the hardware-accelerated
                               Base64 path and falls back to the plain
                               Java decoder, which isn't vulnerable.
                               Works on every architecture. This is the
                               one I'd reach for — no way to shoot
                               yourself in the foot with it.
  -XX:UseAVX=2               disables AVX-512 outright. Also closes
                               the bug, but x86-64 only: OpenJDK on
                               ARM doesn't recognise the flag and won't
                               start, so don't push it into a config
                               that's shared with ARM nodes.

Both are JVM start flags, so they need a restart of the service to take
effect. If you can only touch one thing on a mixed fleet, use the first.

[ See Also ]