Skip to main content
Background

Java4Shell: A Closer Look and Patch Analysis (CVE-2026-114938)

November 19, 2026 by Akamai Security Intelligence Group

Share

Affected Akamai ExAR customers have already received a detailed mapping of vulnerable assets with actionable mitigation steps.

Key takeaways

On November 17, 2026, Oracle and the OpenJDK Vulnerability Group disclosed CVE-2026-114938, a memory corruption vulnerability in the Java Virtual Machine (JVM) that is publicly known as Java4Shell.

The flaw is in the Base64 decoding component of the JVM compiler. When a malformed input passes to the Base64 decoding operation it causes the JVM to write past the end of a heap buffer, which can lead to remote code execution (RCE) or crash an affected service.

Red Hat has rated the vulnerability Critical with a preliminary CVSS score of 9.8.

Exploitation requires an x86-64 processor that supports the Advanced Vector Extensions 512 Vector Byte Manipulation Instructions (AVX-512 VBMI) extension, a condition met by most servers released since 2021.

We analyzed the vulnerable routine in the OpenJDK source and the four-line upstream fix that closes it.

Vulnerability details

For performance, the JVM does not always use the Java implementation of the Base64 decoder. Once the decode method has run often enough the just-in-time (JIT) compiler replaces it with an intrinsic assembly routine that does the same job but faster.

Some Intel and AMD processors support AVX-512, a set of instructions that operates on 64 bytes at a time. Where those instructions are available, HotSpot (JVM compiler) selects a version of the decoding routine built on those instructions so it can do a faster job, and that version is where the flaw is.

The routine processes as many complete 64-byte blocks as it can, then handles whatever remains. The excerpt in Figure 1 is condensed from src/hotspot/cpu/x86/stubGenerator_x86_64.cpp and shows how that remainder is sized and written.

// Find (len / 4) * 3 (output length)
__ decrementq(output_size, 1);   // executed once per '=' padding character
__ movq(output_mask, -1);
__ bzhiq(output_mask, output_mask, output_size);
__ evmovdqub(Address(dest, dp), k1, tmp, true, Assembler::AVX_512bit);
Fig. 1: The vulnerability is an out-of-bounds heap caused by this code

The routine decodes 64 bytes at a time. When the input does not divide evenly into 64-byte blocks, whatever remains at the end is decoded separately, and it is this leftover that the vulnerability concerns.

The routine computes the output length for that leftover as (len / 4) * 3. It then decrements that length once for each = padding character it finds. 

Finally, it builds a write mask from the result using the bzhiq instruction, and uses that mask to control how many bytes are committed to memory (using the evmovdqub instruction).

The routine works as long as the output length is correct. If the leftover is Y2E=, the encoding of ca, the length is (4 / 4) * 3, which is 3, minus one for the =, leaving 2(“c” and “a”).

Two bytes are committed and written back. If the leftover is a single =, the length is (1 / 4) * 3, which is 0, and the decrement underflows it to −1. Because bzhiq works with 64 bits each time and because -1 is considered as a very large number, the returned size of the output string will be 64 instead of none.

The route to code execution

We believe the route to code execution runs through heap grooming, a technique in which an attacker issues ordinary requests to shape the layout of an application’s heap so that the overflow lands on a chosen neighboring object rather than on arbitrary memory.

The most useful target is an array length field. The spilled bytes are fixed, but read as a number they are large, and overwriting a length with them causes the JVM to permit access well beyond that array’s real bounds. That converts a fixed and uncontrolled write into a read and write primitive an attacker might be able to direct (Figure 2).

 That converts a fixed and uncontrolled write into a read and write primitive an attacker might be able to direct (Figure 2).
Fig. 2: The Java4Shell (CVE-2026-114938) exploitation flow
 That converts a fixed and uncontrolled write into a read and write primitive an attacker might be able to direct (Figure 2).

Patch analysis

The fix is four lines, and it is instructive precisely because it is so small. The fix commit adds the following guard at the point where the routine begins handling the remaining input:

// A padded Base64 tail shorter than one complete block is handled by Java.
__ cmpl(length, 4);
__ jcc(Assembler::less, L_bruteForce);

The check runs before the output length is computed. Any remainder shorter than a single four-character block is routed to L_bruteForce, the slower scalar decoding path, and never reaches the vector code. Because the underflow depends on the division yielding zero, excluding those short inputs removes the only condition under which the exploit can occur.

