---
title: How Java4Shell can turn a rejected login into remote code execution
seoTitle: How to patch Java4Shell (CVE-2026-114938) in OpenJDK
slug: java4shell-cve-2026-114938
publishedAt: '2026-11-18T00:00:00.000Z'
author: Adaptive Team
category: Bits and Breaches
description: >-
  Check which JDKs and CPUs Java4Shell (CVE-2026-114938) affects, verify the
  patch in a running JVM, and see how Adaptive limits access after a compromise.
image: 'https://adaptive.live/blog/java4shell-cve-2026-114938/cover-coffee-spill.jpg'
imageAlt: >-
  Java-style steam curls above a tilted espresso cup as coffee spills across
  blue lines beside the Java4Shell title and Adaptive wordmark.
imageWidth: 1600
imageHeight: 840
canonical: 'https://adaptive.live/blog/java4shell-cve-2026-114938'
---

# How Java4Shell can turn a rejected login into remote code execution

**Java4Shell (CVE-2026-114938) is a memory-corruption flaw in OpenJDK's Base64 decoder. It can allow remote code execution (RCE) on affected x86-64 systems using AVX-512 VBMI.** On November 17, 2026, Calif reported that its researchers had run code before authentication on the Jenkins and Keycloak deployments they tested. The fix is to update the Java virtual machine (JVM) that runs the application and restart the service on the patched build. [Calif's disclosure](https://calif.io/java4shell/) and [OpenJDK's security advisory](https://openjdk.org/groups/vulnerability/advisories/2026-11-17).

## How can a rejected login put a JVM at risk?

A login service may need to decode a credential before it can decide whether to accept it. Base64 represents bytes as text for just this kind of exchange. In Calif researcher Quang Luong's tests, Java threw the expected exception for malformed input. By the time the application could catch it, the decoder had already written past the end of its output array. Another object in the same process could already have changed. [Calif's account of the decoder flaw](https://calif.io/java4shell/).

The processor matters because HotSpot, OpenJDK's virtual machine, can substitute a hand-written machine-code routine for an ordinary Java operation. This optimization is called an *intrinsic*. On x86-64 processors with the AVX-512 VBMI instruction set, HotSpot can use an intrinsic to decode many bytes at once. The flaw was in that routine. The patched decoder keeps writes inside its output array when it rejects malformed input. [Red Hat's Java4Shell bulletin](https://access.redhat.com/security/vulnerabilities/RHSB-2026-018).

[Animated comparison of the affected and patched Base64 decoders](https://adaptive.live/blog/java4shell-cve-2026-114938#decoder-comparison)

## Does Java4Shell affect ARM64 VMs?

No. Native ARM64 (AArch64) JVMs use a different Base64 decoder and are unaffected by CVE-2026-114938. That includes the ARM64 build of Amazon Corretto on AWS Graviton. If the same login service also runs on x86-64 VMs, check each guest's JDK build and whether its JVM can use AVX-512 VBMI. [Amazon Linux advisory](https://explore.alas.aws.amazon.com/CVE-2026-114938.html) and [Red Hat's hardware guidance](https://access.redhat.com/security/vulnerabilities/RHSB-2026-018).

## Which Java versions are affected?

OpenJDK's November advisory flags the **17, 21, 25, and 27** release lines for this CVE. On the 17 line, the affected code dates back to **17.0.6**. Match the full version and distributor to the runtime you ship. Vendors can backport an optimization or a fix on different schedules. [OpenJDK risk matrix](https://openjdk.org/groups/vulnerability/advisories/2026-11-17#risk-matrix) and [Red Hat bulletin](https://access.redhat.com/security/vulnerabilities/RHSB-2026-018).

For Oracle JDK, the table pairs an affected build on each of those four lines with its November 17 replacement. Oracle also identifies a Java 8 performance build (`8u511b33-perf`) and specific GraalVM builds in its advisory. Check the corresponding vendor release for those editions and other OpenJDK distributions. [Oracle Java SE risk matrix](https://www.oracle.com/security-alerts/cspunov2026.html#AppendixJAVA) and [Oracle's November 17 security baselines](https://www.oracle.com/java/technologies/javase/27-0-1-1-relnotes.html).

| Oracle JDK line | Affected build listed by Oracle | Fixed Oracle build on November 17, 2026 |
| --- | --- | --- |
| 17 | `17.0.21.0.3` | `17.0.21.1+4` |
| 21 | `21.0.13.0.3` | `21.0.13.1+4` |
| 25 | `25.0.5.0.3` | `25.0.5.1+4` |
| 27 | `27.0.1.0.3` | `27.0.1.1+4` |

## How do you patch Java4Shell and verify the rollout?

Suppose the host under a sign-in service has received its Java update, but the container image still bundles October's JDK. Restarting that container starts October's Java again. An application dependency scan can miss the same detail because the runtime can come from a base image or a vendor installation.

1. **Identify the live JVM.** Record the distributor, full build, and CPU features visible to the workload. Where JDK diagnostic tools are available, run `jcmd <pid> VM.version` in the service's environment with the same effective user and group as the JVM. This queries the process handling requests. [Oracle's jcmd reference](https://docs.oracle.com/en/java/javase/21/docs/specs/man/jcmd.html).
2. **Update the copy that supplies the runtime.** Rebuild container images from a fixed base and redeploy them. Update host-installed JDKs where services use them. For a product that includes its own runtime, apply the product vendor's supported update. [Docker's guidance on rebuilding images](https://docs.docker.com/build/building/best-practices/#rebuild-your-images-often).
3. **Check the replacement processes.** After the rollout, confirm the fixed build on every serving replica. Start a fresh worker from the template used for scaling or scheduled jobs and check its build too. That last check catches an old image that would otherwise return with tomorrow's traffic.

## How can Adaptive limit the impact of a Java RCE?

Code running inside a compromised JVM can use the permissions of that process. Consider a private Jenkins controller running a compatibility test. Engineers need the console, and the test job needs to read one PostgreSQL view in staging. Those are two separate grants.

**Restrict who can reach the controller.** Keep Jenkins on a private network and allow only Adaptive's broker to reach the console. Require single sign-on and MFA before engineers can launch Jenkins from Adaptive's app catalog. A containerized browser in an isolated sandbox opens the private Jenkins URL. Engineers interact with the streamed console through Adaptive, without direct access to that URL. For a public customer login service, prioritize the JVM update and apply these access controls to its private administration interfaces. [Adaptive's Jenkins integration](https://adaptive.live/integrations/jenkins) and [isolated browser sessions](https://adaptive.live/product/browser-isolation).

**Principle of least privilege.** Give the job its own Adaptive workload identity. Broker its database connection, keep the database password in the vault, and grant its PostgreSQL role read access to the staging view. Retire the old shared credential and restrict direct database connections. Code running as the job could still read that view. A write using the same role would be denied. Give release engineers a separate, expiring grant for production changes. [Workload identities](https://adaptive.live/product/workloads) and [just-in-time authorization](https://adaptive.live/product/authorization).

**Audit logs for user and data activity.** If the controller shows signs of compromise, correlate its host and JVM events with the queries Adaptive recorded for the job's brokered sessions. That lets responders ask which data the identity read during the exposure window. Revoke the affected grant, close existing sessions at the destination, and rotate any reusable credentials the process could read. [Adaptive audit logs](https://adaptive.live/product/audit) and [credential rotation](https://adaptive.live/product/credential-rotation).

## Frequently asked questions about Java4Shell

**Q: Is Java4Shell the same vulnerability as Log4Shell?**

They affect different components. Java4Shell (CVE-2026-114938) affects the Java runtime's Base64 decoder. Log4Shell (CVE-2021-44228) affects the Apache Log4j Core logging library. Each component has its own update. [OpenJDK advisory](https://openjdk.org/groups/vulnerability/advisories/2026-11-17) and [Apache Logging Services advisory](https://logging.apache.org/security.html#CVE-2021-44228).

**Q: Can Java4Shell affect a Java client with no public endpoint?**

Yes. Calif describes a demonstration in which a Java client was compromised while connecting to a malicious TLS server. Include outbound workers and scheduled jobs that connect to untrusted services when inventorying affected runtimes. [Calif's client-side finding](https://calif.io/java4shell/).

**Q: Is there a temporary mitigation if a JDK update has to wait?**

Red Hat documents the JVM startup option `-XX:-UseBASE64Intrinsics` for affected OpenJDK deployments. It disables the optimized Base64 implementation. Apply it to the service's launch configuration, restart the JVM, and verify the effective setting. Keep the vendor's fixed build on the rollout schedule. [Red Hat's mitigation guidance](https://access.redhat.com/security/vulnerabilities/RHSB-2026-018).

**Q: What protection can Adaptive provide while a public Java service awaits a patch?**

Adaptive can restrict access to private administration interfaces and limit which databases or other supported resources a compromised service can reach through the broker. Public requests still reach the application's decoder. That path needs the vendor's JVM fix or its supported temporary mitigation. [Adaptive workload access](https://adaptive.live/product/workloads) and [Red Hat's mitigation guidance](https://access.redhat.com/security/vulnerabilities/RHSB-2026-018).

---

Read this article as [Markdown](https://adaptive.live/blog/java4shell-cve-2026-114938/article.md) or [plain text](https://adaptive.live/blog/java4shell-cve-2026-114938/llms.txt).
