CVE-2026-114938 (Java4Shell): HotSpot AVX-512 Base64 Heap Overflow -- Crashing Jenkins Before Login
The advisory
Oracle’s November 2026 Critical Patch Update lists CVE-2026-114938 under the HotSpot compiler component: exploitable over the network with no credentials, high attack complexity, “takeover”, CVSS 8.1. The reporter nicknamed it Java4Shell and describes pre-auth remote code execution through heap grooming, with the exploit chains withheld, plus a heap memory disclosure. The affected code is the Base64 decoder of the Java runtime itself, in OpenJDK builds of the 17, 21, 25 and 27 lines from before the November 2026 update, on x86-64 CPUs with AVX-512 VBMI. Any Java service on such a machine that decodes Base64 from the network is exposed, and that starts with HTTP Basic authentication.
I wanted to see what the bug does to a real product that nobody prepared for it. The answer: an unmodified Jenkins 2.580.2 LTS on Amazon Corretto 21.0.13.0.11, default JVM flags, dies with SIGSEGV after HTTP requests that carry no credentials at all. The JVM’s own fatal error report shows the decoder’s constant bytes sitting where a class pointer should be, the same script does nothing to the first fixed build, and the crashing run is in a live pcap. Against Jenkins I did not reach code execution or heap disclosure. In the lab, inside a single test JVM on the same vulnerable build, I did drive the same overflow to a redirected method call that runs /usr/bin/id. That chain is in-process and ends in a stand-in gadget I wrote myself, so it shows that the bug is a code-execution primitive, not that Jenkins can be attacked that way over the network. This post says exactly how far I got and what stands in the way.
PoC, detection rule, and live pcap: al4n4n/achilles-heel/CVE-2026-114938
Where Base64 turns into assembly
java.util.Base64 is one of those classes that every Java service touches without thinking about it. HTTP Basic authentication is Base64. So are many tokens, upload formats and message envelopes. When a server receives Authorization: Basic dXNlcjpwYXNz, something calls Base64.getDecoder().decode() on bytes that came straight off the network, and it does so before it can possibly know who is asking.
The Java side is simple. Decoder.decode(byte[]) computes how many bytes the input will produce, allocates an array of exactly that size, and hands both to decode0:
1 | public byte[] decode(byte[] src) { |
Inside decode0 the real work happens in decodeBlock, a plain loop that turns four characters into three bytes. That loop is marked as an intrinsic candidate. When HotSpot’s optimizing compiler, C2, compiles decode0, it does not compile the Java loop. It replaces the call with a hand-written assembly stub tuned for the CPU the JVM is running on.
On x86-64 CPUs with AVX-512 VBMI (Intel Ice Lake and later Xeon, AMD Zen 4 and later) that stub works on 64 characters at a time in 512-bit registers. ARM64 and CPUs without VBMI are not affected. The stub lives in StubGenerator::generate_base64_decodeBlock() in src/hotspot/cpu/x86/stubGenerator_x86_64.cpp, and it is only used where decode0 runs as C2 code. The interpreter, the C1 compiler and a standalone compiled decodeBlock all use the Java loop. That detail matters later.
One more property matters: the stub has no idea how big the destination array is. The Java documentation of decodeBlock says so directly: no length check is possible on dst, so it is assumed to be large enough. The stub is trusted to write only what it decoded.
The vulnerable code
After the wide loops, the stub is left with 1 to 63 characters. It handles them at the label L_finalBit with a single masked 64-byte store. Here are the relevant lines at the parent of the fix commit, which is the same code as Corretto 21.0.13.0.11:
1 | __ BIND(L_finalBit); |
Read it as arithmetic. output_size is (length >> 2) * 3: the number of bytes that the complete four-character groups in the tail will produce. If the tail ends in =, the code at L_padding subtracts one, and if the character before that is also =, it subtracts one more.
Now give it a tail of one, two or three characters. length >> 2 is 0, so output_size starts at 0, and the padding code takes it to -1 or -2. Nobody checks for that.
The output mask is supposed to have output_size low bits set, and it is built with BZHI: “zero the high bits starting at this index”. BZHI reads the index from the low 8 bits of the register. For -1 that is 0xff, for -2 it is 0xfe, and for any index of 64 or more the instruction leaves the source alone. The source is all ones. So the mask that should select zero bytes selects all 64.
There is an error check in between, and it does not help. The stub pre-fills its input register with the character 'a' (0x61616161) so that the unused lanes look like valid Base64, then merges in the real characters under the input mask. The padding code has already shifted the = out of that mask, so what is left is at most one or two real characters and a lot of a. Everything decodes cleanly. evmovdqub then stores the whole 64-byte vector at the current output position.
The array was sized for the real output. For a tail of = that is two bytes more than the full blocks produce, so 62 of the 64 bytes land past the end of the array. The stub returns, Java notices the stray = and throws IllegalArgumentException. The exception is correct and too late.
What exactly gets written
Three things about that 64-byte store decide everything that follows.
First, the size is what the arithmetic predicts: 62 bytes past the end of the array for a tail of =, X= or XY=, and 63 for X==. A tail of == or === writes nothing extra.
Second, the position scales with the input. With 126 full 64-character blocks in front of a one-character tail, the store lands at index 6050 to 6111 of what would have been a byte[6050]. The attacker picks the size of the buffer by picking the length of the header.
Third, and this decides everything that follows: the bytes are constant. The stub pre-fills its input with 'a', so the vector it stores is the decode of aaaa repeated, 69 a6 9a sixteen times over, except that its last sixteen bytes are all 9a. Only the first two bytes follow the input, and those two are inside the array. Every single out-of-bounds byte is fixed by the stub. An attacker controls where the write lands and when. Not what it says. You can see those exact constant bytes land on a live object in the crash report below.
Finding a door: Jenkins
A library bug needs a host application, and I wanted one that an attacker can reach before authentication, unmodified. Jenkins qualified on the first read of its source. Its security filter chain passes every request that has a Basic header to jenkins.security.BasicHeaderProcessor:
1 | String authorization = req.getHeader("Authorization"); |
Line 76 at tag jenkins-2.580.2 decodes whatever follows Basic with the basic decoder, into an exactly sized array, before it has looked at a user name. If the decode throws, Jenkins shrugs, treats the credentials as empty and answers 401. From the outside, a trigger request looks like any failed login.
The official Jenkins image was no use for a clean comparison: it bundles Temurin, which had no fixed build when I set the lab up, and I wanted the vulnerable and the fixed JDK from one vendor with nothing else changed. So the lab runs the official Jenkins 2.580.2 war, checksum-pinned, on two Corretto tarballs: 21.0.13.0.11, the last vulnerable build, and 21.0.13.1.2, the first fixed one. Corretto’s source at those two tags differs in the stub file by exactly the four lines of the fix. The command line is java -Djava.awt.headless=true -jar jenkins.war --httpPort=8080. No tuning flags, no diagnostic flags, no debug build.
Jenkins caps request headers at 8 KiB, which allows 126 full blocks before the tail. So the trigger is:
1 | GET / HTTP/1.1 |
Sent to a freshly started Jenkins, this request does nothing. Jenkins answers 401 and carries on. Two more things have to be true first, and neither is in the advisory.
The trigger that disarms itself
The first is the detail from earlier: the stub only exists where decode0 is C2-compiled, and a freshly started Jenkins has never decoded anything. So the PoC first sends well-formed Basic headers, about 16,000 of them, small HEAD / requests whose value decodes to AAAAAA with no colon in it, so no account is ever looked up. With --jit-state the PoC reads the compiler’s own view of the method from inside the lab container between phases. That is lab instrumentation, not part of the attack, and it is where the second problem shows up:
1 | JIT state of Base64$Decoder.decode0 before any Basic header was sent: not compiled (interpreted) |
After the well-formed warm-up, decode0 is at tier 4 and in use. Then one malformed value arrives, a harmless 9-character one, and the tier 4 code is marked “not entrant”. The compiled decode0 has never seen the branch that throws, so HotSpot deoptimizes the method and sends it back to the interpreter. And the interpreter does not use the stub.
In other words: warm the JVM up with valid input, send the trigger, and the first trigger may hit the stub, but it also switches the stub off for every request after it. The bug protects itself for a while. To get past that, the PoC runs a second warm-up of about 12,000 short malformed values. They are below the 32-character threshold of the vector path, so they are harmless, but they make decode0 throw from the same branch the trigger will use, until C2 compiles it again with that branch included. The last line above shows the new tier 4 version in use. Now the stub stays armed.
And even then, a trigger request sent on its own gets a 401 from a JVM that stays perfectly healthy.
One at a time, nothing happens
With the JIT in the right state the write happens on every trigger request. It just does not hit anything.
HotSpot gives every thread a thread-local allocation buffer, a TLAB: a private slice of the young generation where the thread allocates by bumping a pointer. The decode buffer for the trigger is a byte[6050], an object of 6072 bytes: 16 bytes of header, the data, 6 bytes of padding. The stub’s store covers the last 8 bytes of that object and the 56 bytes after it. Inside a TLAB, the memory after the newest object is simply unused. The overrun scribbles on empty space, and the next allocation overwrites it.
For damage, the buffer has to be allocated outside the TLAB, in the shared part of the young generation, and another thread has to allocate its own object directly behind it before the store happens. A 6 KB array often does not fit in what is left of a thread’s TLAB, and when the leftover is too large to throw away, HotSpot allocates the array directly in the shared young generation, where the next allocation by any other thread lands right behind it. That part of the explanation comes from reading the HotSpot source and from the crash frames below; I did not trace the allocation decision itself. What I did measure is the consequence: run the PoC with --sequential and it sends the same 5,120 trigger requests one at a time on a single connection, and the warm, vulnerable JVM answers every one with a 401 and never notices. 5,120 overruns into the heap, and it does not die.
So the requests have to be decoded at the same moment. My early attempts sent the trigger as ordinary pipelined traffic. They did crash the target, but only after many more requests, and far fewer with a 1 GiB container memory limit than without. Those were scratch trials that I did not keep as evidence, so take them as history and not as a result. They are where the lab’s 1 GiB limit comes from: with it, HotSpot picks the Serial collector and a 256 MB heap by itself. The final PoC does something more deliberate: each round opens 128 connections, sends each request except its last two bytes, waits, and then releases all 128 final CRLFs together. In the captured run they arrive within 2.4 ms of each other. The same JVM that had just shrugged off 5,120 sequential triggers dies in the first round once the requests land together.
The crash
Here is the JVM’s own account of the captured run, from evidence/target-vuln-hs_err.log. Nothing in it was produced by the PoC; the script only copies the file out of the stopped container.
1 | # A fatal error has been detected by the Java Runtime Environment: |
Read it from the bottom up.
Narrow klass base is where this JVM’s compressed class pointers start. Every Java object has a header: an 8-byte mark word, then a 4-byte compressed class pointer, which the JVM turns into a real address by adding that base. The object right behind the decode buffer received the stub’s vector over its header: mark word 9a 69 a6 9a 69 a6 9a 69, class pointer a6 9a 69 a6. As a little-endian integer that class pointer is 0xa6699aa6.
RAX is 0x00007407e5699aa6. That is the narrow klass base, 0x000074073f000000, plus 0xa6699aa6. The JVM took four bytes of Base64 decoder output, believed they were a class, and went looking for it. si_addr is RAX + 0xc, and nothing is mapped there.
The stack says who was looking. The crashing thread is named Handling GET / from 172.17.0.1: it is one of my own requests, inside BasicHeaderProcessor.doFilter, lower-casing its own 8 KB header. It asked the allocator for a fresh array, another request’s decode ran over that array’s header a moment later, and when the allocation slow path came back to finish its bookkeeping, the class was gone. The attack traffic corrupted the attack traffic.
From the attacker’s side, the same moment looks like this (evidence/poc-vuln.txt):
1 | round 1: released 128, responses: 94 x 401; connection errors: 34 x ConnectionError |
Exit code 134 is the JVM’s own abort, and oom_killed=false rules out the container limit. In the capture, the 128 CRLFs arrive between 07:38:48.231776 and 07:38:48.234166, and the target sends its first RST at 07:38:48.371985. Jenkins was gone about 140 milliseconds after the burst.
The write only does damage when a live object happens to sit behind one of the 128 decode buffers, and the JIT has to have finished recompiling decode0, which cannot be seen from the network. So a round can miss; in the captured run the JVM died in the first round. The crashing frame also differs from run to run, because it is whichever thread first touches a smashed header. What stays constant is the faulting class pointer: the same narrow-klass-base + 0xa6699aa6 sum every time.
Negative control
Same script, same Jenkins war, Corretto 21.0.13.1.2. The JIT goes through the same states, so the fixed stub is reached just like the vulnerable one (evidence/poc-fixed.txt):
1 | round 1: released 128, responses: 128 x 401 |
5,120 trigger requests, 5,120 polite 401s.
What this is, and what it is not
What I can prove is unauthenticated corruption of the Java heap of a real, unmodified product over the network, ending in a JVM crash. That is a remote crash of Jenkins with zero credentials, and it shows the out-of-bounds write landing on live objects of a real product with stock JVM flags.
It is not what the advisory rates. Oracle says takeover, and the reporter describes code execution and heap disclosure. I did not build an exploit chain against Jenkins. I read the saved crash reports against the HotSpot source to see what an attacker would be working with. The short version:
The primitive is a constant write. The object behind the decode buffer always receives the same mark word, the same class pointer 0xa6699aa6 and, in the next four bytes, 0x9aa6699a: an array’s length, or an object’s first field. The attacker chooses the size of the buffer, the timing, and what the neighbouring requests allocate. None of the bytes.
For reading memory, the interesting part is that length. 0x9aa6699a is negative as a Java int, but HotSpot compares array indexes unsigned, so an array with that length would accept any index. In Jenkins’ Basic header path, though, the code that consumes these arrays reads the length as a signed number first and bails out with a NegativeArraySizeException. No response in any of my runs carried heap bytes.
For control flow, the class pointer is the one pointer in an object header that leads to code. Every victim gets the same one, and in every saved report its target was unmapped memory. Turning that into something useful would need attacker-chosen content at that fixed address, or a victim object that survives without its class being consulted. The JVM gives a corrupted object very little time: about 140 ms in the captured run.
None of this says the disclosed impact is out of reach. It says where I stopped against Jenkins. The next section is what happened when I took the network out of the picture and kept going.
Beyond the crash: command execution in the lab
Added on 2026-11-18, after this post first went up. Everything in this section happens inside a test JVM in the lab. Nothing in it was sent to Jenkins.
That analysis left one door open: a corrupted object is only useful if it survives without its class being consulted. So I asked a narrower question. Given this exact overflow on this exact build, can the corruption be carried all the way to running a command? I wrote a small harness, poc/CmdExecProbe.java, that runs in a throwaway JVM inside the vulnerable lab image and triggers the real stub with 64 A characters and one =. It allocates five objects back to back: the decode buffer, two 48-byte arrays, and two tiny objects of different classes, Normal and Altered, that implement the same one-method interface. Then five things happen.
One: the overflow. The store runs over the header of the first array. Its class pointer is garbage and its length reads 0x9aa6699a, the constant from the analysis above. A plain byte store into this array kills the JVM, because the bastore bytecode looks at the class first. An earlier probe of mine died exactly there.
Two: a second, cleaner primitive. C2-compiled System.arraycopy does not look at the class, and HotSpot compares indexes unsigned, so that “negative” length admits any index. One 4-byte copy through the smashed array raises the length field of the second array from 48 to 256. The second array keeps a valid byte[] header, so ordinary bytecode can read and write past its real end.
Three: type confusion. Through the inflated array the harness reads the compressed class pointer of the Altered object and writes those four bytes over the class pointer of the Normal object next to it.
Four: controlled dispatch. The harness calls the one interface method on the Normal object. Before the overwrite the call returns NORMAL. After it, the same call on the same reference runs the method of Altered: invokeinterface looks up the receiver’s class when it runs, and that class is now whatever those four bytes say.
Five: command execution. The method of Altered calls Runtime.getRuntime().exec("/usr/bin/id") and returns what the command printed (evidence/impact-cmdexec-vuln.txt):
1 | runtime=21.0.13+11-LTS vm=OpenJDK 64-Bit Server VM arch=amd64 |
victim.length = -1700370022 is 0x9aa6699a read as a signed int: the stub’s bytes again. 08cc1401 and 00281501 are the two compressed class pointers in memory order. Steps [3] and [5] are the same line of Java on the same object; all that changed in between is four bytes, written at index 56 to 59 of an array whose real length is 48. And uid=1000(jenkins) is id running as the user of the lab container.
A second run with -XX:-UseTLAB, which puts every allocation into the shared part of the young generation where the network PoC’s decode buffer does its damage, printed the same result, and both JVMs exited normally. On the fixed build the harness tries 20 times and gives up (evidence/impact-cmdexec-fixed.txt):
1 | runtime=21.0.13.1+2-LTS vm=OpenJDK 64-Bit Server VM arch=amd64 |
Now the part that matters more than the output. This is not remote code execution against Jenkins, and I do not want it read that way.
It is in-process. One single-threaded JVM, with a 4 GB heap so that no garbage collection interferes, puts its own objects next to each other and reads the class pointers it needs from its own neighbours. Over the network an attacker gets adjacency only by chance among concurrent requests, and needs an information leak to learn the class pointer to write.
And it ends in a stand-in gadget. The corruption genuinely redirects the call. But the method the call lands in, the one with Runtime.exec in it, I wrote myself, and the harness even calls it directly while warming up. So id running is not the proof; the same call returning NORMAL before the overwrite and the command output after it is. A remote attacker can only redirect to a class the target JVM has already loaded, and I did not search for one that does something useful when called on the wrong object.
What the harness shows is narrower than the advisory and still worth knowing: the bug is a code-execution primitive, not only a way to crash a JVM. Between this and a remote attack on Jenkins lies the per-application work: grooming a multi-threaded heap through HTTP requests, a leak, and a gadget that is already loaded. I have not built that.
The claims, in one table
| Claim | Status | Evidence |
|---|---|---|
| An unauthenticated HTTP request reaches the vulnerable decode in unmodified Jenkins 2.580.2 | Proven | evidence/target-vuln-hs_err.log, capture/exploit.pcap |
| The PoC corrupts the heap of the real product and crashes the JVM, pre-auth, default JVM flags | Confirmed (negative control on Corretto 21.0.13.1.2) | evidence/poc-vuln.txt, evidence/poc-fixed.txt |
The corruption is the stub’s constant store: the faulting class pointer is narrow klass base + 0xa6699aa6 |
Proven | evidence/target-vuln-hs_err.log |
| Remote code execution | Not reached | no chain built against Jenkins; constant bytes, the one code-bearing pointer lands on an unmapped address, and the JVM dies about 140 ms after the burst |
| Heap memory disclosure | Not reached | the smashed length is read signed by Jenkins’ consumers and throws; no response carried heap bytes |
In a separate in-lab harness on the same vulnerable build, the overflow is driven to controlled method dispatch: a C2 arraycopy write inflates an adjacent array’s length (a secondary read/write primitive whose own class stays valid), an out-of-bounds bastore overwrites a neighbouring object’s compressed class pointer, and an invokeinterface call is redirected to a different class |
Proven (in-process harness; negative control clean on Corretto 21.0.13.1.2) | evidence/impact-cmdexec-vuln.txt, evidence/impact-cmdexec-fixed.txt, poc/CmdExecProbe.java |
That redirected dispatch reaches a Runtime.exec() sink and runs a benign command (/usr/bin/id), returning its output: the bug is a code-execution primitive, not DoS-only |
Proven (in-process; stand-in gadget, the exec sink is attacker-authored) | evidence/impact-cmdexec-vuln.txt |
| Remote code execution against Jenkins over the network | Not reached | the in-process chain is not interleaved with multi-threaded heap grooming, a class-pointer info leak and an already-loaded gadget class |
I tested one product, one JDK line, one AMD CPU, plain HTTP with no reverse proxy, and a Jenkins in its first-boot state. Jenkins’ Basic header filter sits in the same place before and after setup, but a busy, configured instance allocates differently, and a proxy that buffers whole requests would release them on its own schedule. I have not tested either.
Detection
The repository has one Suricata rule, and it is experimental / minimally validated: it was tested only against the attack capture from this lab. I make no claim about coverage or false positives beyond that.
1 | alert http any any -> any any ( \ |
It matches an Authorization: Basic value made of one or more full 64-character blocks followed by a short padded tail. On the attack capture it fired 128 times, once per trigger request, and stayed quiet on the roughly 2,000 warm-up requests in the same file.
Its limits are real. It looks only at the Basic header, while the bug is reachable through any field a Java service decodes with java.util.Base64. It needs plaintext HTTP or TLS inspection. Its expression also admits a four-character tail, which is not a trigger. And there is no log-based rule, because I found nothing to key on: Jenkins handles the decoder’s exception the way it handles any malformed header, and the JVM’s fatal error report only exists once the attack has already worked. Details are in detection/README.md.
The fix
JDK-8393212, “Base64 optimization improvements”, adds two instructions and a comment:
1 | __ BIND(L_finalBit); |
If fewer than four characters remain, the stub now jumps to L_bruteForce, its scalar path, which decodes complete groups only and leaves the rest to Java. That is the right place to cut. A tail shorter than four characters cannot contain a complete group, so there is nothing for the vector code to do with it, and output_size can no longer go below zero. The jdk21u change is commit 8e115fb5c7c5, and the same change went into jdk17u, jdk25u and jdk27u. The fixed OpenJDK versions are 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1.
If you cannot upgrade today, either -XX:-UseBASE64Intrinsics or -XX:UseAVX=2 removes the vulnerable path. The first costs you the fast Base64 decoder. The second costs you AVX-512 across the whole JVM.
Advisory and fix
| Date | Event |
|---|---|
| 2026-11-12 | Fix committed to jdk21u (JDK-8393212) |
| 2026-11-17 | CVE-2026-114938 published by Oracle with the November 2026 Critical Patch Update; fixed Corretto builds released |
| 2026-11-18 | Reproduction and write-up |
Advisory: Oracle Critical Patch Update Advisory, November 2026.
Reproduction
Readers can verify every claim in this post from the repository. You need Docker on an x86-64 Linux host whose CPU has AVX-512 VBMI; setup.py checks for it and refuses to continue otherwise.
1 | git clone https://github.com/al4n4n/achilles-heel.git |
The raw output of every run quoted here, the capture and the rule are in the repository: al4n4n/achilles-heel/CVE-2026-114938.