Notably, the fix does not correct the arithmetic or add a bounds check to the store. It removes the input shape that made the arithmetic wrong.

Prerequisites for an attack

Several conditions must hold together for a system to be exploitable.

  • An affected runtime. This includes OpenJDK 17.0.6 or later, including the 21 and 25 release lines, or a downstream build based on one of them.

  • A processor supporting AVX-512 VBMI.

  • A reachable decode path. The application must pass attacker-controlled data to a Base64 decode operation. 

Red Hat notes that a host’s processor can be checked for the required capability by inspecting /proc/cpuinfo for the avx512vbmi flag.

Affected versions

The vulnerability was introduced with the AVX-512 implementation of the decoder and is present in the following versions:

  • OpenJDK 17.0.6 and later, including the 21 and 25 release lines

  • Oracle Java SE 8u511b33-perf, 17.0.21.0.3, 21.0.13.0.3, 25.0.5.0.3, and 27.0.1.0.3

  • Oracle GraalVM for JDK 17.0.21.0.3 and 21.0.13.0.3, and Oracle GraalVM Enterprise Edition 21.3.20.0.3

  • Red Hat Enterprise Linux 8, 9, and 10, and the Red Hat build of OpenJDK 17, 21, and 25, along with any Red Hat product supported on Red Hat Enterprise Linux

  • Downstream builds of the affected OpenJDK lines, including Amazon Corretto, Eclipse Temurin, Microsoft Build of OpenJDK, Azul Zulu, BellSoft Liberica, and SAP SapMachine

Unaffected versions

  • OpenJDK 8 and OpenJDK 11, in which the accelerated decoder was never implemented

  • ARM64 systems, because the intrinsic is specific to x86-64

  • x86-64 processors that do not support AVX-512 VBMI, including Intel Xeon Skylake, Cascade Lake, and Cooper Lake, which support AVX-512 but not the VBMI extension

Mitigation

We discussed mitigation in a previous blog post. Following the release of official vendor fixes, we have the updated version requirements alongside new detection scripts and queries to help locate vulnerable hosts. 

Upgrade to a patched version

On November 17, 2026, Oracle released fixes in its November 2026 Critical Security Patch Update, and the OpenJDK Vulnerability Group published a corresponding advisory. 

Upgrade to the following versions:

  • OpenJDK 17: 17.0.21.1

  • OpenJDK 21: 21.0.13.1

  • OpenJDK 25: 25.0.5.1

  • OpenJDK 27: 27.0.1.1

Identify vulnerable hosts with Akamai Guardicore Segmentation

To determine whether your hosts are affected, you can use this GitHub repository.

The following Akamai Guardicore Segmentation Insight queries can be used to detect and segment vulnerable applications:

SELECT
    CASE
      WHEN c.avx512f != '1' OR c.bmi2 != '1'
        THEN 'NOT VULNERABLE - CPU lacks required flags'
      WHEN p.cmdline LIKE '%-XX:-UseBASE64Intrinsics%' OR p.cmdline LIKE '%-XX:UseAVX=2%'
        OR p.cmdline LIKE '%-XX:UseAVX=1%' OR p.cmdline LIKE '%-XX:UseAVX=0%'
        THEN 'MITIGATED - JVM flag set'
      WHEN COUNT(lp.port) > 0
        THEN 'POTENTIALLY VULNERABLE - EXPOSED on network'
      ELSE 'POTENTIALLY VULNERABLE - not listening on network'
    END AS verdict,
    CASE WHEN p.cmdline LIKE '%-XX:-UseBASE64Intrinsics%' THEN 'UseBASE64Intrinsics off'
         WHEN p.cmdline LIKE '%-XX:UseAVX=%' THEN 'UseAVX set'
         ELSE 'none on command line' END AS mitigation_flag,
    regex_match(p.path, '(1[.]8[.][0-9_]+|[0-9]+[.][0-9]+[.][0-9]+)', 1) AS java_version_from_path,
    (SELECT group_concat(name || ' ' || version, '; ') FROM rpm_packages
       WHERE name LIKE '%openjdk%' OR name LIKE 'jdk%' OR name LIKE 'jre%') AS rpm_java_packages,
    (SELECT group_concat(name || ' ' || version, '; ') FROM deb_packages
       WHERE name LIKE '%openjdk%' OR name LIKE '%-jdk%' OR name LIKE '%-jre%') AS deb_java_packages,
    c.avx512f, c.bmi2,
    p.pid, p.name, p.path, p.cmdline,
    group_concat(DISTINCT lp.port) AS exposed_ports
  FROM processes p
  CROSS JOIN (
    SELECT MAX(CASE WHEN feature = 'avx512f' THEN value END) AS avx512f,
           MAX(CASE WHEN feature = 'bmi2' THEN value END) AS bmi2
    FROM cpuid
  ) c
  LEFT JOIN listening_ports lp
    ON lp.pid = p.pid AND lp.port != 0
    AND lp.address NOT IN ('127.0.0.1', '::1', '::ffff:127.0.0.1')
  WHERE p.name LIKE 'java%'
  GROUP BY p.pid
