Last modified 2026 Nov 27
Base64 is a scheme for writing arbitrary bytes as printable text. Every three bytes become four characters drawn from a sixty-four-character alphabet. Padding is the trailing equals sign, used when the input does not divide evenly into groups of three. Java ships three decoders: the basic decoder, the URL and filename safe decoder, and the MIME decoder. The first two reject characters outside their alphabet. The MIME decoder ignores them.
An intrinsic is a method the Java virtual machine will, under certain conditions, replace with hand-tuned machine code in place of the compiled Java. A stub is a small block of such machine code. HotSpot, the standard OpenJDK virtual machine, generates its stubs when it starts. A write mask is an AVX-512 feature. It permits a vector store to write only chosen byte positions of a wide register. AVX-512 VBMI is a CPU extension that adds byte-granular shuffles and bit-field extraction to the AVX-512 set. A heap-based buffer overflow (CWE-122) is a write beyond the end of a heap allocation. Here the allocation is a Java array. KEV is the CISA catalog of vulnerabilities known to be exploited. CNA means CVE Numbering Authority. Oracle is the CNA for this record. CVSS is the severity scoring system, and its versions 3.1 and 4.0 are not directly comparable.
The target is the decoded output array. The decoder is given encoded text and must produce a byte array of exactly the right size. For well-formed input, each group of four characters yields three bytes. A final group may carry one or two padding signs and yield fewer. The encoded length and the placement of padding are therefore tightly constrained, and a correct decoder must reject text that breaks those rules.
The Javadoc page for java.util.Base64 that I read states the alphabets and the differing treatment of stray characters in the three decoders. It does not state the padding rules. The account above is the general convention for the encoding, not a statement from that page. The sources agree on one point of scope. The basic and URL decoders reach the vulnerable code, and the MIME decoder does not (Datadog).
Decoding in Java begins at java.util.Base64$Decoder.decode0. On an x86-64 machine that has the required CPU features, HotSpot can substitute a generated stub (_base64_decodeBlock) for the Java loop. The stub generator is generate_base64_decodeBlock in stubGenerator_x86_64.cpp, as the openjdk commit and the Xint runtime patch both name it. Chainguard describes it as hand-written assembly, sitting outside the bounds checks that Java code enjoys.
The hardware requirement is x86-64 with avx512f, avx512bw, avx512vbmi and bmi2, per Hadrian. XBOW adds that AVX-512 must be enabled by both the operating system and the JVM. The AVX-512 VBMI extension supplies, among other things, arbitrary byte permutation across a 512-bit register and extraction of eight-bit fields from bit positions that need not fall on a byte boundary. These are the operations a Base64 decoder wants. The instruction references I read describe the extension's instructions. The sources do not say which of them the stub uses, and I make no claim about that.
Two further conditions apply. The method must have been compiled by the optimizing JIT, so a single request to a freshly started JVM generally does not reach the stub (Hadrian, Ethiack). The JVM must also be running on a chip that has the features. Intel Ice Lake, Sapphire Rapids and later server parts qualify, as do AMD Zen 4 and later. VulnCheck adds that some 2019–2021 Intel client chips qualify while most recent Intel client chips do not. ARM64 is unaffected.
One historical note is worth keeping. The Amazon Corretto 17 changelog records an earlier defect, a data-loss bug in AVX3 Base64 decoding (JDK-8321599, fixed in January 2024). The sources do not connect it to this CVE. It shows that this stub has needed correction before.
The sources describe the healthy path only in outline. Application code calls a decoder. Once the method is hot, the JIT routes bulk input through the stub, which converts wide blocks with vector instructions. A final partial block, the tail, is handled with a masked store, so that only the bytes the tail actually produces are written. Anything the stub declines to handle is left to the ordinary Java loop. That loop validates the input and raises an exception when the text is malformed. The openjdk commit shows the stub already sending very short remainders back to the Java path, so the division of labor between stub and loop is deliberate.
The design rests on one assumption, which is that the count of remaining bytes is sane by the time the mask is built.
When the input has an invalid length together with padding, the stub's arithmetic for the tail goes negative. Chainguard puts it this way: the negative count produces a mask that enables every byte, and the stub then performs a full 64-byte store that runs past the end of the output array. VulnCheck calls the same fault an integer underflow. The sources do not say how the count becomes the mask. A negative value read as an unsigned quantity is the familiar pattern, but that is inference on my part, not something the sources establish.
Two consequences follow. First, the damage is done before any check. Java validates the text only after the store, so the exception that eventually arrives cannot undo the write (Chainguard, Datadog). XBOW's lab observed exactly this order, an out-of-bounds write followed by an IllegalArgumentException, on Temurin 17.0.21+9, and an AVX2 control did not show the fault. Second, how far the write overshoots depends on the size of the output array. The sources are not consistent about the figure. Cyberkendra's arithmetic, a 50-byte array and a 64-byte write called a 62-byte excess, does not agree with itself. A 64-byte store into a 50-byte array overshoots by fourteen. Chainguard states only that the store is a full 64 bytes. This lesson gives no overshoot figure.
What lies beyond the array depends on what the application allocated next. That is why the same bug is a reliable crash in one setting and, according to Calif, something worse in another.