How To

Patch Java4Shell (CVE-2026-114938) on RHEL, Rocky Linux and AlmaLinux

Red Hat’s security data API still lists the RHEL 8, 9 and 10 OpenJDK packages as “Affected” by Java4Shell. That label is out of date: the fixed RPMs have been in the repositories since around midnight UTC on the night of 18 to 19 November 2026. If you wait for that label to flip before patching, your JVMs stay exposed for hours longer than they need to. The host’s own dnf updateinfo already knows about the fix, and on RHEL it answers correctly when you ask by CVE.

Original content from computingforgeeks.com - post 192013

Below, you’ll patch CVE-2026-114938 on RHEL 8, 9 and 10, restart the JVMs that keep the old library mapped, and hold Rocky Linux and AlmaLinux with the stopgap flag until their rebuilds reach the mirrors. The Java4Shell CVE-2026-114938 overview explains the bug and the JVMs bundled inside other products. Everything below was run on RHEL 8.10, 9.9 and 10.3, Rocky Linux 9.8 and AlmaLinux 9.9 on Google Cloud c3 instances (Sapphire Rapids, AVX-512 VBMI present) in November 2026.

Fixed OpenJDK builds per RHEL release

Each affected Java line on each RHEL major release has its own advisory, and the fixed builds are 17.0.21.1, 21.0.13.1 and 25.0.5.1 or later. A fourth version field alone is not the test: older builds such as 21.0.12.1 carry one and are still vulnerable. The left column of builds is what a host patched before 19 November still runs; we installed exactly those builds in the lab before upgrading. The advisory pages on access.redhat.com, such as RHSA-2026:100564, list the same versions:

ReleasePackageLast vulnerable buildFixed buildAdvisory
RHEL 8java-17-openjdk17.0.21.0.9-2.1.el817.0.21.1.2-2.1.el8RHSA-2026:100563
RHEL 8java-21-openjdk21.0.13.0.9-1.1.el821.0.13.1.2-1.1.el8RHSA-2026:100567
RHEL 9java-17-openjdk17.0.21.0.9-2.2.el917.0.21.1.2-2.2.el9RHSA-2026:100564
RHEL 9java-21-openjdk21.0.13.0.9-1.2.el921.0.13.1.2-1.2.el9RHSA-2026:100567
RHEL 9java-25-openjdk25.0.5.0.8-1.0.el925.0.5.1.2-1.1.el9RHSA-2026:100571
RHEL 10java-21-openjdk21.0.13.0.9-1.2.el1021.0.13.1.2-1.2.el10RHSA-2026:100568
RHEL 10java-25-openjdk25.0.5.0.8-1.0.el1025.0.5.1.2-1.1.el10RHSA-2026:100572
Rocky Linux 8 / 9 / 10java-17, 21, 25-openjdksame versions as RHEL; release tags can differ (el8_10, el9_8)Not releasedNo advisory in Rocky’s errata API
AlmaLinux 8 / 9 / 10java-17, 21, 25-openjdksame builds (.alma.1 suffix on 9 and 10)Not releasedALSA-2026:100563 to 100572 release tickets open

Two gaps in that table are by design, not missing fixes. RHEL 8 ships no java-25-openjdk package, and RHEL 10 ships no java-17-openjdk, so a host that needs those lines gets them from another vendor and patches on that vendor’s schedule. The Rocky and AlmaLinux rows were checked at 09:25 UTC on 19 November: Rocky’s Apollo errata API returned no advisory for the CVE, and AlmaLinux had seven open release tickets on GitHub for the rebuilt packages while its mirror still served the vulnerable builds.

Red Hat’s CSAF file for the CVE also lists the fixes for the extended update streams (EUS, E4S, AUS and TUS on RHEL 8 and 9, and the 10.0 and 10.2 extended streams). We tested only the main streams, so on an EUS host confirm with the same dnf updateinfo check shown below before you trust the table.

The Affected label lags the errata

The advisories went out between 00:15 and 01:44 UTC on 19 November, and at 09:25 UTC on the 19th Red Hat’s securitydata API still showed every RHEL row as “Affected”, with only the portable and Windows builds marked fixed. If your scanner or dashboard reads that API, it will keep flagging your hosts as unpatchable. Ask the host instead, because the repository metadata dnf downloads is what actually decides what gets installed:

sudo dnf -q updateinfo list --cve CVE-2026-114938

