Dispatches from the end of the world as we know it @widesprdchaos on X ↗

Security Dispatch

After AI found Java4Shell in an hour, Calif wants it flagging code to delete

An AI model helped find a memory-corruption flaw in Java's Base64 decoder in about an hour, according to the security firm Calif. Base64 is a common way of writing binary data as plain text, and memory corruption means a program writes data where it should not. Calif says its researcher Quang Luong needed two more hours to build the first working exploit. The total token cost, what Calif paid for the model's processing, which is billed in chunks of text called tokens, was less than $200. Calif calls the flaw Java4Shell. That speed is a little unnerving. Calif's response is the hopeful part: point the same kind of AI at code that never needed to ship, and flag it for removal. A separate disclosure from Veria Labs, about a single German letter in Ruby, suggests how delicate that flagging could be.

ListenMP3

Java's flaw sat in assembly written only to decode Base64 faster

OpenJDK is what Calif calls the most popular Java runtime, the software that actually runs Java programs. Calif writes that it speeds up Base64 decoding on supported x86-64 processors, the chip family in most servers and PCs, using special instructions that handle many bytes at once. The bug sits in hand-rolled assembly, code written directly in the processor's own instructions, that handles the last few characters. Feed it 64 letter A's followed by a single =, and the routine writes 62 bytes past the end of the memory set aside for the result. Java rejects the malformed input only after that write.

Calif says it demonstrated remote code execution without any login in the default configurations of products including Jenkins, Atlassian Jira and Keycloak. Remote code execution means an attacker runs their own code on someone else's server. Luong writes that Codex, an AI coding model, first brought back mostly unusable results, so Luong "prompted harder" until the Base64 bug surfaced. Calif sums it up: "On affected systems, an optimization few applications needed became a serious security risk."

Ruby's flaw sat in a one-letter exception for older text encodings

Veria Labs calls its flaw Ruby2ßhell. A text encoding is the rule a program uses to turn characters into bytes. Ruby supports several encodings in which every character takes one byte, including some from the ISO-8859 and Windows-125x families. Most have no capital ß, so uppercasing it produces two letters, SS. Ruby's conversion loop checks for room for one byte, then writes two. With 21 ß's, the result spills one byte past its buffer, the block of memory reserved for it. That is a heap overflow.

Veria Labs says Rails and classic-style Sinatra, two web frameworks for building Ruby sites, reach the bug in their default configuration. The firm titles its advisory a remote code execution bug that needs no login. Strings in UTF-8, an encoding that covers nearly every writing system, take a different code path and are not affected. Fixes are in Ruby 3.3.14, 3.4.13 and 4.0.10.

Calif pitches the bug-finding AI as a scout for code worth removing

Calif's broader answer to Java4Shell is subtraction, and the firm calls it vibe-uncoding. Human researchers work with AI, a pairing Calif calls the centaur hacker. Together they comb a large codebase and flag dead code, bloated features and needless optimizations. People then keep what a system actually needs and remove the rest. That shrinks the attack surface, the set of places an attacker can reach.

Calif points to its earlier find, Squidbleed, a bug that had been hiding since 1997 in the FTP module of Squid, a proxy server that relays web traffic. FTP is an old file-transfer protocol, and Calif asks who uses it anymore. The firm frames the idea as a question: "With AI, everyone is asking, 'What can we build?' But maybe the right question for security is, 'What can we delete?'"

Calif says AI can make that work practical at a scale it could not previously afford. If the speed behind Java4Shell can also be aimed at cleanup, that is a genuinely hopeful use of it.

Ruby's legacy path looks disposable, yet Veria Labs warns applications still reach it

Calif concedes that removing code is harder than it sounds, because "An apparently unused feature may have hidden dependencies." Even its own example has beneficiaries. The firm writes that the Base64 optimization helps applications that decode enormous amounts of data.

Ruby's flawed loop looks like an obvious entry for a deletion list. It is a one-letter exception inside encodings that Veria Labs calls legacy, on a path UTF-8 text never takes. Yet Veria Labs also warns that application code which uppercases strings received in a legacy encoding may be vulnerable. That warning only makes sense if some programs still receive text that way. Two popular frameworks reach the path by default. Deleting it would close the bug, and it might also break whatever still sends text down it.

Who tells the model which narrow paths are still in use?

A model that can surface a flaw like Java4Shell in an hour could presumably flag many more narrow, rarely touched corners just as quickly. Neither disclosure explains how such a model would learn which of those corners someone, somewhere, still quietly relies on. So who supplies that knowledge before a flag becomes a deletion?

A price tag for finding flaws, and none yet for knowing who depends on them

Calif's account puts a price on finding a deep flaw in Java: three hours and less than $200. Neither write-up puts a price on knowing who still sends Ruby text in an old encoding, or who decodes enough Base64 to need the fast version. If AI is going to help shrink the software everyone shares, that unpriced knowledge is where the work will be watched most closely. It is encouraging that someone is asking the question this early.

Sources

  1. verialabs.com/ruby2shell
  2. calif.io/java4shell