Repository navigation
fix(jres): disable Base64 intrinsics on OpenJDK JREs that are not updated yet - #1561
Conversation
…ated yet Add -XX:-UseBASE64Intrinsics to JAVA_OPTS, and to JDK_JAVA_OPTIONS through a profile.d script, for the OpenJDK JRE while its version is below the first release that fixes CVE-2026-114938. JDK_JAVA_OPTIONS covers java processes that do not use JAVA_OPTS, and Java 8 ignores it, unlike JAVA_TOOL_OPTIONS. Opt out with base64_intrinsics_mitigation.enabled: false, or keep only the JAVA_OPTS part with base64_intrinsics_mitigation.jdk_java_options: false in JBP_CONFIG_OPEN_JDK_JRE.
There was a problem hiding this comment.
🟡 Changes recommended
The mitigation lookup ignores the supported JBP_CONFIG_OPENJDK configuration name, silently leaving the mitigation enabled when users disable it through that name.
1 open issue
What changed in this PR
Adds a temporary Base64 intrinsics mitigation for affected OpenJDK (Liberica) runtimes in the Java buildpack, with version-based expiry and application opt-outs.
Changes:
- Checks the installed JRE version and adds
-XX:-UseBASE64Intrinsicswhen mitigation is needed. - Applies the option through
JAVA_OPTSand an optionalJDK_JAVA_OPTIONSprofile script. - Adds unit tests and documents configuration, coverage, and launcher stderr behavior.
| File | Description |
|---|---|
src/java/jres/openjdk.go |
Enables mitigation for OpenJDK. |
src/java/jres/base64_mitigation.go |
Implements version checks, opt-outs, and option publication. |
src/java/jres/base64_mitigation_test.go |
Tests version boundaries, configuration, and profile behavior. |
src/java/jres/base_jre.go |
Invokes mitigation during JRE finalization. |
docs/jre-open_jdk_jre.md |
Documents mitigation behavior and opt-outs. |
Review effort: Balanced
… too JBP_CONFIG_OPENJDK is a supported configuration name and takes precedence over JBP_CONFIG_OPEN_JDK_JRE in the version selection. The opt-out now uses the same precedence, so disabling the mitigation through that name is no longer ignored.
|
Thanks, good catch. The opt-out now follows the same precedence as the version selection: |
…he Base64 option A plain cf ssh session does not run the profile.d scripts, so JDK_JAVA_OPTIONS is not set there. Apps are not affected: their JVM and custom start commands are started through the launcher.
Checked on a Cloud Foundry test system: a task run with cf run-task gets JDK_JAVA_OPTIONS, like the app JVM.
There was a problem hiding this comment.
🔵 Needs a closer look
Automatic removal of the security mitigation relies on unverified Liberica version cutoffs, requiring human confirmation of fix provenance and release-file version values.
No open issues 🎉
1 resolved since last review
Review effort: Balanced

Adds
-XX:-UseBASE64Intrinsicsfor the OpenJDK (Liberica) JRE while the installed JRE is older than the first release with the fix for CVE-2026-114938 (a heap overflow in the AVX-512 Base64 decoder of HotSpot on x86-64). Temporary: once the manifest ships fixed JREs, the option is no longer added.releasefile of the JRE. Fixed releases: 17.0.21.1, 21.0.13.1 and 25.0.5.1. Not added for Java 8 and 11, for 17.0.0 to 17.0.5, or for Zulu and SapMachine (already fixed in the manifest).JAVA_OPTSand intoJDK_JAVA_OPTIONS(profile.dscript, existing value kept), so custom start commands, tasks andcf sshare covered too.JAVA_TOOL_OPTIONSis not used: a Java 8 JVM refuses to start with the option in it, while Java 8 ignoresJDK_JAVA_OPTIONS.JBP_CONFIG_OPEN_JDK_JRE '{base64_intrinsics_mitigation: {enabled: false}}', or keep onlyJAVA_OPTSwith{base64_intrinsics_mitigation: {jdk_java_options: false}}(thejavalauncher prints aNOTE: Picked up JDK_JAVA_OPTIONSline on stderr). The JRE docs describe both.Tested: unit tests, and Docker (cflinuxfs4, zip from this branch) on Java 8, 11, 17, 21 and 25, with a custom start command, both opt-outs, and the fixed Zulu and SapMachine releases. Also on a Cloud Foundry test system with the build from this branch: the flag is on the command line of the app's JVM,
JDK_JAVA_OPTIONSis in the environment of the app and of acf run-tasktask, and on a host withUseAVX = 3the intrinsic goes fromtrue {default}tofalsewith the option set. Not tested: triggering the overflow itself, and that Liberica uses the same fixed numbers as Zulu and SapMachine (the table is inbase64_mitigation.go). No integration test is added, because the mitigation is temporary.