CISOOnline

AI-written patches are becoming attack maps for hackers

This summer, the maintainers of vm2, an open-source JavaScript sandboxing library with 1 million downloads per week, shipped fixes for 34 separate sandbox-escape vulnerabilities and Anthropic’s Claude co-wrote 19 of them. Weeks later, a security researcher pointed an AI agent at one of the advisories and asked for a way around the patch. The agent delivered.

Shayaun Nejad, lead product security engineer at Rubrik, ran vulnerability variant analysis on the vm2 patch while preparing for a talk he held at the recent [un]prompted AI security conference in San Francisco. He wanted to highlight the challenges his development team faced when dealing with a flood of AI-discovered vulnerabilities, and noted that the same bugs kept being rediscovered later in new testing runs despite being fixed by AI-assisted pipelines.

“Sometimes the [vulnerability] variant wouldn’t be caught until the model variation got better or the model used chaining analysis at a higher degree once it improved in order to find those variants,” he said. “Sometimes it was in the exact same spot, sometimes it was something that was related, that was a neighbor, but variant analysis is basically something that has been popping up, and it’s a context magnet, too.”

With the rate of published CVEs higher than ever due to AI assistance, software developers are actually disclosing the types of vulnerabilities their platforms are susceptible to, and the patches for these flaws can serve as blueprints for attackers, Nejad warned. Sometimes it’s as simple as pointing an AI agent at a codebase with its historical vulnerabilities as context and telling it to go hunt for variants, he said.

Rubrik’s experience reflects a broader asymmetry that other researchers have observed in recent months: AI models have become very good at offense — finding vulnerabilities and building exploits — while their defensive skills, such as writing secure code and correct patches, have lagged behind.

Also at the [un]prompted conference, OpenAI security researcher Tim de Waal showed how an AI agent patched two vulnerabilities in the firmware of a network access point. For one issue, the agent rebuilt the vulnerable function without the stack canaries the original code had, silently removing a defensive protection. For the other, the generated patch filtered out double-quote characters in the attacker input but missed that using single quotes would have bypassed the fix.

Controlled studies found the same issue at scale. When researchers at 1Password’s Off-by-1 Labs used AI agents to repeatedly generate patches for the same six known vulnerabilities in complex open-source projects, about half of the 6,080 resulting patch candidates left at least one attack path open, with agents sometimes missing identical instances of the same bug in other parts of the code.

More recently, in a benchmark test called P2Patch, researchers pitted two AI agents against each other: one wrote exploits for 101 real vulnerabilities, and the other patched the code until the exploits stopped working. Then the first agent attacked the patched programs again, looking for a different way to trigger the same flaw. In 41 of the 101 cases, it succeeded, sometimes multiple times for subsequent patches.

Of course, human-written patches are not infallible either. Security firm Trail of Bits reviewed the fixes developers submitted for 2,265 vulnerabilities found during its consulting assessments over several years and one in eight failed to fully resolve the reported issues.

In one case the company documented, a human maintainer and an AI agent working as part of the Patch the Planet initiative separately wrote patches for the same memory-safety bug in the freenginx web server, and both patches introduced the same crash during request cleanup.

Organizations turn to AI patching because humans can’t keep up

The issue is not that AI always writes worse patches than humans, although the failure rate of AI-written patches might be higher, but that the rate of vulnerability discovery is now so fast that humans alone can’t keep up. This is combined with the offensive capabilities of AI agents that enable attackers to analyze and reverse engineer patches at machine speed.

Seven months after launching its Mythos-powered Glasswing vulnerability-hunting program, Anthropic’s public ledger counted 37,966 findings. Only 217 of the 7,349 flaws that were made public had been fixed, according to a recent analysis from vulnerability intelligence firm VulnCheck. Not all findings turn out to be security vulnerabilities, but Anthropic claims a true positive rate of 94.2%, which, given the small number of fixes, highlights the deluge of reports that maintainers have to triage and deal with.

“Progress on software security used to be limited by how quickly we could find new vulnerabilities,” Anthropic wrote in its initial Glasswing update. “Now it’s limited by how quickly we can verify, disclose, and patch the large numbers of vulnerabilities found by AI.”

And this is not just a problem for open-source projects. After Bank of America let Anthropic’s models loose on its own systems, the bank added 1,000 outside contractors in the second quarter of this year to help with the patching work, on top of the roughly 3,000 existing staff. They were still on the job in October, CEO Brian Moynihan told CNBC.

By July, Meta was using AI to write fixes for 40% of its critical vulnerabilities, and almost half of those patches landed in production unchanged. Despite that, the exposure time did not go down, Meta software engineer David Molnar said in a separate presentation at [un]prompted. That’s because the AI-proposed patches still had to be reviewed by humans, while the amount of new code grew more than 100% year over year, with more than 80% of it attributed to AI coding agents.

“Everyone is drowning in stuff to review,” Molnar said, adding that his team has worked with directors and product managers internally to find more places where automation can be introduced, including in the review process, shifting it from human-in-the-loop to human-on-the-loop.

“You can automate everything upstream of AI, and then just completely overwhelm your poor humans on the other end,” he said. “Which is why you have to take a look at the entire pipeline and automate all of it.”

In June, the Forum of Incident Response and Security Teams (FIRST) projected around 66,000 CVE assignments for this year. With two months left, the number is already approaching 100,000. Microsoft’s October Patch Tuesday alone addressed 1,415 vulnerabilities compared to only 180 in October 2025.

