Creuto is now an OpenAI Select Partner Read More

Software Architecture & Technical

Java4Shell workaround: roll out one JVM flag and prove it

The Java4Shell workaround is -XX:-UseBASE64Intrinsics. How to push it to every pod and ECS task with JAVA_TOOL_OPTIONS and verify it with jcmd.

Java4Shell workaround: roll out one JVM flag and prove it

The Java4Shell workaround is a single JVM startup option, -XX:-UseBASE64Intrinsics, and it does nothing until every Java process restarts with it. If a JDK upgrade cannot clear change control this week, this post covers how to push that flag into every pod, ECS task and vendor-bundled JVM through JAVA_TOOL_OPTIONS, which variant to skip, and how to prove the running process actually picked it up.

Most of the work is in the rollout. The flag is the easy part, and sources still disagree on how to spell it.

  • CVE: CVE-2026-114938, disclosed by Calif on 17 November 2026, with Oracle's patch released the same day.
  • Severity: 9.2 under CVSS 4.0 per Calif; 8.1 under CVSS 3.1 with high attack complexity per Oracle, as Tenable summarizes.
  • Exploitation: Tenable reported no known exploitation as of 17 November, and the CVE was not in CISA's KEV catalog.
  • Exposure condition: an affected JDK on an x86-64 CPU with AVX-512 VBMI. OX Security says ARM servers, older x86 servers, Java 8 and Java 11 are not affected.

The Java4Shell workaround: -XX:-UseBASE64Intrinsics, not -XX:UseAVX=2

Calif lists two startup options that close the vulnerable path. -XX:-UseBASE64Intrinsics turns off the hardware-accelerated Base64 routine, the HotSpot intrinsic where the bug lives. -XX:UseAVX=2 disables AVX-512 altogether. Qualys calls the first one preferred, and OX describes it as disabling only the vulnerable decoder while leaving other AVX-512 optimizations alone.

Choose the narrow flag for a reason that matters more in a mixed fleet than the performance difference. Calif and OX both warn that OpenJDK on ARM does not recognize -XX:UseAVX=2 and will fail to start. Put that value in a cluster-wide environment variable and every Graviton or Ampere node turns a mitigation into an outage.

Do you need -XX:+UnlockDiagnosticVMOptions?

Cloudflare's remediation step suggests -XX:+UnlockDiagnosticVMOptions -XX:-UseBASE64Intrinsics as a temporary workaround. Calif, Qualys and Tenable give the flag on its own. The OpenJDK source settles it: in HotSpot's globals.hpp, UseBASE64Intrinsics is declared as a plain product flag, while UnlockDiagnosticVMOptions exists to unlock flags marked DIAGNOSTIC. You do not need the unlock option for this flag. If your runbooks already carry Cloudflare's version, there is no reason to roll back a working change, but don't copy it into new ones.

Getting the flag into every JVM: JAVA_TOOL_OPTIONS or JDK_JAVA_OPTIONS

JAVA_TOOL_OPTIONS is the right vehicle for a fleet-wide change. The JVM TI specification says it exists because the command line cannot always be reached, "for example in embedded VMs or simply VMs launched deep within scripts", and that JNI_CreateJavaVM prepends its contents to the VM's options. That matters for software you install rather than build, such as Jira, Confluence, Jenkins and Artifactory, all on Calif's list of products with demonstrated pre-auth RCE, where you may not control the java command line.

MechanismWhat reads itWhat catches teams out
JAVA_TOOL_OPTIONSAny JVM created through JNI_CreateJavaVM, including ones started by wrappersPrepended, so a later command-line flag wins; disabled on Unix when effective and real user IDs differ; agents already use it, so append rather than overwrite
JDK_JAVA_OPTIONSThe java launcher only, per the java man pageMisses JVMs embedded or started without the java command
Flag in the entrypoint or Helm valuesThe one process you editExplicit and reviewable, but one change per service and easy to miss a sidecar or batch job

The append rule is the one that bites. The JVM TI spec says multiple tools may use the variable, "so the variable should not be overwritten". If an APM agent is already loaded through JAVA_TOOL_OPTIONS, setting it to only the Java4Shell flag silently removes your monitoring during an incident.

Java4Shell mitigation in Kubernetes

In Kubernetes, the environment variable belongs in the pod template. The Deployment documentation describes updating the PodTemplateSpec as what creates a new ReplicaSet and replaces pods at a controlled rate, so the env change is also your rolling restart. For many charts that means one line in Helm values per release. A mutating admission webhook can inject the variable cluster-wide, but it acts only when pods are created, so you still need a rollout of every Java workload before the mitigation is real.

Roll it to every node type, not just the AVX-512 ones. Pods reschedule, and the CPU a pod lands on next week is not the one you checked today. Cloudflare took the same view: it began rolling out the option about an hour after patches were published and applied it to all machines regardless of hardware, even though it found most of its Java workloads were not scheduled on vulnerable systems.

ECS task definitions and vendor-bundled JDKs

On ECS, add the variable through the environment parameter in the container definition, which AWS maps to docker's --env. That creates a new task definition revision, and running tasks keep the old one until the service deploys replacements. Vendor appliances that bundle their own JDK need the same check: the flag only helps if that bundled JVM reads the environment you set.

