Java4Shell HotSpot Flaw Can Enable Heap Disclosure and Remote Code Execution

· Original article ↗

Summary

Java4Shell (CVE-2026-114938) is a HotSpot Base64 decoder heap overflow on x86-64 CPUs with AVX-512 VBMI. The article explains how malformed padding triggers the overwrite, potential heap disclosure or RCE, affected JDKs, and mitigations.

Key points

  • Malformed Base64 padding can make HotSpot's C2 decoder calculate a negative output length, producing an all-ones mask and a 64-byte store that writes 62 bytes beyond the output buffer.
  • The overwrite can crash the JVM or expose heap data such as private keys and tokens; unauthenticated RCE may be possible with an application-specific exploit.
  • The vulnerable code path requires an x86-64 CPU with AVX-512 VBMI and a decoder compiled by C2; ARM64 is not affected.
  • The article identifies OpenJDK 17.0.6 and newer and downstream distributions as affected, subject to the CPU requirement, and lists affected Oracle Java versions.
  • The described exploit chain manipulates neighboring heap objects to expand read and write capabilities; heap layout, network timing, and application behavior constrain exploitation.
  • The article recommends applying vendor JDK patches. Temporary mitigations are disabling Base64 intrinsics with -XX:-UseBASE64Intrinsics or limiting JVM AVX use with -XX:UseAVX=2.
  • It also recommends inventorying bundled Java runtimes and investigating repeated JVM crashes, bursts of Base64 decoding errors, and unusually large responses.

Article Details

Attack Vectors
  • An attacker can send malformed padded Base64 to an application that decodes attacker-supplied input using an affected JDK on an x86-64 CPU with AVX-512 VBMI; the decoder's C2-compiled intrinsic can write beyond its output buffer.
  • The article describes application-specific HTTP exploit chains that can use the memory corruption to crash the JVM, disclose heap contents, or potentially achieve unauthenticated remote code execution. Each target requires its own exploit.
Defensive Notes
  • Patch affected JDKs using the distribution vendor's patched build, prioritizing internet-facing systems; check runtimes bundled in applications, containers, and appliances as well as host-installed JDKs.
  • Until patched, disable the vulnerable path with -XX:-UseBASE64Intrinsics or, on x86-64, -XX:UseAVX=2; verify the setting takes effect before relying on it.
  • Check for the required CPU flags avx512f, avx512bw, avx512vbmi, and bmi2 when prioritizing exposure; the article states ARM64 is not affected.
  • Investigate unexpected JVM crashes or restarts, bursts of Base64 decoding errors on an endpoint, and unusually large responses from endpoints that echo decoded data.

MITRE ATT&CK

CVE

Vendors

Products

Related Articles