Technology News • • 5-8 minutes

Java4Shell: the Java bug that runs code before you log in

Diego Cortés
Diego Cortés
Full Stack Developer & SEO Specialist
Share:
Java4Shell: the Java bug that runs code before you log in
Image generated with AI

A bug in the JVM's Base64 decoder runs code before the server asks for a password. It is called Java4Shell, patches shipped on November 17, and it only bites x86 servers with AVX-512 VBMI.

What Java4Shell is

CVE-2026-114938 is a memory corruption bug in HotSpot, the virtual machine inside OpenJDK. The nickname plays on the Log4Shell parallel: the flaw is not in your application but in a piece of infrastructure everyone treats as safe, and only a specific CPU can reach it.

The Base64 shortcut built on AVX-512

HotSpot does not decode Base64 in plain Java when it can avoid it. It has a hand-written assembly routine that is far faster, and the JIT compiler wires it in once it sees a hot decode loop. That routine only exists on x86-64 with AVX-512 VBMI, meaning recent server silicon. On ARM or on an x86 chip without those instructions, the JVM takes the portable path and the bug is unreachable.

From overflow to pre-auth RCE

The trouble sits in the output mask calculation when the input ends in padding. With 65 bytes, 64 A characters plus an equals sign, the arithmetic drops below zero and the write lands 62 bytes past the buffer. That corrupts the heap: at minimum the JVM dies, and with the right technique it becomes code execution with no credentials.

Who is exposed

OpenJDK 17 from 17.0.6 onward, plus any 21, 25 or 27 build running on a CPU with AVX-512 VBMI. Java 11 and standard Java 8 are not on OpenJDK's list; the Java 8 entry at Oracle is the Enterprise Performance Pack, so check build by build.

How to check whether your server has AVX-512 VBMI

grep -m1 '^flags' /proc/cpuinfo | grep -qw avx512vbmi && echo EXPOSED || echo OK

In containers, run it on the node and not in the pod: the host flags are not always visible. A JVM inside a virtual machine inherits whatever the hypervisor exposes, not the physical chip.

Six applications with pre-auth RCE

Calif names Keycloak, Jira, Confluence, Artifactory, Jenkins and PingFederate in default configuration, all because they decode Base64 before authenticating. With a session open the list grows to Kafka Broker, Solr, Elasticsearch, Gerrit and Spinnaker. It is not a closed inventory: any framework that accepts a token before asking for credentials opens the same door.

Patch or mitigate

The flag that switches the shortcut off

While the patch is in flight, Adoptium, Elastic and the Kafka team all recommend starting with -XX:-UseBASE64Intrinsics: it kills only that intrinsic and leaves the rest of the AVX-512 work alone. It is a bridge with a cost on workloads that decode a lot of Base64. The alternative -XX:UseAVX=2 lowers AVX for the whole JVM.

Patch for real

The fixed builds are 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1. Temurin's November builds already carry the fix, as do Corretto, Zulu and Red Hat OpenJDK, but the number differs per vendor: the fix lives in the build, not in the branch version. On severity, three scores coexist: CVSS 3.1 of 8.1 per Oracle, CVSS 4.0 of 9.2 per Calif, and 9.8 per Red Hat.

What internet sensors are seeing

CISA urged teams to patch, though as of November 17 the CVE was not in the KEV catalog. GreyNoise counted 187 probe sessions with no confirmed success, Previdian reports 9 attempts, and WatchTowr and Cloudflare describe broad scanning. Cloudflare also shipped a WAF rule for the malformed Base64 value: there is interest, but no documented successful campaign.

What I would do this week

  • Inventory every JVM, including containers and the CI runner.
  • Check CPU flags on each node and write down which ones are exposed.
  • Move to the patched build; if that has to wait, start with the bridge flag.
  • Watch logs and outbound traffic on Keycloak, Jenkins or Jira, and set a date to drop the flag.

Conclusion

The lesson is not that Java is insecure. It is that the pre-authentication surface includes the parsers, and someone else wrote those. The same pattern shows up in the FBI warning about ARTEX and in the guide on blocking or allowing AI agents on your site.

Categories