How to verify UseBASE64Intrinsics is disabled

Verify the running process, not the deployment manifest. Qualys puts it plainly: a patch or a flag takes effect only when the JVM restarts, so check the process and not only the installed package. OX makes a related warning that the version java -version reports on the host may not be the one the service uses.

  1. Find the Java process ID inside the container or on the host.
  2. Run jcmd <pid> VM.flags -all | grep UseBASE64Intrinsics. The jcmd documentation says VM.flags prints the VM flag options and their current values, and -all includes every flag the VM supports.
  3. Expect false. If it reads true, look for a command-line flag that overrides the environment, a wrapper that clears the environment, or a pod that never restarted.
  4. Record which hosts actually need it with Calif's check, grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' | grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'. A host is exposed only if all four flags appear.

Distroless and JRE-only images may not ship jcmd. In that case run it from a debug container that shares the process namespace, or check a canary pod built from a full JDK image before trusting the rollout.

Does a WAF stop Java4Shell? Only part of the traffic

A WAF narrows the window but does not replace the flag. Cloudflare shipped six Managed Ruleset rules for malformed Base64 in headers, query values, bodies, path segments, JWT components and WebAuthn values, on Pro, Business and Enterprise plans. Their default action is Log, not Block, because blocking could cause false positives on legitimate Base64 traffic.

Cloudflare also lists what the WAF cannot see: Base64 wrapped in another encoding or compression, non-HTTP protocols such as Kafka, outbound TLS connections to a malicious server, and internal traffic that never crosses the edge. CISA's alert recommends input-size limits as a compensating control, but Qualys notes that size limits alone will not stop this bug because the malformed input is very short, and tells teams not to rely on a reverse proxy as a control.

When the flag is the wrong call

Treat the flag as a bridge, not a fix. Tenable notes that neither Oracle nor the OpenJDK Vulnerability Group mentions these options; they come from the researchers. Qualys says neither option replaces the patch, and Oracle's fixed builds are 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1. If you run Oracle JDK 21, check the Oracle JDK 21 license change from 21.0.13 before that upgrade becomes your plan. For other distributions, check your vendor's own advisory; Tenable says each releases fixes on its own schedule.

The flag is also the wrong place to spend a change window if your fleet is entirely ARM64 or pre-AVX-512 x86, because those hosts never run the vulnerable code. OX estimates that fewer than 0.12% of JVM instances worldwide are exposed to RCE and about 0.8% to crashes, while noting its gates are treated as independent, which likely understates risk. Mitigating without upgrading also leaves you carrying a non-vendor setting until the patch lands, the same trade-off we weighed for VIPS_BLOCK_UNTRUSTED in Rails.

Rolling the Java4Shell mitigation out before the weekend

The order that holds up: append -XX:-UseBASE64Intrinsics to JAVA_TOOL_OPTIONS in every pod template and task definition, restart everything, confirm with jcmd on a sample of each workload, then schedule the vendor-patched JDK through normal change control. Keep -XX:UseAVX=2 out of shared configuration unless you know no ARM node will ever read it.

If your clusters mix Graviton and x86 nodes, run vendor-bundled JVMs you cannot rebuild, or lack the inventory to know which pods restarted, our DevOps and cloud engineering team can help you get the flag rolled out and verified across Kubernetes and ECS, then plan the JDK upgrade that removes it.

Frequently asked questions

The Java4Shell workaround is the JVM startup option -XX:-UseBASE64Intrinsics, which turns off the accelerated Base64 routine where CVE-2026-114938 lives. It only takes effect after each Java process restarts, and Qualys notes that it does not replace installing your vendor's patched JDK build.

Disabling the Base64 intrinsic fleet-wide works best by appending -XX:-UseBASE64Intrinsics to JAVA_TOOL_OPTIONS in every pod template or ECS task definition, then restarting all workloads. Append to the variable rather than overwriting it, because monitoring agents often load through the same variable.

The -XX:UseAVX=2 option blocks the Java4Shell path by disabling AVX-512 entirely, but it is the blunter choice. Calif and OX warn that OpenJDK on ARM does not recognize the option and fails to start, so it should never go into configuration shared with Graviton or Ampere nodes.

A WAF stops only part of the Java4Shell attack surface. Cloudflare's Managed Ruleset rules default to logging, and Cloudflare says a WAF cannot see nested encodings, Kafka and other non-HTTP protocols, outbound TLS connections, or internal service traffic. Use it alongside the JVM flag, not instead of it.

UnlockDiagnosticVMOptions is not required for UseBASE64Intrinsics. Cloudflare's guidance includes it, but the OpenJDK source declares UseBASE64Intrinsics as an ordinary product flag, and the unlock option only gates flags marked as diagnostic. Calif, Qualys and Tenable all give the flag on its own.

The Java4Shell mitigation is verified on the running process, not the manifest. Run jcmd with the process ID and VM.flags -all, then check that UseBASE64Intrinsics reads false. A true value usually means the pod never restarted or a command-line flag overrides the environment variable.

Written by

Akash Mohapatra

Akash Mohapatra

Co Founder & Director

18 Nov 2026

·

8 min read

Share

LET'S CONNECT

Connect with Creuto!

Ready to take the first step towards unlocking opportunities, realizing goals, and embracing innovation? We're here and eager to connect.