Information has been revealed about a critical vulnerability (CVE-2026-114938) in OpenJDK, which allows for remote code execution or memory content leakage in Java projects that use the standard Base64 data decoder. Base64 is used in authentication protocols, file uploads to web servers, email, and many other situations where binary data needs to be transmitted in textual form. This vulnerability leads to writing data controlled by an attacker to memory outside the allocated buffer and is caused by an error in assembler optimizations using AVX-512 VBMI (Vector Byte Manipulation Instructions).
To trigger the application's emergency shutdown, it's sufficient to pass a Base64 sequence consisting of 64 'A' characters, ending with the '=' character. Successful remote code execution attacks occurring before authentication have been demonstrated against Keycloak, Atlassian Jira, Atlassian Confluence, JFrog Artifactory, Jenkins, and PingFederate. After authentication, Apache Kafka Broker, Apache Solr, Elasticsearch, Gerrit, and Spinnaker have been exploited.
However, these are only the projects covered in initial testing, and given the widespread use of the Base64 format, the issue could potentially affect many other systems. Among other things, prototypes of exploits have been created that can attack applications based on the Apache Struts and Spring Boot frameworks. There is also evidence of the possibility to attack client-side Java applications establishing a TLS connection with proxy server, which are controlled by the attackers. The exploitation technique is not universal, and a special exploit needs to be created for each use case of Base64, but researchers have managed to automate the generation of such exploits with the help of AI.
The vulnerability appears starting from OpenJDK 17.0.6 and affects derivative Java distributions, including Oracle Java SE, Oracle GraalVM, Amazon Corretto, Eclipse Temurin, Microsoft OpenJDK, Azul Zulu, BellSoft Liberica, SAP SapMachine, and Red Hat OpenJDK. Oracle has addressed the vulnerability in yesterday's patch update for its products, which fixed 10 vulnerabilities in addition to the one discussed. The vulnerabilities are resolved in Java SE releases 27.0.1.1, 25.0.5.1, 21.0.13.1, 17.0.21.1, 11.0.33.1, and 8u513. The status of vulnerability remediation in various distributions can be assessed on the following pages: Debian, Ubuntu, SUSE/openSUSE, RHEL, Gentoo, Arch, Fedora, FreeBSD.
The attack is only possible on systems that support the AVX-512 VBMI instructions. For Intel systems, vulnerabilities have been observed on Intel Xeon CPUs Ice Lake, Sapphire Rapids, Emerald Rapids, and Granite Rapids, while for AMD systems, on EPYC and Ryzen CPUs, starting from the Zen 4 microarchitecture. Systems based on ARM64 architecture are not affected by the issue. As a workaround to block the vulnerability, OpenJDK can be launched with the flag ‘-XX:-UseBASE64Intrinsics’ to disable assembler optimizations or ‘-XX:UseAVX=2’ to disable AVX-512.
To check support for AVX-512 VBMI instructions in Linux, the following command can be used (the output should contain the 4 flags avx512f, avx512bw, avx512vbmi, and bmi2): grep -m1 ‘^flags’ /proc/cpuinfo | tr ‘ ‘ ‘\n’ | grep -E ‘^(avx512f|avx512bw|avx512vbmi|bmi2)$’
The vulnerability exists in the assembler implementation of the Base64 decoder, accelerated using AVX-512 VBMI vector instructions, which allow processing large blocks of data in a single cycle using bit masks. The issue arises due to incorrect size calculation of strings ending with the ‘=’ symbol used as a padding for incomplete blocks when the length of the input data is not a multiple of 3 bytes.
During the processing of the ‘=’ character, the decoder reduces the size of the resulting string since the final block contains 1 or 2 bytes instead of 3, but due to an error in the calculation, an integer underflow occurred during subtraction, and the presence of the ‘=’ symbol at the end of a string of a certain size led to the computation of a negative value -1 or -2. Subsequently, these values were processed as unsigned 64-bit numbers, resulting in a bit mask where all bits are equal to 1 (-1u64).
To store the decoding result of a 64-byte packed string, a buffer of 50 bytes was allocated (in Base64, every 3 input bytes are encoded into 4 characters). However, when specifying the bitmask -1u64 in the evmovdqub instruction while processing the final characters, 64 bytes were written at an offset position of 48 instead of 2, meaning 62 bytes were written beyond the buffer. This vulnerability allows for overwriting the field with the size of the following array, thereby providing attackers with primitives for arbitrary reading and writing in memory.
Source: opennet.ru