SELECT
    CASE
      WHEN c.avx512f != '1' OR c.bmi2 != '1'
        THEN 'NOT VULNERABLE - CPU lacks required flags'
      WHEN p.cmdline LIKE '%-XX:-UseBASE64Intrinsics%' OR p.cmdline LIKE '%-XX:UseAVX=2%'
        OR p.cmdline LIKE '%-XX:UseAVX=1%' OR p.cmdline LIKE '%-XX:UseAVX=0%'
        THEN 'MITIGATED - JVM flag set'
      WHEN COUNT(lp.port) > 0
        THEN 'POTENTIALLY VULNERABLE - EXPOSED on network'
      ELSE 'POTENTIALLY VULNERABLE - not listening on network'
    END AS verdict,
    CASE WHEN p.cmdline LIKE '%-XX:-UseBASE64Intrinsics%' THEN 'UseBASE64Intrinsics off'
         WHEN p.cmdline LIKE '%-XX:UseAVX=%' THEN 'UseAVX set'
         ELSE 'none on command line' END AS mitigation_flag,
    regex_match(p.path, '(1[.]8[.][0-9_]+|[0-9]+[.][0-9]+[.][0-9]+)', 1) AS version_from_path,
    (SELECT group_concat(name || ' ' || version, '; ') FROM programs
       WHERE name LIKE '%Java%' OR name LIKE '%JDK%' OR name LIKE '%JRE%'
          OR name LIKE '%Temurin%' OR name LIKE '%Corretto%' OR name LIKE '%Zulu%') AS installed_java_programs,
    c.avx512f, c.bmi2,
    p.pid, p.name, p.path, p.cmdline,
    group_concat(DISTINCT lp.port) AS exposed_ports
  FROM processes p
  CROSS JOIN (
    SELECT MAX(CASE WHEN feature = 'avx512f' THEN value END) AS avx512f,
           MAX(CASE WHEN feature = 'bmi2' THEN value END) AS bmi2
    FROM cpuid
  ) c
  LEFT JOIN listening_ports lp
    ON lp.pid = p.pid AND lp.port != 0
    AND lp.address NOT IN ('127.0.0.1', '::1', '::ffff:127.0.0.1')
  WHERE (p.name LIKE '%java%' OR p.name LIKE '%tomcat%'
     OR p.path LIKE '%jre%' OR p.path LIKE '%jdk%' OR p.path LIKE '%java%'
     OR p.cmdline LIKE '%-jar %' OR p.cmdline LIKE '%jvm.dll%' OR p.cmdline LIKE '%-Xmx%')
    AND p.name NOT LIKE 'gc-insight%' AND p.name NOT LIKE 'osquery%'
  GROUP BY p.pid

The limits of memory safety

Java is a memory-safe language, and that is often why it is used. Developers do not manage memory directly, every array access is bounds checked, and a defect of this kind should not be reachable from ordinary application code at all.

Memory safety does not eliminate memory corruption so much as relocate it. What it removes from millions of lines of application code, it concentrates into the comparatively small amount of unsafe code that all of those lines run on: the runtime, the just-in-time compiler, and the routines they call on for speed.

We recommend upgrading to a patched Java runtime, with particular attention to runtimes embedded inside applications and appliances, where they are easily missed.

Stay tuned

The Akamai Security Intelligence Group will continue to monitor, report on, and create mitigations for threats such as these for both our customers and the security community at large. To keep up with more breaking news from the Akamai Security Intelligence Group, check out our research home page and follow us on social media.

About the author

Akamai wave logo

Akamai Security Intelligence Group

Akamai SIG is a global team of world-class researchers, engineers, strategists, and data scientists with a broad range of expertise and security disciplines. Our data sources include the enormous Akamai Cloud, open sources, collaboration with third parties, and dark web intelligence. We have also developed our own algorithms and tools that help us deliver our research and keep Akamai security solutions up to date.