With the recently disclosed Java4Shell vulnerability (CVE-2026-114938), we had to apply a temporary mitigation to some of our Java applications.
For context, our setup is pretty straightforward. We have applications built through Jenkins, packaged into Docker images, and deployed as containers.
No Kubernetes, no fancy orchestration. Just good old Docker. :)
One of the recommended mitigations for Java4Shell is disabling the JVM's optimized Base64 implementation using:
-XX:-UseBASE64Intrinsics
So, we add the flag to our JVM startup configuration, rebuild, redeploy, and we're done.
But how do we know the flag actually made it to the running JVM?
Well, there's a handy little tool for that: JConsole.
How to check using JConsole#
JConsole is a monitoring and management tool included with the JDK. Among other things, it lets you inspect the JVM arguments used to start a Java application.
Here's how:
- Open a terminal on a machine with the JDK installed.
- Run
jconsole. - A graphical interface opens, allowing you to connect to a running Java process.
- Select your application and connect.
- Navigate to the VM Summary tab (called VM in some JDK versions).
- Look for the VM arguments section.
You should see something like:
-XX:-UseBASE64Intrinsics
And that's it! You can confirm that the JVM received the argument.
For an additional check, you can navigate to MBeans → com.sun.management → HotSpotDiagnostic → Operations → getVMOption, enter UseBASE64Intrinsics, and check that its value is false.
A small Docker caveat: If your application runs inside a container, it won't necessarily appear in JConsole's local process list. You'll need access to the JVM, either through a supported local attachment or a properly configured JMX connection.
Why is this useful?#
Because adding a flag to a Dockerfile, Jenkins pipeline, or startup script doesn't necessarily mean it was applied to the Java process that's actually running.
And this isn't limited to security mitigations. The same approach works when checking memory settings, garbage collection options, or other JVM arguments.
The takeaway? Don't just trust your configuration. Check your running JVM.
One last note: disabling Base64 intrinsics is a temporary mitigation for Java4Shell, not a replacement for updating to a patched JDK.
If you want the explanation behind the mitigation, I also wrote Java4Shell explained: how can Base64 corrupt the JVM?, including the HotSpot code and diagrams.