Atklāta informācija par kritisku ievainojamību (CVE-2026-114938) OpenJDK, kas ļauj panākt attālinātu koda izpildi vai procesa atmiņas satura noplūdi uzbrukumos, kuri vērsti uz Java projektiem, kuri izmanto noklusējuma Base64 datu dekoderi. Base64 tiek lietots autentifikācijas protokolos, augšupielādējot failus tīmekļa serverī, e-pastā un daudzās citās situācijās, kur nepieciešama bināro datu pārsūtīšana teksta formātā. Ievainojamība noved pie uzbrucēja kontrolētu datu rakstīšanas atmiņā ārpus piešķirtā bufera un ir izraisīta ar kļūdu assemblera optimizācijās, kurās tiek izmantotas AVX-512 VBMI (Vector Byte Manipulation Instructions) komandas.
Lai izsauktu krīzes pabeigšanu, pietiek ar Base64 virkni, kas sastāv no 64 simboliem 'A', kas beidzas ar simbolu '='. Veiksmīgi uzbrukumi attālinātai koda izpildei, kas darbojas pirms autentifikācijas, ir demonstrēti projektiem Keycloak, Atlassian Jira, Atlassian Confluence, JFrog Artifactory, Jenkins un PingFederate. Pēc autentifikācijas posmā izdevās izmantot Apache Kafka Broker, Apache Solr, Elasticsearch, Gerrit un Spinnaker.
Bet tās ir tikai laikā sākotnējā testēšanā aptverti projekti, un ņemot vērā Base64 formāta plašo lietojumu, problēma var skart daudzus citus sistēmas. Starp citu, ir izstrādāti eksperimentāli eksploitācijas prototipi, kas spēj uzbrukt lietojumprogrammām, kas balstītas uz Apache Struts un Spring Boot ietvariem. Tāpat ir parādīta iespēja veikt uzbrukumu uz klientu Java lietojumprogrammām, kuras veido TLS savienojumu ar serveri, ko kontrolē uzbrucēji. Ekspluatācijas tehnika nav universāla, un katram Base64 pielietojumam ir nepieciešama īpaša eksploitācijas izstrāde, bet pētniekiem izdevās automatizēt šādu eksploitācijas ģenerēšanu, izmantojot mākslīgā intelekta tehnoloģijas.
Vulnerability manifests 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 fixed the vulnerability in yesterday's patch update for its products, which addressed not only this issue but also 10 other vulnerabilities. The vulnerabilities have been 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 fixes in distributions can be assessed on the following pages: Debian, Ubuntu, SUSE/openSUSE, RHEL, Gentoo, Arch, Fedora, FreeBSD.
The attack is only feasible on systems that support AVX-512 VBMI instructions. For Intel systems, the vulnerability is observed on Intel Xeon CPUs Ice Lake, Sapphire Rapids, Emerald Rapids, and Granite Rapids, while for AMD systems, it is seen in EPYC and Ryzen CPUs starting from the Zen 4 microarchitecture. ARM64-based systems 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 for AVX-512 VBMI instruction support in Linux, you can use the command (the output should include 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 by AVX-512 VBMI vector instructions, which allow processing large data blocks in a single cycle using bitmasks. The problem arises from incorrect calculations of string lengths that end with the '=' character, which is used as padding for incomplete blocks when the length of the input data is not a multiple of 3 bytes.
During the processing of '=' characters, the decoder reduces the size of the final string since the last block contains 1 or 2 bytes instead of 3. However, due to an error in the calculation, an integer underflow occurred during subtraction, and the presence of the '=' character at the end of a string of a certain size led to computing a negative value of -1 or -2. These values were then processed as unsigned 64-bit numbers, resulting in a bitmask where all bits are equal to 1 (-1u64).
Lai saglabātu 64 baitus lielā iepakotās virknes atšifrēšanas rezultātu, tika piešķirta 50 baitus liela buferis (Base64 katriem 3 ieejas baitiem kodē 4 simbolus), bet, izmantojot bitu masku -1u64 instrukcijā evmovdqub, apstrādājot pēdējos simbolus, pozīcijā ar nobīdi 48 tika uzrakstīti 64 baiti, nevis 2, t.i., 62 baiti tika rakstīti aiz bufera robežām. Lai izmantotu šo ievainojamību, tiek pārrakstīts lauks ar blakus esošā masīva izmēru, tādējādi uzbrucējs iegūst primitīvus, lai brīvi lasītu un rakstītu atmiņā.
Avots: opennet.lv