On our RHEL 9 host the answer names one advisory per Java line, rated Critical, along with every subpackage it replaces:

RHSA-2026:100564 Critical/Sec. java-17-openjdk-1:17.0.21.1.2-2.2.el9.x86_64
RHSA-2026:100564 Critical/Sec. java-17-openjdk-devel-1:17.0.21.1.2-2.2.el9.x86_64
RHSA-2026:100564 Critical/Sec. java-17-openjdk-headless-1:17.0.21.1.2-2.2.el9.x86_64
RHSA-2026:100567 Critical/Sec. java-21-openjdk-1:21.0.13.1.2-1.2.el9.x86_64
RHSA-2026:100567 Critical/Sec. java-21-openjdk-devel-1:21.0.13.1.2-1.2.el9.x86_64
RHSA-2026:100567 Critical/Sec. java-21-openjdk-headless-1:21.0.13.1.2-1.2.el9.x86_64
RHSA-2026:100571 Critical/Sec. java-25-openjdk-1:25.0.5.1.2-1.1.el9.x86_64
RHSA-2026:100571 Critical/Sec. java-25-openjdk-crypto-adapter-1:25.0.5.1.2-1.1.el9.x86_64
RHSA-2026:100571 Critical/Sec. java-25-openjdk-devel-1:25.0.5.1.2-1.1.el9.x86_64
RHSA-2026:100571 Critical/Sec. java-25-openjdk-headless-1:25.0.5.1.2-1.1.el9.x86_64

These advisories aren’t Java4Shell only. dnf updateinfo info RHSA-2026:100567 lists nine CVEs, CVE-2026-114938 through CVE-2026-114946, which is the rest of the November OpenJDK security update. That’s worth knowing before a change board asks: it’s an out-of-band release, not the October quarterly update, and it carries eight other CVEs, so it’s not a Java4Shell-only change.

Exposure needs AVX-512 VBMI

The vulnerable code is a Base64 decoder that HotSpot only generates on x86-64 CPUs with all four of these instruction set flags, so the CPU decides whether an unpatched JVM is reachable at all. Check it first:

grep -oE '(avx512f|avx512bw|avx512vbmi|bmi2)' /proc/cpuinfo | sort -u

Every one of our c3 hosts, on all five distributions, printed the full set. If you see four lines, your host is in scope. Fewer means the JVM never builds the vulnerable stub, which lowers the urgency but not the need to patch, since a VM can be moved to newer hardware without anyone touching the guest.

avx512bw
avx512f
avx512vbmi
bmi2

The JVM side of the condition is the UseBASE64Intrinsics flag, which is on by default. Ask each installed JDK rather than the one on your PATH:

for v in 17 21 25; do /usr/lib/jvm/java-$v-openjdk/bin/java -XX:+PrintFlagsFinal -version 2>/dev/null | grep UseBASE64Intrinsics; done

All three report true from {default}, so nothing in the default RHEL configuration turns the decoder off:

     bool UseBASE64Intrinsics                      = true                                      {product} {default}
     bool UseBASE64Intrinsics                      = true                                      {product} {default}
     bool UseBASE64Intrinsics                      = true                                      {product} {default}

Don’t stop at java -version either. On our RHEL 9 host with three JDKs installed, the alternatives link pointed at java-17, so the bare command reported only the oldest line and said nothing about 21 and 25:

alternatives --display java | head -4; java -version 2>&1 | head -1

Services usually start a JDK by its full path, not through the alternatives link, so every directory under /usr/lib/jvm counts:

java - status is auto.
 link currently points to /usr/lib/jvm/java-17-openjdk-17.0.21.0.9-2.2.el9.x86_64/bin/java
/usr/lib/jvm/java-25-openjdk/bin/java - family java-25-openjdk priority 1
 follower alt-java: /usr/lib/jvm/java-25-openjdk/bin/alt-java
openjdk version "17.0.21" 2026-10-20 LTS

The CVE filter works on RHEL

On Amazon Linux, dnf upgrade --cve finds nothing for this CVE because the advisories carry no CVE reference (our Amazon Linux Java4Shell guide covers that trap). Red Hat’s advisories do carry it, so all three ways of asking select the fix. Preview the CVE-keyed run first:

sudo dnf upgrade --cve CVE-2026-114938 --assumeno

It picks up every installed Java line in one transaction, ten packages on our RHEL 9 host, and touches nothing else:

Upgrading:
 java-17-openjdk                  x86_64  1:17.0.21.1.2-2.2.el9 rhui-rhel-9-for-x86_64-appstream-rhui-rpms  463 k
 java-17-openjdk-devel            x86_64  1:17.0.21.1.2-2.2.el9 rhui-rhel-9-for-x86_64-appstream-rhui-rpms  4.7 M
 java-17-openjdk-headless         x86_64  1:17.0.21.1.2-2.2.el9 rhui-rhel-9-for-x86_64-appstream-rhui-rpms   45 M
 java-21-openjdk                  x86_64  1:21.0.13.1.2-1.2.el9 rhui-rhel-9-for-x86_64-appstream-rhui-rpms  404 k
 java-21-openjdk-devel            x86_64  1:21.0.13.1.2-1.2.el9 rhui-rhel-9-for-x86_64-appstream-rhui-rpms  5.0 M
 java-21-openjdk-headless         x86_64  1:21.0.13.1.2-1.2.el9 rhui-rhel-9-for-x86_64-appstream-rhui-rpms   49 M
 java-25-openjdk                  x86_64  1:25.0.5.1.2-1.1.el9  rhui-rhel-9-for-x86_64-appstream-rhui-rpms  393 k
 java-25-openjdk-crypto-adapter   x86_64  1:25.0.5.1.2-1.1.el9  rhui-rhel-9-for-x86_64-appstream-rhui-rpms   64 k
 java-25-openjdk-devel            x86_64  1:25.0.5.1.2-1.1.el9  rhui-rhel-9-for-x86_64-appstream-rhui-rpms  6.2 M
 java-25-openjdk-headless         x86_64  1:25.0.5.1.2-1.1.el9  rhui-rhel-9-for-x86_64-appstream-rhui-rpms   61 M

Transaction Summary
=================================================================================================================
Upgrade  10 Packages

Which form you use depends on how narrow the change ticket is. In order of scope:

  1. --advisory RHSA-2026:100567 moves one Java line only (three packages for java-21 on RHEL 9), and you can repeat the option for each advisory you want.
  2. --cve CVE-2026-114938 moves every Java line that has the fix, and nothing else.
  3. --security moves every pending security update on the box, Java and whatever else is waiting.

On RHEL 9 we applied the CVE-keyed form:

sudo dnf -y upgrade --cve CVE-2026-114938

The transaction ends with the same ten packages it previewed:

Upgraded:
  java-17-openjdk-1:17.0.21.1.2-2.2.el9.x86_64
  java-17-openjdk-devel-1:17.0.21.1.2-2.2.el9.x86_64
  java-17-openjdk-headless-1:17.0.21.1.2-2.2.el9.x86_64
  java-21-openjdk-1:21.0.13.1.2-1.2.el9.x86_64
  java-21-openjdk-devel-1:21.0.13.1.2-1.2.el9.x86_64
  java-21-openjdk-headless-1:21.0.13.1.2-1.2.el9.x86_64
  java-25-openjdk-1:25.0.5.1.2-1.1.el9.x86_64
  java-25-openjdk-crypto-adapter-1:25.0.5.1.2-1.1.el9.x86_64
  java-25-openjdk-devel-1:25.0.5.1.2-1.1.el9.x86_64
  java-25-openjdk-headless-1:25.0.5.1.2-1.1.el9.x86_64

Complete!

On RHEL 8 the advisory form took both lines in one run with sudo dnf -y upgrade --advisory RHSA-2026:100563 --advisory RHSA-2026:100567, and on RHEL 10 sudo dnf -y upgrade --security 'java-*-openjdk*' limited the security run to the Java packages. Whichever you use, confirm each JDK by its build string, because the RPM can move while a different JDK on the box stays behind:

for v in 17 21 25; do /usr/lib/jvm/java-$v-openjdk/bin/java -version 2>&1 | sed -n 2p; done

A fixed JDK shows .1+2 in the build. The vulnerable builds read 17.0.21+9, 21.0.13+9 and 25.0.5+8, which is easy to misread as current:

OpenJDK Runtime Environment (Red_Hat-17.0.21.1.2-2) (build 17.0.21.1+2-LTS)
OpenJDK Runtime Environment (Red_Hat-21.0.13.1.2-1) (build 21.0.13.1+2-LTS)
OpenJDK Runtime Environment (Red_Hat-25.0.5.1.2-1) (build 25.0.5.1+2-LTS)

