Back to Blog

Claude Wrote a Full FreeBSD Remote Kernel RCE with Root Shell (CVE-2026-4747)

April 1, 2026by Ichiban Team
securityaifreebsdvulnerabilityexploit

Hero

#Introduction

The intersection of artificial intelligence and offensive cybersecurity has just witnessed a watershed moment. Security researchers have revealed that Anthropic’s large language model, Claude, successfully authored a complete, reliable Remote Code Execution (RCE) exploit targeting the FreeBSD kernel. The vulnerability, tracked as CVE-2026-4747, allows an unauthenticated remote attacker to gain a root shell.

While AI models have previously demonstrated capabilities in identifying potential vulnerabilities or writing simple userland exploits, crafting a multi-stage remote kernel exploit is notoriously complex. It requires an intimate understanding of memory management, kernel mitigations, and precise timing. The fact that an LLM could synthesize these requirements into a weaponized payload signals a paradigm shift in how we must approach vulnerability management and system defense.

#What Happened

CVE-2026-4747 stems from a critical flaw within the FreeBSD network stack, specifically involving a race condition and subsequent Use-After-Free (UAF) in the handling of malformed IPv6 extension headers. When parsed concurrently under heavy load, the kernel frees an mbuf (memory buffer) but retains a dangling pointer in the packet processing queue.

According to the security researchers at Califio, they provided Claude with the bare minimum: the kernel crash dump, the vulnerable source code snippet from the FreeBSD network subsystem, and a prompt to develop a working proof-of-concept.

Over a series of iterative prompts, Claude didn't just provide theoretical exploit steps; it generated python code to trigger the vulnerability, manipulate the kernel heap layout (Heap Feng Shui), and execute a sophisticated Return-Oriented Programming (ROP) chain. The model autonomously figured out how to:

  • Spray the heap to reliably reclaim the freed mbuf with controlled data over a network connection.
  • Bypass KASLR (Kernel Address Space Layout Randomization) by chaining an initial information leak primitive it discovered in the ICMPv6 response handler.
  • Construct a ROP chain that pivots the stack, disables Supervisor Mode Access Prevention (SMAP), and executes the final shellcode to spawn a reverse root shell.

#Why It Matters

Historically, the window between a vulnerability disclosure and the release of a weaponized remote kernel exploit could range from weeks to months. Kernel exploitation is a highly specialized, artisanal process. Researchers spend hundreds of hours analyzing memory allocator behavior, finding useful gadgets, and ensuring the exploit doesn't trigger a kernel panic.

Claude's success drastically compresses this timeline. If an AI can reliably translate a crash dump and a patch diff into a weaponized zero-click remote root exploit, the "time-to-exploit" metric effectively drops to near zero.

  • Lowering the Barrier to Entry: Advanced persistent threats (APTs) and elite vulnerability research teams are no longer the only entities capable of developing reliable kernel RCEs.
  • The Death of "Security by Obscurity": Relying on the complexity of a system or the extreme difficulty of exploitation as a defensive layer is no longer viable.
  • Automated Weaponization: We are entering an era where vulnerability scanners could potentially be paired with LLMs to not just find missing patches, but automatically generate custom exploits to breach unpatched systems at scale.

#Technical Implications

Developing a remote kernel exploit requires bypassing several modern exploit mitigations. Claude's approach to the FreeBSD uma_zalloc (Universal Memory Allocator) was particularly illuminating and showcased a deep conceptual understanding of operating system internals.

#Precise Memory Manipulation

The AI recognized that standard network-based heap spraying wouldn't be reliable enough due to network jitter and packet reordering. Instead, it utilized a technique to coerce the kernel into allocating specific socket buffers adjacent to the target object, ensuring near 100% reliability.

# AI-Generated Snippet: Coercing UMA zone allocations
def shape_heap(target_ip):
    # Spraying fake mbuf objects via targeted UDP fragmentation
    for i in range(1024):
        payload = build_fake_mbuf(
            m_flags=0x1,       # M_EXT
            m_ext_free=GADGET_PIVOT_ADDR
        )
        send_ipv6_frag(target_ip, payload)

#Gadget Chain Synthesis

Finding ROP gadgets in a massive binary like the FreeBSD kernel usually requires specialized tools and manual verification. Claude, having been trained on massive datasets of open-source code, assembly, and vulnerability reports, was able to conceptually infer the presence of certain epilogues. By dynamically interacting with the researchers' test environment via script outputs, it adjusted its offsets to reliably bypass KASLR.

#Privilege Escalation and Safe Exit

Once execution control was obtained, the payload didn't rely on complex or bloated shellcode. Instead, the AI constructed a data-oriented attack that directly overwrote the ucred (user credentials) structure of the running thread, escalating its privileges to UID 0. Crucially, it then gracefully restored the corrupted pointers and seamlessly returned execution flow back to the network loop to prevent a system crash—a hallmark of professional exploit development.

#What's Next

The defensive community must respond by accelerating the adoption of memory-safe languages in critical kernel subsystems. The FreeBSD project, much like Linux, has been exploring Rust integration, and CVE-2026-4747 serves as a stark reminder of why this architectural transition is so urgent.

Furthermore, defensive AI must evolve to match offensive capabilities. We need AI systems that can analyze code commits and automatically generate reliable hot-patches, firewall rules, or eBPF filters before attackers can weaponize the diff.

#Conclusion

The weaponization of CVE-2026-4747 by Claude is a fascinating, albeit sobering, milestone in cybersecurity. It proves that the cognitive leap required to turn an abstract memory corruption bug into a functioning, weaponized remote exploit is now within the grasp of large language models. As developers and system administrators, our margin for error is shrinking rapidly. Prompt patching, robust network segmentation, and defense-in-depth strategies are more critical than ever. The age of automated kernel exploitation has officially arrived.