Java4Shell (CVE-2026-114938, disclosed 17 Nov 2026) matters on an Android build machine only when two things are true: the CPU is x86-64 with all four of avx512f, avx512bw, avx512vbmi and bmi2, and the JDK is OpenJDK 17.0.6 or newer without the November fix. Apple silicon Macs are out of scope, and so are Android phones, which run ART rather than HotSpot. The fix ships in OpenJDK 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1. Until a box is patched, put -XX:-UseBASE64Intrinsics in org.gradle.jvmargs and in JAVA_TOOL_OPTIONS on CI, and keep -XX:UseAVX=2 out of any gradle.properties that an ARM machine also reads.
Everything below was checked on an Ubuntu 24.04 test server with the distro’s OpenJDK 21.0.13.0.3 and Gradle 8.14.3, against the HotSpot sources in openjdk/jdk21u.
Why we did this: we build Android for React Native banking and TV apps, and the JDK is the one piece of server software that every build laptop, CI runner and Gradle daemon carries. The question a mobile team needs answered fast is not “is Java vulnerable” but “which of my machines matter”.
What is affected, from the sources
| Item | What the sources say |
|---|---|
| The bug | Memory corruption in the HotSpot x86-64 Base64 intrinsic, on the AVX-512 VBMI path (Calif write-up) |
| Severity | CVSS 4.0 9.2 per Calif; Oracle’s November 2026 Critical Security Patch Update lists it too |
| CPU | x86-64 with AVX-512 VBMI; “ARM64 CPUs are not affected” (Calif) |
| JDK lines | OpenJDK 17.0.6 and newer, including 21, 25 and 27. Standard 8 and 11 are not listed (Qualys, Cycode) |
| Fixed OpenJDK | 17.0.21.1, 21.0.13.1, 25.0.5.1, 27.0.1.1. We confirmed the jdk-*.1-ga tags exist in the openjdk/jdk17u, jdk21u and jdk25u repositories |
| Vendors | Corretto 17.0.21.1.2 and 21.0.13.1.2; Zulu 21.0.13.1+2. Temurin’s November status issue tracks its builds; Red Hat and Microsoft had no fixed build in Cycode’s table on 18 Nov |
| Named targets | Jenkins and Keycloak, both listed by Calif as pre-auth remote code execution |
| Android devices | None of the advisories we read list ART or Android devices |
The Jenkins line is the one to act on first. A Gradle daemon is not a network service, but a Jenkins controller on an affected x86-64 host is, and many Android teams run exactly that.
Step 1: is this machine in scope?
Calif’s check reads the CPU flags. The output must contain all four:
grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' \
| grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'
On an Apple silicon Mac there is nothing to check: uname -m prints arm64. On an Intel Mac there is no /proc/cpuinfo; sysctl machdep.cpu.leaf7_features lists the same leaf-7 flags (look for AVX512F, AVX512BW, AVX512VBMI and BMI2). Hosted CI runners are the ones that surprise people: recent Intel Xeon generations have VBMI, and our test server’s Xeon had all four.
Step 2: find every JDK on the box
A build host rarely has one JDK. There is the system package, the one JAVA_HOME points to, toolchains Gradle downloaded under ~/.gradle/jdks, the JetBrains Runtime bundled with Android Studio (jbr/), and the hosted tool cache on GitHub-style runners. This script walks those places, de-duplicates symlinks, and prints each JDK’s version and whether the Base64 intrinsic is on:
#!/usr/bin/env bash
# Java4Shell exposure check for build and CI hosts (defensive only)
echo "arch: $(uname -m)"
if [ "$(uname -m)" != "x86_64" ]; then echo "not x86-64: out of scope"; exit 0; fi
need="avx512f avx512bw avx512vbmi bmi2"; have=""
for f in $need; do grep -qw "$f" /proc/cpuinfo && have="$have $f"; done
echo "cpu flags:$have"
[ "$(echo $have | wc -w)" -eq 4 ] && echo "cpu: has all four flags" || echo "cpu: missing flags, out of scope"
for j in /usr/lib/jvm/*/bin/java "$JAVA_HOME/bin/java" \
~/.gradle/jdks/*/bin/java /opt/android-studio/jbr/bin/java \
~/android-studio/jbr/bin/java /opt/hostedtoolcache/Java_*/*/x64/bin/java; do
[ -x "$j" ] || continue
r=$(readlink -f "$j"); case " $seen " in *" $r "*) continue;; esac; seen="$seen $r"
v=$(env -u JAVA_TOOL_OPTIONS -u _JAVA_OPTIONS "$j" -XshowSettings:properties -version 2>&1 | awk -F'= ' '/java.runtime.version/{print $2}')
b=$(env -u _JAVA_OPTIONS "$j" -XX:+PrintFlagsFinal -version 2>/dev/null | awk '/ UseBASE64Intrinsics /{print $4}')
echo "$r $v base64-intrinsic=$b"
done

Real output from our test server: all four CPU flags, an affected 21.0.13.0.3 build, and the intrinsic switched off once JAVA_TOOL_OPTIONS carries the flag.
Two findings from running it. First, the distro JDK is easy to forget because nothing in the Android toolchain installed it. On 21 Nov, after apt-get update, Ubuntu 24.04’s noble-updates already offered 21.0.13.1+2-1~24.04.1 for openjdk-21-jre-headless, the fixed build; a machine that has not run its updates since 17 Nov is still on 21.0.13.0.3. Second, no advisory we read mentions the JetBrains Runtime inside Android Studio. If Android Studio runs on an affected x86-64 Linux or Windows machine, run its jbr/bin/java -version and compare against JetBrains’ own release notes before assuming either way.
Step 3: patch where you can
Move each JDK to the fixed build of its line: 17.0.21.1, 21.0.13.1, 25.0.5.1 or 27.0.1.1 (vendor suffixes differ, for example Corretto’s 21.0.13.1.2). For Gradle toolchains, the download lives under ~/.gradle/jdks; after the vendor publishes, delete the old toolchain folder on CI caches so the next build fetches the new one instead of reusing the cached JDK. On Ubuntu 24.04 the fixed package is one command:
sudo apt-get update && sudo apt-get install --only-upgrade openjdk-21-jre-headless openjdk-21-jdk-headless
java -version # expect 21.0.13.1
For Jenkins, patch the controller’s JDK first, then the agents.
Step 4: the two mitigation flags, read in the source
Calif and Qualys give two stopgaps: -XX:-UseBASE64Intrinsics (Qualys calls it the preferred one) and -XX:UseAVX=2. We read both in the jdk21u HotSpot sources to see what each actually turns off.

The excerpt is trimmed from vm_version_x86.cpp and stubGenerator_x86_64.cpp in openjdk/jdk21u.
UseBASE64Intrinsicsis defined in the sharedsrc/hotspot/share/runtime/globals.hpp, and the AArch64 port turns it on by default too. Every HotSpot build knows the flag, so-XX:-UseBASE64Intrinsicsis safe to commit in a file that Apple silicon laptops also read. Base64 then runs as plain Java code.UseAVXis defined only insrc/hotspot/cpu/x86/globals_x86.hpp. WithUseAVX < 3,vm_version_x86.cppclears the AVX-512 feature bits, includingCPU_AVX512_VBMIandCPU_AVX512BW, and the decode stub only enters its 512-bit loop when both are present. The Base64 intrinsic stays on, through its AVX2 path. The cost is that the JIT loses every AVX-512 code path, not only Base64. And because ARM builds do not define the flag, Calif and Cycode both note that an ARM JVM refuses to start with it.
-XX:+PrintFlagsFinal confirms each flag took effect, and shows where it came from:
$ java -XX:-UseBASE64Intrinsics -XX:+PrintFlagsFinal -version | grep -E ' UseAVX | UseBASE64Intrinsics '
int UseAVX = 3 {ARCH product} {default}
bool UseBASE64Intrinsics = false {product} {command line}
$ java -XX:UseAVX=2 -XX:+PrintFlagsFinal -version | grep -E ' UseAVX | UseBASE64Intrinsics '
int UseAVX = 2 {ARCH product} {command line}
bool UseBASE64Intrinsics = true {product} {default}
On cost: a 1 MB Base64.getDecoder().decode() loop on our test server ran between 1.1 and 1.3 GB/s with the default flags, with UseAVX=2 and with the intrinsic off, which is inside its run-to-run noise. For a Gradle build, Base64 is not where the time goes, so we would not let performance decide this.
Step 5: where the flag goes for Gradle
A Gradle build starts several JVMs, and each needs the flag:
- The Gradle daemon:
org.gradle.jvmargsingradle.properties. Setting it replaces Gradle’s default JVM arguments, so keep your-Xmx. - The Kotlin compile daemon:
kotlin.daemon.jvmargs, which is separate from the Gradle daemon. - Test JVMs and anything a task forks: they do not inherit
org.gradle.jvmargs. - CI as a whole:
JAVA_TOOL_OPTIONSreaches every JVM the job starts, including the Gradle client and forked test JVMs.

The flag that is safe on every architecture goes in the committed file; -XX:UseAVX=2, if you use it at all, belongs only in x86-64 runner configuration.
To confirm the daemon really got it, this throwaway task prints the daemon’s own arguments:
// build.gradle.kts
tasks.register("jvmFlags") {
doLast {
val args = java.lang.management.ManagementFactory.getRuntimeMXBean().inputArguments
println("Gradle daemon JVM: " + System.getProperty("java.version"))
println("Base64 intrinsic off: " + args.contains("-XX:-UseBASE64Intrinsics"))
}
}
$ gradle -q jvmFlags
Gradle daemon JVM: 21.0.13.0.3
Base64 intrinsic off: true
A running daemon keeps its old arguments, so run ./gradlew --stop after changing gradle.properties. One side effect of JAVA_TOOL_OPTIONS: the JVM prints Picked up JAVA_TOOL_OPTIONS: ... on stderr, which can confuse scripts that parse java -version output.
What to check on your own machines
- Run the CPU flag check on every x86-64 CI runner, Jenkins controller and agent, and any Linux or Windows workstation with Android Studio. Anything without all four flags, and every Apple silicon Mac, is out of scope.
- Run the JDK inventory on the machines that are in scope; note each JDK 17.0.6 or newer that is not on a
.1November build. - Patch Jenkins controllers and any Java service that faces a network first, then build agents, then Gradle toolchain caches.
- Until patched, commit
-XX:-UseBASE64Intrinsicstoorg.gradle.jvmargsandkotlin.daemon.jvmargs, and set it inJAVA_TOOL_OPTIONSon x86-64 runners. Stop running daemons. - Remove the flag once every JDK in the inventory reports a fixed build, so the intrinsic comes back.