The intrinsic stays on after the patch, and that’s expected. The fix corrects the decoder; it doesn’t disable it, so UseBASE64Intrinsics still reads true on a patched JDK and that line tells you nothing about patch state.

Running JVMs keep the old library

dnf replaces the files on disk, not the code a running JVM has already mapped. To see it, we ran a small Java service called demoapp on the vulnerable java-25 build on RHEL 10, then patched underneath it. On RHEL 10, needs-restarting names the unit straight away:

sudo dnf needs-restarting -s

Every unit it lists is still running the old code:

demoapp.service

The process itself shows the same thing from the inside, and on RHEL 8 and 9 this is the check that counts. There needs-restarting printed nothing while our RHEL 9 JVM still mapped three deleted copies of libjvm.so: those releases install each JDK in a versioned directory that no package owns after the upgrade, and the plugin skips deleted files without an owner. Count the deleted libjvm.so mappings and ask the live JVM for its version:

pid=$(systemctl show -p MainPID --value demoapp); sudo grep -c 'libjvm.so (deleted)' /proc/$pid/maps; sudo jcmd $pid VM.version | sed -n 2p

Four mappings point at a file that no longer exists, and the JVM still reports the vulnerable build, even though rpm -q already shows the fix:

4
OpenJDK 64-Bit Server VM version 25.0.5+8-LTS

Restart the unit, then run the same check again:

sudo systemctl restart demoapp
pid=$(systemctl show -p MainPID --value demoapp); sudo jcmd $pid VM.version | sed -n 2p

Only now is the service on the fixed build:

OpenJDK 64-Bit Server VM version 25.0.5.1+2-LTS

Plan the restarts as part of your change, not as a follow-up, because you can’t see the problem from the package database. A patch job that installs the RPMs and stops there leaves every long-running JVM (application servers, Kafka brokers, build agents) on the vulnerable code until the next reboot.

A silent trigger proves nothing

Calif, which found the bug, published a bounded self-check in its Java4Shell write-up that prints REPRODUCED when a JDK corrupts memory past a Base64 output buffer. It’s tempting to run it once, see NOT REPRODUCED, and call a host safe. We ran it as published, unmodified, on every host, and the vulnerable builds didn’t fire every time:

Host and buildRunsREPRODUCED
RHEL 9, java-21 21.0.13.0.9 and java-25 25.0.5.0.8 (vulnerable)1 each1 each
RHEL 10, java-21 21.0.13.0.9 and java-25 25.0.5.0.8 (vulnerable)1 each1 each
Rocky Linux 9, java-21 21.0.13.0.9 (vulnerable)63
Rocky Linux 9, java-25 25.0.5.0.8 (vulnerable)44
AlmaLinux 9, java-21 21.0.13.0.9 (vulnerable)53
RHEL 8, java-21 21.0.13.0.9 (vulnerable)50
RHEL 9, java-21 and java-25 after the fix1 each0
RHEL 10, java-21 and java-25 after the fix11 each0
RHEL 8, java-21 after the fix100
Rocky Linux 9, java-21 and java-25 with the stopgap flag1 each0

The vulnerable RHEL 8 build never fired in five runs, and the same java-21 build on Rocky and AlmaLinux fired only about half the time. The check depends on the JIT compiling the decoder in time, so a quiet run on an unpatched host is a coin toss, not a result. Java 17 is a blind spot as well: the write-up says the 17 code path needs a longer input than the published check uses, and our one run on the vulnerable RHEL 9 java-17 build stayed quiet. Read the check one way only: REPRODUCED means vulnerable, and anything else means nothing. The build string from the previous section is the proof of a patch.

Rocky and AlmaLinux wait on rebuilds

Rocky Linux and AlmaLinux rebuild Red Hat’s source packages, so their fix lands after Red Hat’s. On our Rocky 9 host, after a metadata refresh, neither the advisory list nor a plain update check finds anything:

sudo dnf -q updateinfo list --cve CVE-2026-114938; echo rc=$?; sudo dnf -q check-update 'java-*' ; echo check-update-rc=$?

An empty list with exit code 0 from check-update (it returns 100 when updates exist) means no rebuilt package has reached your mirror. AlmaLinux 9 gave the same answer:

rc=0
check-update-rc=0