Closed-source patches are not safe from AI analysis

If AI agents are scouring code repositories for vulnerability variants, one might be inclined to think that closed-source sofware, where the patch is usually inside a compiled binary, are safer. That’s not necessarily the case given that AI models are now also great at reverse engineering, and some people use them to create open-source replicas of complex proprietary products, for example Adobe Photoshop.

In June, when Anthropic’s researchers tested what an attacker can do with AI-assisted patch diffing, they gave a model nothing beyond what’s public on patch day. It produced a working exploit within an hour of a Firefox fix landing. On Windows, given vulnerable and patched binaries plus decompilation output, the same approach built eight full privilege-escalation chains from 21 kernel vulnerabilities for roughly $2,000 each.

“In some ways, N-days are the more dangerous of the two [compared to zero-days], because the patch itself provides a roadmap to the bug,” the Anthropic researchers said at the time.

A team of researchers from Fudan University in Shanghai, China, built an LLM-assisted binary diffing framework and analyzed 76 recent patches from 62 closed-source applications across 25 vendors. According to their paper published this month, the framework flagged 63 of the patches as incomplete and manually confirmed 56, of which 26 could be bypassed into new vulnerabilities, resulting in 19 CVE assignments and $28,100 in bug bounties.

Comparing a vulnerable build against a patched one to locate the changed code has been a standard practice for security researchers for years. The difference now is the speed and lack of skill needed thanks to AI. And even though the latest frontier AI models might have API guardrails that make reverse engineering or binary diffing harder, the open-weight models have become capable enough.

Taesoo Kim, vice president of security research at Microsoft, also warned during the [un]prompted conference that AI has drastically reduced the time needed for binary-diff analysis and exploit creation, and noted that Microsoft has to also be extremely careful when publishing CVEs and push updates quickly to customers.

The more recent frontier models have started refusing such binary analysis work due to stricter guardrails, but a lot of people use open-weight models instead, such as Qwen, Kimi, and GLM, because “they are extremely capable,” he said.

Exploiting the patch gap is now easy

Last month, the Microsoft Edge Security team warned that attackers are increasingly taking advantage of the time gap between when information about a potential vulnerability becomes available in a code commit or test release in one project and when the patch trickles down to other projects. Their report included examples of attackers exploiting security fixes revealed in Chromium builds, the open-source browser that serves as the base for Google Chrome, Microsoft Edge, and other browsers, before those fixes were integrated in those downstream browsers.

“This is patch-gap abuse,” the Edge team said. “The technique is not new, but the speed and expertise required is changing. AI-assisted analysis and exploit development could compress work that once took weeks into hours, increasing the chance that a usable exploit emerges while either exposure window remains open.”

Researchers from Epoch AI recently used GLM 5.3 to emulate an unsophisticated attacker and target the Firefox patch gap. Using about $1,000 in API credits and as little as 12 hours of work per target, it compromised every Firefox release shipped between Sept. 17 and Oct. 26. “We did not trigger any safeguards or refusals from any provider,” the researchers wrote.

In response, the Mozilla team has decided to take several actions to prevent patch gap abuse, for example by no longer releasing the regression tests associated with security fixes.

“We’ve observed that GLM 5.3 is much less effective at patch-gapping when a regression test is not present, so we’ve reintroduced a practice of keeping these confidential until after the fix has shipped,” Firefox CTO Bobby Holley wrote.

More diligence in patching, not less disclosure

In a report last month dubbed PatchSlop, security firm Terra found that the rate of incomplete or broken fixes across open-source projects increased eightfold this year.

“A patch that only blocks the reported input can give the impression the bug is addressed even if it’s still there in the underlying code,” the company’s researchers said. “It functions as a map for attackers, marking out both vulnerable code and what the defender thought the bug was. Looking just outside the diff (another encoding, another address range, another path into the same function) is one of the cheapest forms of bug hunting. We believe a growing share of attacker effort, and AI tokens, goes into exactly this.”

The answer is not for open-source projects and software companies to hide vulnerability details and stop publishing security advisories, but to produce better patches. And some researchers believe this is possible, even when patching gets automated with the help of AI agents.

In Rubrik’s case, after the company noticed that bugs it had marked as fixed kept coming back, Nejad’s team added its own variant hunting step that runs automatically in the pipeline after fixes are developed. The company began routing simple bugs to AI patching while reserving complex flaws, such as authentication bypasses, for human engineers.

“Yes, attackers do have that context, but you have that context first, and you can act on that,” Nejad said.

In a blog post this month, OpenAI noted that its Linux vulnerability research and patching pipeline needed iterative testing and variant analysis because initial patches “failed to examine related code for variants of the same vulnerability, leading to incomplete patches.”

“We recommend using models for adversarial review of human and AI-generated patches, which can identify issues such as the patch being bypassable, missing other attack paths or variants, and more,” the company’s researchers said.

The Open Source Security Foundation’s guidance for AI-assisted patching also advises teams to “have a new discovery agent probe the patch as an attacker” and Trail of Bits has released an agent skill that requires testing at least one distinct variant based on the bug’s root cause before a patch can be submitted.

“It is clear there needs to be greater diligence and rigor when patching vulnerabilities,” Terra CEO Shahar Peled told CSO. “This means finding the root cause of any flaw, searching across the codebase for similar bugs and re-testing the system to ensure the patch itself doesn’t introduce a new vulnerability.”



Source link