Java4Shell: A Cross-Platform Guide to Detecting and Mitigating CVE-2026-114938
Java4Shell (CVE-2026-114938): How to Identify and Fix Vulnerable Java on Windows and Linux
Summary: Java4Shell (CVE-2026-114938) is a heap overflow in the Base64 decoder of the Java runtime itself. On x86-64 servers with AVX-512 VBMI CPUs, a short malformed Base64 string reaching java.util.Base64 can corrupt heap memory, and researchers have turned that into remote code execution without credentials against products such as Jira, Confluence, Artifactory, Jenkins and PingFederate. Oracle and the OpenJDK Vulnerability Group published fixes on November 17, 2026.
CISA update (November 17–18, 2026): CISA strongly urges organizations to patch immediately. Identify every JDK and Java runtime — including those bundled with third-party applications, container images and appliances, which often do not appear as separate inventory entries — apply vendor patches with internet-facing systems first, and if patching cannot happen yet, use compensating controls at the application boundary while you finish the update.
The challenge is finding every JVM. The flaw is in the runtime, so dependency scans will not show it. The Java to fix may be the package-managed one, a ZIP install, a runtime bundled inside an application, a container image or a build agent, and it may sit on an end-of-life operating system.
What to do, in order:
- Tier 1, Identify: find every JVM and the CPU it runs on.
- Tier 2, Mitigate: start exposed services you cannot patch yet with
-XX:-UseBASE64Intrinsics, with a rollback path. Add CISA compensating controls (Base64 validation, input-size limits, limit unauthenticated access) where needed. - Tier 3, Fix: install your vendor's fixed build and restart the JVM.
- Tier 4, Verify: confirm the fix, or the option, in the running process.
On Windows, Mitigate-Java4Shell.ps1 can assist with tiers 1 and 2 and verification after it has been tested; default mode is Discover only.
Overview
java.util.Base64-XX:-UseBASE64Intrinsics (any architecture) or -XX:UseAVX=2 (x86-64 only)Exposure: Who Is Actually Vulnerable
All four conditions must be true on the same JVM. The first is a fleet-wide inventory problem and the second a hardware lookup. Reachable Base64 input is common on services that authenticate users or accept uploads. The fourth condition is that the vulnerable Base64 intrinsic is enabled and selected by the JVM — high application activity alone does not prove that.
Checking the CPU
# Linux: all four flags must be listed (the count below must be 4) grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' | grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$' | sort -u | wc -l # Any OS: JVM capability level and whether Base64 intrinsics are enabled # UseAVX=3 means the JVM selected AVX-512 as its max vector level. That is not proof # that the vulnerable Base64 intrinsic was compiled or executed on a given call path. java -XX:+PrintFlagsFinal -version 2>&1 | grep -E 'UseAVX|UseBASE64Intrinsics'
# Windows, PowerShell 7.4 or later (.NET 8) # Check all four KBA dependencies: AVX-512F, AVX-512BW, AVX-512VBMI, and BMI2. # Avx512F implies the foundation; BMI2 is exposed via Bmi2. Avx512BW/Vbmi cover BW and VBMI. [System.Runtime.Intrinsics.X86.Avx512F]::IsSupported -and [System.Runtime.Intrinsics.X86.Avx512BW]::IsSupported -and [System.Runtime.Intrinsics.X86.Avx512Vbmi]::IsSupported -and [System.Runtime.Intrinsics.X86.Bmi2]::IsSupported
UseAVX and UseBASE64Intrinsics show which optimizations the JVM enabled at startup. Neither proves that the vulnerable Base64 intrinsic actually ran for a given request. Treat all three separately when assessing exposure.Hardware that meets the requirement
| Vendor | CPU generations with AVX-512 VBMI | Typical places you find them |
|---|---|---|
| Intel | Xeon Ice Lake, Sapphire Rapids, Emerald Rapids, Granite Rapids | Current-generation on-premises servers and most recent general-purpose cloud instance families |
| AMD | EPYC and Ryzen, Zen 4 and newer | Recent cloud instance families, newer on-premises servers, high-end workstations |
| Apple Macs | Apple silicon is ARM64 and not exposed. Intel Macs are exposed only if the CPU reports AVX-512 VBMI. Public reports say the iMac Pro and the 2019 Mac Pro have AVX-512 but not VBMI, and that Intel code running under Rosetta sees AVX2 at most. Confirm on the Mac itself (see the macOS commands below). | Developer laptops and desktops, build Macs, Mac mini servers |
| Not exposed | ARM64 (Graviton-class, Apple silicon, Ampere); older Xeon and EPYC without VBMI | Older fleets and ARM nodes. Re-check after any hardware refresh. |
Affected and Fixed Versions
| Java line | Java4Shell status | Oracle affected build | Oracle fixed build |
|---|---|---|---|
| Java 8 | Standard builds not listed as affected. Oracle lists the Enterprise Performance Pack build. | 8u511b33-perf | 8u513-perf (1.8.0_513-perf-b4). Standard 8u513 is a separate release. |
| Java 17 | Affected from 17.0.6. 17.0.0 to 17.0.5 are not. | 17.0.21.0.3 | 17.0.21.1 |
| Java 21 | Affected | 21.0.13.0.3 | 21.0.13.1 |
| Java 25 | Affected | 25.0.5.0.3 | 25.0.5.1 |
| Java 27 | Affected | 27.0.1.0.3 | 27.0.1.1 |
| Oracle GraalVM for JDK | Affected | 17.0.21.0.3, 21.0.13.0.3 | Oracle's November update for GraalVM for JDK |
.1 numbers apply to Oracle JDK only. A build from another vendor that happens to have the same version string is not necessarily fixed; read that vendor's release notes. (2) The numbers circulating as "fixed in 17.0.11 and 21.0.3" refer to an older, unrelated bug in the same decoder and do not mean those releases are safe from Java4Shell. (3) If you build OpenJDK from source, confirm your tree contains the fix reported as JDK-8393212 before trusting a version label.Every OpenJDK-based build inherits the flaw, and each vendor publishes its fix on its own schedule.
How to Identify and Locate Every Java Instance
Finding every JVM is the real remediation bottleneck. Patching one known JDK takes minutes; finding the thirty others takes the project.
Linux
Prefer non-executing metadata first. A writable directory can contain a malicious file named java; do not execute every discovered path. Resolve symlinks, validate ownership and install location, then run -version only on trusted binaries. Also account for applications that embed the JVM under process names other than java.
# 1. Discover launchers (follow supported symlink resolution; include -type l as well as -type f) find / \( -path /proc -o -path /sys -o -path /dev \) -prune -o \ \( -type f -o -type l \) -path '*/bin/java' -print 2>/dev/null | while read -r j; do real=$(readlink -f "$j" 2>/dev/null) || continue [ -x "$real" ] || continue home=$(dirname "$(dirname "$real")") # Metadata first: no execution rel=$(grep -E '^(JAVA_VERSION|IMPLEMENTOR|OS_ARCH)=' "$home/release" 2>/dev/null | tr '\n' ' ') owner=$(stat -c '%U:%G' "$real" 2>/dev/null) echo "$j -> $real | owner=$owner | $rel" # Execute only after path/ownership look like a known vendor or package install case "$real" in /usr/lib/jvm/*|/usr/java/*|/opt/java/*|/opt/jdk*|/usr/lib64/jvm/*) ver=$("$real" -version 2>&1 | grep -m1 ' version ') echo " version: $ver" ;; *) echo " skipped execution (untrusted path); inspect release/strings first" ;; esac done # 2. Runtimes with no launcher named java (embedded JVMs load libjvm.so under other process names) grep -l 'libjvm.so' /proc/[0-9]*/maps 2>/dev/null | cut -d/ -f3 | sort -un | while read -r p; do echo "$p $(tr '\\0' ' ' < /proc/$p/cmdline 2>/dev/null) maps: $(grep -m1 'libjvm.so' /proc/$p/maps)" done # 3. What is actually running (name=java is incomplete; also use libjvm maps from step 2) for p in $(pgrep -x java); do echo "$p $(readlink /proc/$p/exe) started: $(ps -o lstart= -p $p)" done # 4. Package-managed copies (only the managed ones) rpm -qa | grep -iE 'jdk|jre|corretto|zulu' dpkg -l | grep -iE 'jdk|jre|corretto|zulu'
Windows
On Windows, Mitigate-Java4Shell.ps1 -Mode Discover performs this inventory and assessment for you without changing anything. See the script section below.
# Every Java launcher and JVM library on a drive (repeat for each fixed drive) Get-ChildItem -Path C:\ -Recurse -Include java.exe,javaw.exe,jvm.dll -File -ErrorAction SilentlyContinue | Select-Object FullName, @{n='ProductVersion';e={$_.VersionInfo.ProductVersion}}, @{n='Vendor';e={$_.VersionInfo.CompanyName}}, LastWriteTime # What is running right now, from which copy, since when Get-CimInstance Win32_Process -Filter "Name='java.exe' OR Name='javaw.exe'" | Select-Object ProcessId, ExecutablePath, CreationDate, CommandLine # Installed Java according to the uninstall keys (misses ZIP installs and bundled runtimes) Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*, HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object { $_.DisplayName -match 'Java|JDK|JRE|Corretto|Zulu' } | Select-Object DisplayName, DisplayVersion, Publisher, InstallLocation
macOS
Macs are affected in version terms but rarely in practice. Apple silicon Macs are ARM64 and cannot reach the vulnerable code, and most Intel Macs lack AVX-512 VBMI. That does not make Java on a Mac safe to ignore: the other Java SE fixes in the November update apply to every platform, and an Intel Mac with the right CPU would be exposed. Identify first, then decide.
# Apple silicon (arm64) or Intel (x86_64)? arm64 is not affected. uname -m sysctl -n machdep.cpu.brand_string # Intel only: does the CPU report AVX-512 and VBMI? Exposed only if AVX512F, AVX512BW and AVX512VBMI all appear. sysctl -n machdep.cpu.leaf7_features | tr ' ' '\n' | grep -E '^(AVX512F|AVX512BW|AVX512VBMI|BMI2)$' # Every JDK registered with macOS /usr/libexec/java_home -V # Java the registry does not know about: package-manager, SDK-manager and ZIP installs ls /opt/homebrew/opt 2>/dev/null | grep -i -E 'jdk|jre|corretto|zulu' ls /usr/local/opt 2>/dev/null | grep -i -E 'jdk|jre|corretto|zulu' ls ~/.sdkman/candidates/java 2>/dev/null # Runtimes bundled inside applications (each has a release file) find /Applications ~/Applications /Library -maxdepth 6 -name release -path '*runtime*' 2>/dev/null | while read -r f; do echo "$f | $(grep -E '^(JAVA_VERSION|IMPLEMENTOR|OS_ARCH)=' "$f" | tr '\n' ' ')" done # What is running right now ps -axo pid,command | grep '[j]ava'
The release file also shows OS_ARCH, which tells you whether a bundled runtime is aarch64 (not affected) or x86_64. Note that an Intel build of Java on an Apple silicon Mac runs under Rosetta, which reports AVX2 at most.
Java installed outside the package manager
ZIP and tar.gz installs create no registry entry and no package record. They are found by file signature: a bin/java next to a lib/server/libjvm.so (Linux) or bin\server\jvm.dll (Windows), usually with a release file that carries JAVA_VERSION, IMPLEMENTOR and OS_ARCH. Search by signature across all fixed disks, not by well-known install paths. Update tooling that only watches Program Files\Java or /usr/lib/jvm misses most of them.
Java bundled inside applications
Many products ship a private runtime so they do not depend on what is installed on the host. These copies do not update when you patch the system Java, and the vendor decides when the bundled runtime changes. Typical patterns:
- Installer-bundled runtimes: a
jre,jdkorruntimefolder inside the product's install directory (common in server products and desktop installers; Elasticsearch distributions, for example, include ajdkdirectory). - jlink and jpackage images: custom runtimes trimmed to the modules an application needs. They still contain HotSpot and the Base64 stub. The
releasefile lists aMODULES=line that identifies them. - Embedded Oracle runtimes: Oracle database and applications homes contain a JDK directory under the product home, patched through the product's own patch channel.
- Tooling: IDEs, database clients, build agents, CI runners and developer desktops carry their own runtimes and are usually the last to be updated.
For each hit, record the path, the owning product (the parent directory usually names it), the vendor string, the exact version and whether a process is using it. The path is what lets you decide who patches it: you, or the product vendor.
Containers and Kubernetes
Images carry their own JVM, and an image that was built last month still contains last month's runtime. Pulling a newer tag does nothing for containers already running.
# What Java is inside an image, without starting the application docker run --rm --entrypoint java <image>:<tag> -version # Running containers on this host docker ps --format '{{.ID}} {{.Image}}' | while read -r id img; do echo "$img => $(docker exec "$id" java -version 2>&1 | grep -m1 ' version ')" done # Kubernetes: every image in use, then which nodes have the CPU feature kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}/{.metadata.name}{"\t"}{.spec.containers[*].image}{"\n"}{end}' kubectl get nodes -L feature.node.kubernetes.io/cpu-cpuid.AVX512VBMI
The node label above is published by the Node Feature Discovery add-on. If it is not installed, read /proc/cpuinfo from a privileged diagnostic pod per node. Join the two lists: images with an affected JVM scheduled on nodes with the feature are the exposed set. Fixing means rebuilding the image on a patched base, redeploying and confirming the new pods started from the new digest.
Java assets that show no version
Inventory tools report Java assets with a blank version for three common reasons: the process cannot be executed (missing shared libraries, wrong architecture, permissions), the install has no uninstall record, or the runtime was trimmed so that there is no obvious metadata. A blank version is a gap in the assessment, not a clean result. An asset with an unknown version cannot be called vulnerable or safe, and it must not be silently counted as compliant. Prefer non-executing metadata (release file, binary strings, install records) before running any discovered java binary, and execute only after validating the path and ownership. The ladder below resolves most of them.
End-of-life operating systems
The flaw depends on the JVM build and the CPU, not on the operating system, so end-of-life Windows and Linux releases can be exposed in exactly the same way as supported ones. They are also the hosts that are hardest to fix, for three reasons:
- No vendor backport. An OS-packaged OpenJDK on a distribution that is out of support will not receive an update. The fix has to come from a standalone vendor build or from a mitigation flag.
- Newer JDKs may not install. Vendors raise minimum OS and glibc levels over time. Check the build's supported-platform list before planning an upgrade from, say, Java 8 to 17 on an old host.
- Tooling may not run. Old systems often lack current shells, TLS roots or runtimes that inventory scripts expect. File-based detection (the
releasefile and binary metadata from the ladder above) does not need to execute anything, which makes it the right method on these hosts.
Old hosts usually run old Java, and Java 8 and 11 are not exposed to Java4Shell. That does not make the hosts safe: they still need the November update for the other Java security fixes in the same update, and any old host running a bundled Java 17 or newer product on a modern server CPU is in scope for everything above.
Find Exposed Java Assets With Saner Asset Exposure
Saner Asset Exposure shows which assets run Java and which exact versions are installed, so you can build the list of hosts to mitigate or patch first. The four screenshots below follow one workflow, from the full list of Java applications to the list of affected devices. The red box in each screenshot marks where to look. Click any screenshot to open it full size.
Open Asset Exposure. In the Application Details panel (red box), type jdk in the search box. Saner lists every application with jdk in its name across all your assets. Each row shows the Version, Publisher, Installation Type, Installed Date and Instances. Installed In (%) shows the share of your devices that have it.
- Name and Version tell you whether a build is in an affected Java line (17.0.6 and later, 21, 25 and 27).
- Instances tells you how many installs of that entry Saner found.
- A version shown only as
17,27or8, with Installation Typeunknown, gives the major version only. Resolve the exact build before you decide. See "Java assets that show no version" above.
To see which devices run a particular Java, open the Tags filter in the Device Details panel. In the Select Tags window, click Add Filter Criteria and choose Application, then name, then is one of. Type jdk in the value box. The matching Java applications appear in a list (red box). Pick the one you want, here Amazon Corretto JDK 17 x64. The search covers all values, not only the ten shown.
Click + Add Criteria to add a second condition: Application, then version. The red box shows two criteria joined by AND: the name is Amazon Corretto JDK 17 x64 and the version is 17.0.6. Java 17 is affected from 17.0.6, so this finds the first affected build. Repeat the filter for each affected version you have, or use the is one of operator where it is offered. Then click Apply.
The Device Details panel now shows only the devices that match (red box). The Tags filter changes to Custom and a Clear Filter button appears. In this example one device matches: desktop-uk0l87e, running Microsoft Windows 10 v1607 on a Common KVM processor, with "Showing 1 to 1 of 1 entries" below the table. These are the hosts to mitigate or patch first.
- Host Name and Operating System identify the owner and the platform. An old Windows release like this one may not get vendor updates, so read "End-of-life operating systems" above.
- CPU helps with exposure, but a virtual CPU name such as "Common KVM processor" does not show whether AVX-512 VBMI is available. Check the CPU on the host with the commands in "Checking the CPU".
- Export (top right of the panel) hands the list to the team that owns the hosts.
Mitigate-Java4Shell.ps1 -Mode Discover on the hosts you found, and mitigate or patch them.Mitigation
Neither Oracle nor the OpenJDK Vulnerability Group mentions startup options in its advisory. The discovering researchers identified two that keep the vulnerable code from running:
| Option | What it does | Scope | Caveats |
|---|---|---|---|
-XX:-UseBASE64Intrinsics | Turns off the Base64 shortcut. The JIT keeps the ordinary Java loop and never generates the vulnerable stub. | Any architecture. Narrowest change. | Slower bulk Base64 encode and decode. A JVM that does not know the option can refuse to start; test on every Java line you run before rolling out widely. |
-XX:UseAVX=2 | Turns off AVX-512 instructions for the whole JVM, so the AVX-512 decoder stub is not used. | x86-64 only. OpenJDK on ARM does not recognize it and fails to start. | Broader effect: every AVX-512 code path in the JVM is disabled, not just Base64. |
-XX:-UseBASE64Intrinsics. It targets the vulnerable feature, behaves the same on every CPU, and leaves other optimizations alone. Reserve -XX:UseAVX=2 for x86-64 hosts where the first option cannot be used.Where to set the option
-Mode Apply, Mitigate-Java4Shell.ps1 can set the option in each affected service's registry environment, restart, verify and roll back on failure. Defaults to Discover. See the script section below.A flag only helps if it reaches the running JVM. The cleanest place is each service's own configuration, so that you control exactly which processes change.
| Service | Where the option goes |
|---|---|
| Tomcat, and applications on it | CATALINA_OPTS in bin/setenv.sh (Linux) or setenv.bat; for the Windows service, the Java options tab of the service configuration tool |
| Jenkins | JAVA_OPTS through a systemd override or the service configuration |
| Elasticsearch | A file under config/jvm.options.d/ containing the option on its own line |
| Kafka | KAFKA_OPTS in the service environment |
| Solr | SOLR_OPTS in solr.in.sh (or solr.in.cmd on Windows) |
| Jira and Confluence | bin/setenv.sh (or setenv.bat) JVM argument settings |
Spring Boot and plain java -jar | The command line, or the unit file's ExecStart |
| Containers | An ENV or Kubernetes env entry for the variable the image's entrypoint honours, then redeploy the pod |
| Anything else | The vendor's documented JVM-options setting |
The environment-variable shortcut and its dangers
JAVA_TOOL_OPTIONS is picked up by every JVM launched in that environment, which makes it tempting as a quick fleet-wide setting. Use it carefully:
- Mixed Java versions break. An option the JVM does not recognize aborts startup with an unrecognized-option error. A host that runs both Java 8 and Java 17 can lose its Java 8 services. Scope the variable to individual services, or add
-XX:+IgnoreUnrecognizedVMOptionsand test first. - Noise. Every JVM prints a "Picked up JAVA_TOOL_OPTIONS" line to standard error. Scripts that parse
java -versionoutput, and monitoring that treats standard error as a failure, can misbehave. - It affects short-lived tools too: compilers, build steps and CLI utilities started from the same environment.
Advice circulating that is wrong or risky
- "It only affects Java 17." Java 21, 25 and 27 are affected as well.
- "It is just a crash." Heap disclosure and code execution have been demonstrated.
- "Add
-XX:DisableIntrinsic=_base64_decodeBlock." Reported by lab testing to stop the JVM from starting when used on its own. Pushed through an environment variable, that turns a security fix into an outage. - "Set
-XX:UseAVX=2everywhere." It breaks JVM startup on ARM hosts. - "A buffering proxy protects you." Not reliably; at least one chain works from a single complete request.
macOS
Only an Intel Mac whose CPU reports AVX-512 VBMI needs a mitigation, so the practical fix on a Mac is the vendor's update. Where a service on such a Mac cannot be updated yet, set the option for that one process rather than for the whole machine:
- A launchd service: add the variable to the job's property list, then reload the job.
- A command you start yourself: put the option on the
javacommand line. - A packaged application: do not edit files inside a signed application bundle, because that breaks its code signature. Take the application vendor's update instead.
# /Library/LaunchDaemons/com.example.service.plist (inside the top-level dict) <key>EnvironmentVariables</key> <dict> <key>JAVA_TOOL_OPTIONS</key> <string>-XX:-UseBASE64Intrinsics</string> </dict> # reload the job, then confirm in the running JVM sudo launchctl bootout system /Library/LaunchDaemons/com.example.service.plist sudo launchctl bootstrap system /Library/LaunchDaemons/com.example.service.plist jcmd <pid> VM.flags -all | grep UseBASE64Intrinsics
launchctl setenv as a fix. It sets the variable for the current login session only, it is lost at reboot, and it reaches every Java program started afterwards. The same caution applies as on Windows: an option an older Java does not recognize can stop it from starting.Confirming the mitigation is active
# Against a running JVM (run as the same user as the process, with a matching jcmd) jcmd <pid> VM.flags -all | grep -E 'UseBASE64Intrinsics|UseAVX' # expect: bool UseBASE64Intrinsics = false (or UseAVX = 2) # Against a launcher, before deploying java -XX:-UseBASE64Intrinsics -XX:+PrintFlagsFinal -version 2>&1 | grep UseBASE64Intrinsics
Mitigate-Java4Shell.ps1: Identify and Mitigate on Windows
SecPod's PowerShell custom script inventories vulnerable Java on Windows and can apply a reversible mitigation to the services that run it. It follows the same pattern as our other custom patches: Discover (default), Apply, Verify and Rollback. The script file is not bundled with this article; do not claim exhaustive discovery or verified automatic mitigation until it has passed testing.
-Mode Rollback to remove the option.Run .\Mitigate-Java4Shell.ps1 -Help to list every mode and parameter.
How to run it
Run it from an elevated prompt. Apply and Rollback ask for elevation themselves if needed. Discover is the default: running with no parameters inventories and assesses only. Require an explicit -Mode Apply before any service configuration change or restart.
# Inventory and assessment only (default). Changes nothing. powershell -ExecutionPolicy Bypass -File .\Mitigate-Java4Shell.ps1 powershell -ExecutionPolicy Bypass -File .\Mitigate-Java4Shell.ps1 -Mode Discover # Mitigate: requires explicit -Mode Apply (changes service config and may restart) powershell -ExecutionPolicy Bypass -File .\Mitigate-Java4Shell.ps1 -Mode Apply # Check that every affected, exposed JVM is mitigated (exit code 2 if not) powershell -ExecutionPolicy Bypass -File .\Mitigate-Java4Shell.ps1 -Mode Verify # After the fixed build is installed and the service restarted: remove the option powershell -ExecutionPolicy Bypass -File .\Mitigate-Java4Shell.ps1 -Mode Rollback
Deploying through Saner PM
For Saner customers, deploy Mitigate-Java4Shell.ps1 as a custom remediation in Patch Management: open PM, filter to Third Party Java entries, create a patching task, upload the script, confirm the patch details, and schedule it in a maintenance window (services may restart).
Follow the full console walkthrough here: How to perform custom remediation for applications that require paid patches using Saner PM.
-Mode Apply, or edit the param block so the uploaded custom patch invokes Apply explicitly. Do not assume exhaustive discovery or verified automatic rollback until the script has passed testing.What you will see
The console and the log list the Java runtimes, the services that run Java, and any Java that is not a Windows service. The layout looks like this (values are illustrative):
Java runtimes found
Home Vendor Version Arch Via Status Exposure Action
---- ------ ------- ---- --- ------ -------- ------
C:\Java\jdk-21 Oracle Corporation 21.0.13 x64 release-file Affected Possible Mitigate
C:\Apps\Portal\runtime Amazon.com Inc. 17.0.21 x64 release-file Affected Possible Mitigate
C:\Java\jre1.8.0_511 Oracle Corporation 1.8.0_511 x64 release-file NotAffected NotExposed -
Windows services that run Java
Service Account Pid Version Status Exposure Option Action
------- ------- --- ------- ------ -------- ------ ------
PortalSvc LocalSystem 4128 17.0.21 Affected Possible none Mitigate
Mitigation results
PortalSvc Mitigated verification=Confirmed Option confirmed in the running JVM
backup: C:\ProgramData\Java4ShellMitigation\backups\20261118-091500\PortalSvc.json
Patch
| Item | Detail |
|---|---|
| Patch Available | Yes. Oracle fixed builds were released November 17, 2026. CISA urges immediate installation, prioritizing internet-facing systems. Other OpenJDK vendors were still publishing at the time of writing. |
| CISA Guidance | Identify every Java runtime (including bundled, container and appliance copies); patch ASAP; if delayed, apply compensating Base64 / access controls; monitor for crashes and suspicious Java activity. Critical Java Vulnerability Requires Immediate Patching |
| Oracle builds | 17.0.21.1, 21.0.13.1, 25.0.5.1, 27.0.1.1 (Java4Shell). For Java 8 Performance Pack use 8u513-perf (1.8.0_513-perf-b4); standard 8u513 and 11.0.33.1 carry the other November fixes. |
| Patch Source | Oracle Critical Security Patch Update Advisory, November 2026 and the OpenJDK Vulnerability Advisory of 2026/11/17 |
| Other vendors | Amazon Corretto, Azul Zulu, Red Hat and Linux distributions release on their own schedules. |
| Restart | Required. A running JVM keeps the old code until it is restarted. |
| Containers | Rebuild on a patched base image, redeploy, and confirm that pods run the new digest. |
| Bundled runtimes | Take the application vendor's update. Do not swap a runtime inside a vendor directory unless the vendor supports it. |
| Old copies | Remove superseded Java directories after a successful update. Side-by-side leftovers are the usual reason a host still reports as vulnerable. |
How to Verify and Validate Mitigation
The same discipline applies on any platform: record the existing configuration first, apply the option, restart, verify, and restore automatically if verification fails. The Windows script above implements it for Windows services. The reference script below shows the equivalent for systemd services on Linux.
Reference implementation: Linux services (systemd)
These are reference scripts. Test them in a lab, adapt the service names and paths to your environment, and run them under change control.
#!/usr/bin/env bash # java4shell-mitigate.sh <apply|rollback|verify> <systemd-service> # Preserve the original backup across re-Apply; handle restart failures so rollback still runs. set -euo pipefail ACTION="${1:?apply|rollback|verify}"; SVC="${2:?service name}" FLAG="-XX:-UseBASE64Intrinsics" DIR="/etc/systemd/system/${SVC}.service.d"; DROPIN="${DIR}/90-java4shell.conf" STATE="/var/lib/java4shell-mitigation"; mkdir -p "$STATE" ORIG_BAK="$STATE/${SVC}.original.dropin.bak" NO_PRIOR="$STATE/${SVC}.original.none" MARKER="$STATE/${SVC}.applied" verify() { local mainpid user mainpid=$(systemctl show -p MainPID --value "$SVC") [ "$mainpid" -gt 0 ] || return 1 user=$(ps -o user= -p "$mainpid") runuser -u "$user" -- jcmd "$mainpid" VM.flags -all 2>/dev/null | grep -Eq 'UseBASE64Intrinsics *= *false' } restart_svc() { systemctl daemon-reload if ! systemctl restart "$SVC"; then echo "ERROR: systemctl restart $SVC failed" >&2 return 1 fi return 0 } rollback() { # Always attempt restore even if restart later fails if [ -f "$ORIG_BAK" ]; then mkdir -p "$DIR" cp -p "$ORIG_BAK" "$DROPIN" else rm -f "$DROPIN" fi rm -f "$MARKER" systemctl daemon-reload || true systemctl restart "$SVC" || { echo "ERROR: rollback restart of $SVC failed" >&2; return 1; } return 0 } effective_java_tool_options() { # Prefer EnvironmentFile + Environment from the unit without space-splitting quoted values. # systemctl show -p Environment can mangle values that contain spaces; read drop-ins and # EnvironmentFile entries, then confirm the live process environment after restart. local envfiles f line val="" envfiles=$(systemctl show "$SVC" -p EnvironmentFiles --value 2>/dev/null || true) for f in $envfiles; do f="${f% (ignore_errors=*}" [ -f "$f" ] || continue line=$(grep -E '^JAVA_TOOL_OPTIONS=' "$f" 2>/dev/null | tail -1 || true) [ -n "$line" ] && val="${line#JAVA_TOOL_OPTIONS=}" done if [ -f "$DROPIN" ]; then line=$(grep -E '^Environment=.*JAVA_TOOL_OPTIONS=' "$DROPIN" 2>/dev/null | tail -1 || true) if [[ "$line" =~ JAVA_TOOL_OPTIONS=([^\"]+) ]]; then val="${BASH_REMATCH[1]}"; fi fi # Also capture bare Environment=JAVA_TOOL_OPTIONS=... from the main unit via systemctl cat line=$(systemctl cat "$SVC" 2>/dev/null | grep -E '^Environment=.*JAVA_TOOL_OPTIONS=' | tail -1 || true) if [[ "$line" =~ JAVA_TOOL_OPTIONS=(\"([^\"]*)\"|([^[:space:]]+)) ]]; then val="${BASH_REMATCH[2]:-${BASH_REMATCH[3]}}" fi printf '%s' "$val" } case "$ACTION" in apply) mkdir -p "$DIR" # Preserve the first (pre-mitigation) backup forever; do not overwrite on re-Apply if [ ! -f "$ORIG_BAK" ] && [ ! -f "$NO_PRIOR" ]; then if [ -f "$DROPIN" ]; then cp -p "$DROPIN" "$ORIG_BAK" else : > "$NO_PRIOR" # no prior drop-in existed fi fi # Idempotent: if already applied and verified, do nothing if [ -f "$MARKER" ] && grep -Fq -- "$FLAG" "$DROPIN" 2>/dev/null && verify; then echo "PASS: $SVC already mitigated"; exit 0 fi existing=$(effective_java_tool_options) case "$existing" in *"$FLAG"*) value="$existing" ;; *) value="${existing:+$existing }$FLAG" ;; esac printf '[Service]\nEnvironment="JAVA_TOOL_OPTIONS=%s"\n' "$value" > "$DROPIN" # Confirm the drop-in parses as expected before restarting grep -Fq -- "$FLAG" "$DROPIN" if ! restart_svc; then echo "FAIL: restart failed; rolling back $SVC" >&2 rollback || true exit 2 fi sleep 20 # Verify effective value in the running process, not only the unit file mainpid=$(systemctl show -p MainPID --value "$SVC") if [ "$mainpid" -gt 0 ]; then tr '\\0' '\\n' < /proc/"$mainpid"/environ 2>/dev/null | grep -E '^JAVA_TOOL_OPTIONS=' || true fi if systemctl is-active --quiet "$SVC" && verify; then date -Is > "$MARKER" echo "PASS: $SVC mitigated" else echo "FAIL: rolling back $SVC" >&2 rollback || true exit 2 fi ;; rollback) rollback ;; verify) verify && echo PASS || { echo FAIL; exit 1; } ;; esac
Verifying a patch
- Version:
java -versionfrom the exact directory the service uses reports the fixed build for that vendor. For a running process, preferjcmd <pid> VM.version. - Active library mappings: do not rely on
/proc/<pid>/exeshowing(deleted)alone. A JVM can keep an old mappedlibjvm.soeven when the launcher path looks current. Inspect/proc/<pid>/maps(or Windows module lists) for the activelibjvm.so/jvm.dll, confirm its on-disk path and version, and compare the process start time with that file's update time. - One copy per path: re-run the discovery scripts and confirm no older directory remains.
- Lab confirmation: on a non-production AVX-512 host, the bounded check below is optional and experimental only.
Lab-only: bounded vulnerability check
not reproduced is not proof that a JVM is safe, patched, or compliant. The test can miss the vulnerable execution path even on compatible hardware. Do not use it as a patch-verification or compliance gate. Prefer vendor build numbers, jcmd flags, and mapped library versions.This check decodes a malformed string into a large array and looks for any change beyond the size Java allocated for it. It writes only inside its own 4096-byte array. Run it on lab systems only, never on production. A clean result on a CPU without AVX-512 VBMI, or without the intrinsic selected, proves nothing about the patch level.
import java.util.Arrays;
import java.util.Base64;
public class Java4ShellCheck {
static volatile int sink;
public static void main(String[] args) {
Base64.Decoder dec = Base64.getDecoder();
boolean overflow = false;
for (int n : new int[] {64, 128}) { // 64 for 21+, 128 for JDK 17
byte[] good = new byte[n]; Arrays.fill(good, (byte) 'A');
byte[] bad = new byte[n + 1]; Arrays.fill(bad, (byte) 'A'); bad[n] = '=';
byte[] out = new byte[4096];
for (int i = 0; i < 200_000; i++) sink += dec.decode(good, out); // warm up
Arrays.fill(out, (byte) 0x5a);
try { dec.decode(bad, out); } catch (IllegalArgumentException expected) { }
int allocated = ((n + 1 + 3) / 4) * 3 - 1; // what Java sized the output to
for (int i = allocated; i < out.length; i++) {
if (out[i] != (byte) 0x5a) { overflow = true; break; }
}
}
System.out.println(System.getProperty("java.runtime.version") + " : " +
(overflow ? "REPRODUCED (vulnerable)" : "not reproduced"));
System.exit(overflow ? 1 : 0);
}
}
Hunting for Exploitation Attempts
Detection of attempts is secondary to patching and mitigation, but these signals help find activity that already happened: malformed Base64 tokens in requests, decoder exceptions in application logs, JVM crash files and bursts of service restarts, and shells started by Java processes. CISA specifically calls out monitoring for rogue runtimes, unexpected JVM crashes and suspicious Java processes. A quiet result does not prove a clean host.
Request shape (shell)
# Candidate tokens that look like Base64 and end in padding, then keep those with an invalid length grep -aoE '[A-Za-z0-9+/_-]{32,}={1,2}' access.log | awk 'length($0) % 4 != 0' | sort | uniq -c | sort -rn | head # Decoder exceptions in application logs grep -aEi 'IllegalArgumentException.*(base64|4-byte ending|incorrect ending byte|Last unit)' app.log | tail # JVM crash files from the last week find / -name 'hs_err_pid*.log' -mtime -7 2>/dev/null journalctl -u <service> --since '7 days ago' | grep -E 'SIGSEGV|fatal error has been detected'
Microsoft Sentinel (KQL)
SecurityEvent | where EventID == 4688 | where ParentProcessName endswith @"\java.exe" or ParentProcessName endswith @"\javaw.exe" | where NewProcessName matches regex @"(?i)\\(cmd|powershell|pwsh|wscript|cscript|certutil|bitsadmin|curl)\.exe$" | project TimeGenerated, Computer, ParentProcessName, NewProcessName, CommandLine
Behavioral indicators for EDR
- A Java service restarting repeatedly within minutes, with a crash file each time.
- A Java process spawning a shell,
curl,certutilor a scripting host. - A Jenkins, Jira, Confluence or Artifactory process reading credential stores or key files it does not normally touch.
- New outbound connections from an identity provider or CI controller to unfamiliar hosts.
Prioritization
Align with CISA: patch internet-facing systems first. Within that set, start with hosts that meet all four exposure conditions. Identity providers, CI/CD controllers and artifact repositories come first, because compromise there yields trust across the environment.
Exposure decision flow
Remediation Recommendations
Mitigate-Java4Shell.ps1 -Mode Discover.-XX:-UseBASE64Intrinsics where you cannot patch yet, with rollbackP1jcmd, and keep a ticket open for the real update. On Windows services, Mitigate-Java4Shell.ps1 does this with backup, verification and rollback.SecPod Coverage
| Capability | Coverage for CVE-2026-114938 |
|---|---|
| Vulnerability Detection | OVAL-based checks identifying affected JDK and JRE installations on Windows and Linux, for Oracle and OpenJDK-based builds and for OS-packaged OpenJDK. |
| Java Outside the Package Manager | Detection of ZIP, tar.gz and portable installs, and of Java bundled inside third-party application directories, by file signature and the runtime's own metadata rather than by package records or uninstall keys alone. |
| Assets Without a Version | Java assets that appear without a version are resolved by reading the runtime's release metadata and binary version information when execution is not possible, and are reported as unassessed, not compliant, when no method succeeds. |
| End-of-Life Operating Systems | The same Java detection applies on end-of-life operating systems that the agent supports, since exposure depends on the Java build and not on the OS. |
| Mitigation With Rollback | Mitigate-Java4Shell.ps1 inventories and classifies Java and, with an explicit -Mode Apply, can apply the startup option per Windows service with backup, restart, verification and rollback. Treat exhaustive discovery and automatic rollback as unverified until testing is complete. Deploy through Saner PM custom remediation. See How to perform custom remediation using Saner PM. |
| Patch Deployment | Deployment of fixed builds through Saner as vendors publish them, with the restart and verification steps described above. |
Key Takeaways
- CISA says patch immediately. Inventory every JDK and bundled runtime, prioritize internet-facing systems, and monitor for crashes and suspicious Java activity.
- The flaw is in the Java runtime. Library scans do not find it. Runtime inventory does.
- Exposure follows the CPU. An affected JVM on an AVX-512 VBMI processor with reachable Base64 input is vulnerable. The same workload on another node may not be.
- Restart after patching. A running process keeps the old code until it restarts. Oracle's version numbers apply to Oracle only.
- A flag is a bridge, not a fix.
-XX:-UseBASE64Intrinsicsplus CISA's Base64 / access compensating controls buy time. They do not replace the November fixed builds. - On Windows, automate carefully. Mitigate-Java4Shell.ps1 defaults to Discover. Require
-Mode Applyfor changes, and test in a lab before treating discovery or rollback as verified.
Find every JVM, put the fixed build on the network-facing services first (as CISA urges), restart them, and use a reversible startup option plus compensating controls for anything that has to wait.
Instantly Fix Risks with Saner Patch Management
Saner Patch Management gives you one place to find vulnerable Java across Windows and Linux endpoints and servers, prioritize the exposed ones, and deploy fixes and custom remediations with verification. Start with a Java inventory today, then close the highest-risk services first.
References and CVE Details
| CVE | Component | CVSS 3.1 |
|---|---|---|
| CVE-2026-114938 | hotspot/compiler (Java4Shell) | 8.1 High |
Sources: CISA Alert: Critical Java Vulnerability Requires Immediate Patching (November 17, 2026); The Hacker News: CISA Urges Immediate Patching of Java4Shell (November 18, 2026); Oracle Critical Security Patch Update Advisory, November 2026; OpenJDK Vulnerability Advisory, 2026/11/17.
Instantly Fix Risks in Endpoints & Cloud with Saner
Saner is a continuous and integrated vulnerability & exposure management platform that instantly fixes risks in endpoints and cloud.







