Anthropic’s Claude AI Writes Full FreeBSD Kernel Exploit in Four Hours


TL;DR

  • Exploit Developed: Anthropic’s Claude AI autonomously wrote two working remote root exploits for a FreeBSD kernel vulnerability in roughly four hours of compute time.
  • Vulnerability Details: CVE-2026-4747 is a stack buffer overflow in FreeBSD’s RPCSEC_GSS module, reachable over the network by any user with a valid Kerberos ticket.
  • Patch Available: FreeBSD patched the vulnerability on March 26, 2026, with a single bounds check before the affected memory copy operation.
  • Broader Implications: Researcher Nicholas Carlini has since used the same Claude-powered pipeline to generate 500 validated high-severity vulnerabilities across multiple codebases.
  • Expert Warning: Security researchers warn that AI-driven exploit development is compressing the window between public vulnerability disclosure and working attacks from weeks to hours.

Anthropic’s Claude AI autonomously developed two working remote root exploits for a FreeBSD kernel vulnerability, each succeeding on its first attempt after roughly four hours of compute time. A technical write-up published April 1 revealed how researcher Nicholas Carlini stepped away from his keyboard and returned to find the AI had solved six distinct technical problems without human assistance. The resulting exploits can compromise any unpatched server in under a minute.

A stack buffer overflow tracked as CVE-2026-4747 in FreeBSD’s RPCSEC_GSS authentication module was patched on March 26. FreeBSD’s security advisory credits “Nicholas Carlini using Claude, Anthropic” for uncovering the flaw. While AI tools have found software bugs for years, autonomously writing a kernel-level remote code execution exploit with root shell access was considered beyond machine capability until now. Carlini, who works with Anthropic’s Frontier Red Team, has since used Claude to generate 500 validated high-severity vulnerabilities.

How Claude Built a Remote Root Shell

Inside svc_rpc_gss_validate(), FreeBSD copies an RPCSEC_GSS credential body into a 128-byte stack buffer without checking that the payload fits the 96 bytes of usable space after a 32-byte fixed header. Because the vulnerable kgssapi.ko module handles authentication for FreeBSD’s kernel-level NFS server, the flaw is reachable over the network via port 2049/TCP. Any user with a valid Kerberos ticket, even an unprivileged one, can trigger it.

Moreover, FreeBSD’s advisory notes that exploitation does not require the client to authenticate itself first, lowering the bar further. Enterprises running NFS servers with Kerberos infrastructure such as Active Directory or FreeIPA face direct exposure, and no workaround is available for systems with the module loaded.

 

Going from advisory to working root shell required Claude to solve six distinct technical problems autonomously. Claude devised a 15-round shellcode delivery strategy: round one makes kernel memory executable by calling vm_map_protect, 13 rounds write shellcode 32 bytes at a time into a known kernel BSS address, and the final round writes the last 16 bytes and jumps to the entry point. Each round kills one NFS worker thread via kthread_exit(), keeping the server alive between packets.

FreeBSD spawns eight NFS threads per CPU, so the exploit requires a machine with two or more CPU cores to survive all 15 rounds. Several missing kernel mitigations simplified the path. FreeBSD 14.x lacks KASLR, leaving the kernel base at a fixed, predictable address.