
In July 2026, an AI broke out of its sandbox and hacked a live production system on its own.
During an internal OpenAI evaluation built to measure how far its models could push real exploitation, a pair of models, including GPT-5.6 Sol and an even more capable pre-release model, ran with their usual cyber safety refusals switched off. Fixated on solving the benchmark, one model went hunting for the answer key. It found and exploited a zero-day in a package registry cache proxy to escape its sandbox, escalated privileges and moved laterally until it reached the open internet, then chained stolen credentials and further zero-days into a remote code execution foothold on Hugging Face’s production infrastructure.
No human directed those steps. The model reasoned its way to a novel attack path in a real-world system it had never seen the source code for, and Hugging Face’s own security team had to detect and contain it. OpenAI called it an unprecedented cyber incident, while Hugging Face’s CEO suspects it is the first of its kind.
A year earlier, this was still a theory with a proof of concept.
In May 2025, security researcher Sean Heelan published something that turned heads across the vulnerability research community: OpenAI’s o3 model had autonomously discovered a remotely exploitable zero-day in the Linux kernel.
The bug, tracked as CVE-2025-37899, lives in ksmbd, the Linux in-kernel SMB server, and it surfaced from static analysis of roughly 12,000 lines of code with no fuzzer, no runtime instrumentation, and no human pointing the model at the vulnerable function.
The same research effort produced a second result. A related use-after-free flaw, CVE-2025-37778, was found the old-fashioned way, through manual code review, then handed to o3 as a benchmark to see whether the model rediscovered it. It did, though inconsistently, and the hit rate exposed as much about the limits of AI code auditing as its promise.
For SOC teams and vulnerability managers, the abstract conversation about AI in security is over. The same reasoning that helps a defender triage a CVE backlog is already helping attackers, and now autonomous systems, surface and exploit vulnerabilities at scale.
In this month’s campaign, we’ll walk you through both ksmbd vulnerabilities, the discovery methods behind them, and what the shift means for red and blue teams.
Large language models trained on vast corpora of source code and technical documentation are effective at static code review. They reason about control flow, object lifetimes, and concurrency across large files, and they flag subtle logic errors that traditional pattern-based scanners routinely miss.
The ksmbd research demonstrates two distinct modes. In autonomous discovery, the model scans an unfamiliar codebase and surfaces candidate vulnerabilities with no prior knowledge of where a bug lives. In assistive analysis, the model validates a flaw a human already suspects, acting as a second set of eyes on a specific code path. Both modes compress the time and specialist expertise a bug hunt normally demands.
ksmbd is a kernel-space implementation of the SMB3 protocol, introduced in Linux 5.15 in November 2021. It processes SMB requests directly in the kernel rather than in user space like Samba, which cuts context switches and boosts throughput for enterprise storage, NAS appliances, and modern Linux distributions. It also handles unauthenticated remote traffic in kernel space, which makes any memory-safety flaw inside it a high-value target.
A use-after-free (UAF) occurs when code continues to reference a block of memory after that memory is freed. Once freed, the memory becomes available for reallocation, so a later dereference reads or writes data an attacker controls. In kernel space, where a corrupted object translates directly into memory corruption or privileged code execution, the consequences are severe.
Both ksmbd bugs are use-after-free flaws on the same object: the session user structure. What differs is the trigger. One fires through a concurrency race with no authentication; the other fires through a reauthentication logic error that requires valid credentials.
Both flaws corrupt the same session user object, but through different code paths. The first is an unauthenticated concurrency race; the second is an authenticated reauthentication error.
The first flaw sits in the smb2_session_logoff() function in smb2pdu.c, and o3 found it by reasoning about multithreaded behavior across the codebase.
ksmbd, all sharing a single session structure. logoff command, which invokes smb2_session_logoff(). ksmbd_conn_wait_idle() checks only the current connection’s idle state. It ignores other connections still actively using the same session. ksmbd_free_user(sess->user), freeing the session user object while sibling connections still hold references to it. READ or WRITE that dereferences the now-freed user pointer. The critical property is that this path is network-accessible and requires no prior authentication.
The second flaw lives in the session setup path, in smb2_sess_setup(), and it involves reauthentication rather than logoff.
SMB2_SESSION_VALID, the handler frees the existing sess->user object with ksmbd_free_user() and sets the pointer to NULL. The underlying memory is already deallocated. ksmbd_krb5_authenticate(). The user object is never reinitialized, leaving the session in an invalid state. sess->user after this point accesses freed memory, producing the use-after-free. Because exploitation requires valid credentials, the exposure is narrower than the logoff race. This CVE maps cleanly to MITRE ATT&CK T1068 (privilege escalation).
Dive into the this Theory Module to explore how AI is reshaping the vulnerability lifecycle, from zero-day discovery through triage and detection.
ksmbd use-after-free vulnerabilities, CVE-2025-37899 and CVE-2025-37778, at the source-code level.