AGENTIC COMMONSAI industry briefings

繁中EN

TopicAI Safety & SecurityPublished

All English articles

Cloudflare WAF Java4Shell Rules Ship in Log Mode

Summary: On November 17, 2026, the security firm Calif disclosed Java4Shell (CVE-2026-114938), a heap-corruption flaw in OpenJDK’s Base64 decoder that scores 9.2 out of 10 (Critical) under CVSS 4.0. A day later, Cloudflare shipped six managed WAF rules to detect the malformed Base64 that triggers it — enabled by default, but in Log mode only, on Pro plans and above. If you run Java services on x86-64, the rule toggle is the second thing to do this week, not the first.

A 64-byte write the application never sees

The bug is in the handwritten assembly behind OpenJDK’s Base64 intrinsic, which uses AVX-512 instructions to decode 64 bytes at a time on x86-64. When padding characters (=) land where valid Base64 never puts them, the routine computes a negative output length, and that becomes a full 64-byte write past the buffer. Cloudflare’s example: a 65-character input (64 characters plus one =) gets a 50-byte output array and then writes 62 bytes past its end.

Two details make this nastier than a parsing bug. Java throws an exception for the invalid input — but only after the neighboring memory is already overwritten, so application-level validation is useless. And Calif, per Cloudflare’s account, built its first working local exploit in about three hours using AI agents, which is why Cloudflare expects other exploit chains to appear quickly.

The saving grace is that exploitation is fiddly: the overwritten bytes are mostly fixed values, the attacker mainly controls where the write lands, and each target needs its own heap-grooming chain. Calif demonstrated pre-authentication RCE against Keycloak, Atlassian Jira and Confluence, JFrog Artifactory, Jenkins and PingFederate in default configurations, and post-authentication RCE against Kafka, Solr, Elasticsearch, Gerrit and Spinnaker.

Who is actually exposed

All three conditions must hold: OpenJDK 17.0.6 or newer (including Corretto, Temurin, Microsoft Build of OpenJDK, Azul, Liberica, SapMachine, Red Hat’s build, Oracle Java SE and GraalVM); an x86-64 CPU with AVX-512 VBMI such as Intel Ice Lake onward or AMD Zen 4 onward; and an application decoding attacker-controlled Base64. ARM64 processors are not affected. Two operational traps: container images bundle their own JDK, so upgrading the system package fixes nothing inside them, and every patched service needs a restart.

Our take: Act now, but start with the runtime, not the edge. For a small team, -XX:-UseBASE64Intrinsics (or -XX:UseAVX=2, x86-64 only — ARM JVMs fail to start with it) plus a restart is an afternoon’s reversible work, on the assumption you can tolerate a restart window and some slowdown on Base64-heavy decoding. The WAF rule, by contrast, ships logging and blocking nothing; Cloudflare’s own advice is to review Security Events matches before flipping it to Block, and for internet-facing auth endpoints we’d do exactly that same day, given pre-auth RCE in default configs. Teams on ARM64, or with every runtime already patched, can ignore the whole item; Free-plan users have no managed rule yet, so the flag and the patch are their only options. If no exploitation appears — Cloudflare reports none on its infrastructure so far — Log mode may remain enough for low-exposure internal services; the first observed in-the-wild attack reverses that immediately.

What the rules catch, and what slips past

The six rules — covering headers, query values, body values, path segments, Base64url JWT components and WebAuthn values — sit in the Cloudflare Managed Ruleset and match the malformed Base64 pattern. Business and Enterprise plans can add the ML-based attack score, which Cloudflare says catches multi-stage chains (heap-grooming parameters, second-stage payloads like /bin/sh -c or Java class-loading gadgets) rather than the raw trigger, which looks like opaque garbage to injection-trained models.

A WAF only sees HTTP through Cloudflare, and Cloudflare is explicit about the gaps: Base64 nested inside another encoding, non-HTTP protocols like Kafka’s, a client-side exploit where a Java program connects out over TLS to a malicious server, and internal traffic that never traverses the edge. The company calls the WAF “an additional layer of defense, not a replacement for the patch,” and Oracle shipped fixed builds in its November 2026 Critical Patch Update the same day as the disclosure.

The Cloudflare post’s deployment walkthrough goes further than this piece — rule IDs, the exact settings path, and attack-score custom rules — if you want the step-by-step. The pattern also fits a broader move toward the WAF judging requests in fuller context, which this blog has followed before. Oracle’s same-day patch, plus a one-flag workaround, means the boring fix is available to everyone today — including shops that will never see a Cloudflare log line.

Sources

AGENTIC COMMONSOperated by PHLEGON LABS
ShareXEmail
Support us

Related reading

  1. Cloudflare PHP CTF: Try Bypassing Its WAF

    Cloudflare launched a PHP Capture the Flag challenge inviting researchers to bypass its WAF on a deliberately vulnerable sandbox.

    Cloudflare

  2. Cloudflare 2026 midterms: attacks came weeks early

    Cloudflare's midterm data: vulnerability probes outnumbered DDoS 180 to 1 on election sites, peaking weeks before the vote — harden year-round.

    Cloudflare

  3. Cloudflare Sees AI Pentest Traffic Rise 30x Since October

    Cloudflare reports AI pentest traffic up 30x since October 1, but the breaches it details ran on unscoped CI/CD tokens.

    Cloudflare