Until the rebuild arrives, turn the vulnerable decoder off for each service with -XX:-UseBASE64Intrinsics, the interim mitigation in Red Hat’s RHSB-2026-018 bulletin. A systemd drop-in carries it in JAVA_TOOL_OPTIONS without editing the vendor’s unit file. Create the drop-in file:

sudo mkdir -p /etc/systemd/system/demoapp.service.d
sudo vim /etc/systemd/system/demoapp.service.d/java4shell.conf

Add these two lines:

[Service]
Environment="JAVA_TOOL_OPTIONS=-XX:-UseBASE64Intrinsics"

Reload systemd, restart the service and read its last two journal lines:

sudo systemctl daemon-reload; sudo systemctl restart demoapp; sleep 3; journalctl -u demoapp --no-pager -n 2 -o cat

The JVM echoes the option it picked up, which proves the drop-in reached the process:

Started Demo Java service.
Picked up JAVA_TOOL_OPTIONS: -XX:-UseBASE64Intrinsics

The journal line shows the option arrived, not that the JVM applied it, so read the flag from the running process:

pid=$(systemctl show -p MainPID --value demoapp); sudo jcmd $pid VM.flags -all | grep UseBASE64Intrinsics

The value is false and its source is {environment}, which is the state to record for the audit:

     bool UseBASE64Intrinsics                      = false                                     {product} {environment}

SELinux stays enforcing throughout, because the flag changes a JVM setting and touches no policy or file labels. The other published stopgap, -XX:UseAVX=2, also closes the path but turns off every AVX-512 optimisation, and Calif warns an ARM64 JVM won’t even start with it, so keep it out of anything that runs on mixed architectures. A wrapper script that sets its own JAVA_TOOL_OPTIONS replaces the drop-in’s value, so check the journal line on every service you touch.

Once the rebuild lands, run the updateinfo check again before you upgrade. If check-update lists a .1.x build while updateinfo stays empty, upgrade the packages by name rather than by CVE, then remove the drop-in and restart. We tested that removal on Rocky 9: after deleting java4shell.conf, systemctl daemon-reload and a restart, jcmd reported UseBASE64Intrinsics = true {default} again, so the flag leaves nothing behind.

Prove every host the same way

A patch job that exits 0 isn’t the evidence. Each check below came from the host itself in our lab, and together they close the gaps this post walked through. In order:

  1. rpm -qa 'java-*-openjdk*' shows only .1.x builds for 17, 21 and 25 on RHEL.
  2. Each JDK under /usr/lib/jvm reports a .1+2 build string, not only the one java points at.
  3. No Java process maps libjvm.so (deleted) (on RHEL 10, sudo dnf needs-restarting -s also returns nothing).
  4. Every service on Rocky Linux or AlmaLinux logs Picked up JAVA_TOOL_OPTIONS: -XX:-UseBASE64Intrinsics at start until its rebuild is installed.
  5. JDKs that dnf doesn’t own (a product’s bundled runtime, a tarball under /opt, a container image) are on a fixed build or carry the flag.

Item 5 is where most estates still fail this week. Red Hat’s own data lists its UBI ubi10/openjdk-21 image as Affected, so containers built on it need a rebuild once Red Hat publishes the new image, and products such as Keycloak or Jenkins ship their own JDK whatever the host runs. The Java4Shell overview has the inventory loop for those, and the Ubuntu patch guide and Alpine guide cover the other distributions in a mixed fleet. If you’re building a new host, our guide to installing OpenJDK on RHEL, Rocky and AlmaLinux sets up the same packages, and they now install at the fixed build.

Keep reading

Java4Shell (CVE-2026-114938): Find and Patch Vulnerable JVMs Security Java4Shell (CVE-2026-114938): Find and Patch Vulnerable JVMs UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 Security UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 nginx HTTP/2 RCE CVE-2026-123007: Check, Disable HTTP/2, Patch Security nginx HTTP/2 RCE CVE-2026-123007: Check, Disable HTTP/2, Patch GL.iNet Security Notice: Check Your Router for Malware and Update Networking GL.iNet Security Notice: Check Your Router for Malware and Update Flatpak 1.18.6 Sandbox Escape CVEs: Check Version and Patch Security Flatpak 1.18.6 Sandbox Escape CVEs: Check Version and Patch How to Install OpenProject on CentOS 8, Rocky 8, Alma 8 AlmaLinux How to Install OpenProject on CentOS 8, Rocky 8, Alma 8

Leave a Comment

Press ESC to close