Skip to content

fix(security): Corretto 21.0.13.1 runtime in yaci-cli image for CVE-2026-114938 (Java4Shell) - #224

Open
satran004 wants to merge 1 commit into
mainfrom
fix/java4shell-main
Open

satran004 wants to merge 1 commit into
mainfrom
fix/java4shell-main

Conversation

@satran004

Copy link
Copy Markdown
Member

Summary

Forward-port of the CVE-2026-114938 ("Java4Shell") runtime fix in PR #223 (0.12.1 on release/0.12.x). main has the same java-setup target. The bloxbean/yaci-cli image copies its JRE from the floating eclipse-temurin:21-jre image, and Temurin has no fixed build yet. This PR takes the JRE from the digest-pinned Amazon Corretto 21.0.13.1 image instead, at the same /opt/java/openjdk path, so JAVA_HOME and PATH don't change. Only applications/cli/Earthfile changes. config/version is left alone, so set the next version when cutting the release from main.

Before After
java-setup source eclipse-temurin:21-jre (floating; 0.12.0 shipped Temurin 21.0.12.1+1) amazoncorretto:21.0.13-al2023-headless@sha256:71b00527…
JRE in bloxbean/yaci-cli vulnerable Corretto 21.0.13.1.2, build 21.0.13.1+2-LTS (fixed)
Image OS / JAVA_HOME ubuntu:22.04, /opt/java/openjdk unchanged

Why the copy needs a RUN step

In the Corretto image, /usr/lib/jvm/java-21-amazon-corretto is an alternatives symlink to an arch-specific directory. Its lib/security/cacerts also links to /etc/pki/java/cacerts, which doesn't exist on Ubuntu. java-setup therefore resolves the directory, copies it, puts the real truststore file in place of the cacerts symlink, and runs java -version as a build-time check.

CVE, why Corretto, and what isn't affected

All of this is the same as PR #223. In short:

  • The bug is in HotSpot's AVX-512 VBMI Base64 decode intrinsic (x86-64 with AVX-512 VBMI only). It's fixed in OpenJDK 21.0.13.1, released Nov 17, 2026, and Corretto lists the CVE as fixed.
  • The image stays on Java 21.
  • The native binaries (yaci-cli, Yaci Store, Yano) are built with -march=compatibility. The published 0.12.0 linux-x64 binaries disassemble to 0 VBMI instructions and 0 zmm uses.
  • The devkit zip, the CLI zips/npm packages and the viewer image don't contain a JRE.

Test plan

main and v0.12.0 have byte-identical applications/cli/Earthfiles before this change, so the 0.12.1 verification applies here too:

  • earthly built the real +java-setup target and copied it into ubuntu:22.04 as docker-build does, on linux/arm64 and linux/amd64. Both report Corretto-21.0.13.1.2 (build 21.0.13.1+2-LTS), java.home=/opt/java/openjdk, and cacerts holds 135 certs.
  • Smoke test, arm64, in yaci_cli_mode=java: create-node -o --start started the devnet, the cluster API and the Yaci Store API returned 200, there were 0 errors, and an HTTPS request from the new JRE returned 200.
  • Full multi-arch +build runs in CI at the next release.

Interim mitigation

JDK_JAVA_OPTIONS=-XX:-UseBASE64Intrinsics in config/env. This only matters when the JVM is in use.

🤖 Generated with Claude Code

…026-114938

The yaci-cli image copied its JRE from the floating eclipse-temurin:21-jre
image, which is vulnerable to CVE-2026-114938 (Java4Shell). Temurin has no
fixed build yet.

java-setup now takes the JRE from the digest-pinned
amazoncorretto:21.0.13-al2023-headless image (Corretto 21.0.13.1.2) and makes
a self-contained copy at /opt/java/openjdk: the alternatives symlink is
resolved and the cacerts symlink into /etc/pki is replaced with the real
truststore file, so TLS keeps working on the ubuntu:22.04 base. JAVA_HOME and
PATH are unchanged. Same change as the 0.12.1 patch release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copy link
Copy Markdown

Initial automated review · Aster

Hi @satran004, thanks for the PR! 🙏 This is an automatic first check by an AI reviewer. It does not replace maintainer review and may be wrong.

Reviewed commit: 2409d9936fbbb16b4cd0b036ccac030b702a2824

Suggestions:

  • applications/cli/Earthfile:70 — Could we automate a Java startup and HTTPS smoke check in the final Ubuntu image on both architectures to verify the copied runtime and truststore?

Not tested: I did not build or run the images, verify the pinned registry digest, or reproduce the reported smoke tests.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants