Major Flaw in Java Found Using Codex

A security researcher used an AI cybersecurity model in a coding agent and found a serious flaw in the software that runs most Java applications.

Share
A dark, retro-terminal graphic with pixel-font "KEYCLOAK" lettering and a green key icon. Below it, a timestamped exploit log targets a Keycloak 26.8.1 server, listing steps like re

A security researcher used an AI cybersecurity model in a coding agent and found a serious flaw in the software that runs most Java applications. On servers with recent Intel or AMD processors, the flaw allows attackers to execute code in widely used business applications without logging in. 

What’s new: Calif, a security startup, disclosed Java4Shell, a memory-corruption bug in the Base64 decoder of OpenJDK. OpenJDK is the open-source code behind most Java runtimes, including Oracle’s, Amazon’s, and Microsoft’s. Oracle and OpenJDK released fixes on November 17. The same day, the U.S. Cybersecurity and Infrastructure Security Agency urged organizations to patch their software immediately. 

How it works: Generally, Java checks memory access in programs written in the Java language so bugs can’t corrupt memory. However, parts of the Java runtime are composed of modules in the lower-level assembly language, where those checks don’t exist. The flaw is in the assembly module Java uses to decode Base64, a common way of sending binary data as text.

  • Base64 writes every 3 bytes of binary data as 4 text characters and pads the end with “=” signs. Online servers decode it constantly in login headers, tokens, and file uploads.
  • When a program decodes a large amount of Base64 text, the runtime’s just-in-time compiler replaces Java’s decoder with a hand-tuned assembly routine. On chips with AVX-512 VBMI, this routine decodes 64 characters at a time.
  • The decoder ends with one instruction that writes 64 bytes at once, using a mask to keep only the bytes that belong in the result. To set the mask, the decoder counts how many bytes the leftover characters hold and subtracts 1 for each equal sign. A single “=” represents no bytes, so the count comes out to -1 when evaluated, which the chip treats as “keep all 64 bytes.” Given 64 “A”s and an “=”, the decoder writes 62 bytes past the end of the space Java set aside. Java rejects the input afterward, but the neighboring memory is already overwritten.
  • Calif used the overwrite to make nearby blocks of memory look bigger than they were, letting Calif read data it shouldn’t see and eventually execute its own code remotely on the server.

Who’s affected: The flaw reaches most current versions of Java, but only on certain processors.

  • Unpatched Java 17 from update 17.0.6 onward is affected, as are Java 21, 25, and 27. Standard builds of Java 8 and 11 don’t contain the vulnerable code.
  • Calif demonstrated the exploit on test servers running widely used business software, including Jira, Confluence, Jenkins, and Keycloak, with default settings without logging in. Calif also said that logins and file uploads in other applications can expose the flaw.
  • Only x86-64 processors that support AVX-512 VBMI, instructions that work on 64 bytes at once, run the vulnerable code. These include Intel Xeon chips from Ice Lake to the present and AMD chips from Zen 4 to the present. ARM servers are not vulnerable to the hack.
  • It’s unclear exactly how many servers are exposed, but one company’s check suggests the share may be small. Elastic, which sells a hosted cloud version of its Elasticsearch software, found that fewer than 5 percent of its customers’ deployments ran on vulnerable chips. All of those were on Microsoft Azure. None of its deployments on Amazon Web Services or Google Cloud were affected.

How the team used AI: In Calif’s account, researcher Quang Luong told OpenAI’s coding agent Codex to audit the just-in-time compiler, hand-tuned assembly routines, widely used APIs, and cryptography “like any serious security researcher in 2026.” Calif said the agent’s transcripts show that Codex didn’t look up existing bug reports.

  • Calif used GPT-6 Cyber in Codex to find the flaw, according to The New York Times. GPT-6 Cyber is a version of GPT-6 Astra that OpenAI fine-tuned to find security vulnerabilities.
  • Most of the leads Codex returned at first were “slops,” Luong wrote, bugs that were unreachable or unrealistic to exploit. After about 20 minutes of prompting and discarding them, Codex reported the Base64 flaw. Finding the bug took about an hour, and a first working exploit took two more hours. The tokens used cost less than $200, Calif said.
  • When the agents got stuck arranging memory for specific applications, Calif wrote a small tool that showed them the state of the runtime’s memory. Agents built most of the later attack chains “almost autonomously,” Calif said.

Yes, but: Analysts disagree about how dangerous the flaw is. On CVSS, the standard 10-point severity scale, 9.0 or higher counts as critical. Calif rates Java4Shell 9.2, and Red Hat rates it 9.8. OpenJDK’s advisory rates it 8.1, judging an attack highly complex. Datadog found that crashing an application is easier than taking control of it. Calif built working attacks against at least 11 widely used applications, but each one needed its own custom attack, because each application uses Base64 and arranges its memory differently. No attacks had been reported as of November 17, according to CyberScoop.

Why it matters: Java4Shell is one of a fast-growing number of serious flaws found with AI tools. In October, Calif disclosed PHP2Shell, flaws in the PHP web programming language that a researcher found with an AI assistant. That same month, OpenAI used GPT-6 Cyber to produce working attacks for 948 flaws in Linux. AI is making it faster and cheaper to find bugs in old, heavily used code, including low-level optimized code that safety features like Java’s memory checks don’t cover. Calif recommends a program of “vibe uncoding,” using AI to find and remove code that a system doesn't actually need, which could cut down on future attack surfaces.

We’re thinking: When a working attack can follow a bug report within hours, developers’ jobs get that much harder. Ideally, AI models and agents can help find and install fixes for widely used software before they ship — and patch them as quickly as possible as soon as new ones are found.