Skip to content

Mitigate low-likelihood Java4Shell pathway in the docker test stack - #118

Open
Sacha0 wants to merge 2 commits into
mainfrom
sv-claude/java4shell-polaris-mitigation
Open

Sacha0 wants to merge 2 commits into
mainfrom
sv-claude/java4shell-polaris-mitigation

Conversation

@Sacha0

@Sacha0 Sacha0 commented Nov 18, 2026

Copy link
Copy Markdown

tl;dr

Mitigate (very low likelihood) Java4Shell pathway in the docker test stack, and stop publishing its service ports on all host interfaces.

detail

Java4Shell is a heap overflow in the JVM's AVX-512 Base64 decoding fast path. It affects OpenJDK 17.0.6 and later on x86-64 CPUs with AVX-512 VBMI. Fixed JDK builds came out on 2026-11-17.

docker/docker-compose.yml runs apache/polaris:latest. The current latest (built 2026-11-14) is based on Red Hat's ubi9/openjdk-21-runtime 1.24, whose JDK does not have the fix. CI starts this stack on GitHub-hosted ubuntu-latest runners, which can land on CPUs that use the vulnerable fast path. This is test-only infrastructure, and GitHub-hosted runners do not accept inbound connections, so the risk is very low, but nonetheless best mitigated.

Changes, one commit each:

  1. Pass -XX:-UseBASE64Intrinsics to Polaris through JAVA_OPTS_APPEND. The image's run-java.sh adds this variable to the JVM options. The image does not set JAVA_OPTS, which would cause JAVA_OPTS_APPEND to be ignored. The flag turns off the vulnerable fast path. It is safe on CPUs without AVX-512 and on arm64. A comment says to remove it once apache/polaris:latest runs a fixed JDK.
  2. Publish the MinIO (9000, 9001), Polaris (8181, 8182), and local-only Spark (8888, 8080, 10000, 10001) ports on 127.0.0.1 only. Tests connect from the same host through localhost. The services still reach each other by name on the compose network. This commit is separate so it is easy to drop if reviewers prefer.

Follow-up: since the image tag is not pinned, CI will pick up a fixed Polaris image once upstream publishes one. The flag can be removed then.

Sacha0 and others added 2 commits November 18, 2026 12:39
The test stack runs apache/polaris:latest. The images published so far
are built on Red Hat's ubi9/openjdk-21-runtime, whose OpenJDK 21 does
not have the fix for Java4Shell (CVE-2026-114938), a heap overflow in
the JVM's AVX-512 Base64 decoding fast path. GitHub-hosted runners can
land on CPUs with the AVX-512 VBMI support the bug needs.

Pass -XX:-UseBASE64Intrinsics through JAVA_OPTS_APPEND, which the
image's run-java.sh adds to the JVM options. This turns off the
vulnerable fast path. The flag is safe on other x86 CPUs and on arm64.
Remove it once apache/polaris:latest runs a fixed JDK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The docker compose file published MinIO (9000, 9001), Polaris (8181,
8182), and the local-only Spark service (8888, 8080, 10000, 10001) on
all host interfaces. Other hosts on the same network could reach these
services, which use fixed test credentials.

Bind the published ports to 127.0.0.1. The tests connect from the same
host through localhost. The services still reach each other by name on
the compose network.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Sacha0
Sacha0 marked this pull request as ready for review November 18, 2026 20:43
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