Key Takeaways
- GenAI accelerates everything. More generated code means more vulnerabilities and more patches shipped without the time or context to properly review them. Velocity and volume have outpaced the ability to reason about security.
- The knowledge gap liability. GenAI lets you fix code you don’t understand. Without grasping the underlying architecture, codebase, and security boundaries, a patch is just a surface change, not a real fix.
- Patched on paper, broken in practice. Our research shows where “fixed” vulnerabilities remain fully exploitable with a minor tweak to the original exploit. The code changed; the flaw didn’t.
- The consequences are actively exploited. Our honeypot data provides direct evidence of real-world exploitation aimed at exfiltrating cloud credentials, leaving a significant number of unpatched instances still exposed.
Everyone is talking about using generative artificial intelligence (GenAI) to find vulnerabilities. Nobody warns you about what happens when you use it to patch them. We at TrendAI™ have monitored GenAI’s capabilities for producing code since its early adoption. This time, we will focus on its capability to patch vulnerabilities.
The security industry has spent the last two years marveling at how large language models (LLM) can scan codebases, identify potential vulnerabilities, and surface findings faster than any human analyst. That part is real and useful. But a quieter, more dangerous trend is unfolding in parallel: organizations are using the same tools to fix those vulnerabilities, often with a dangerous confidence that the patch is correct because an AI suggested it.
Recently, we were verifying a patch for a vulnerability we reported. To our surprise, the vulnerability was not patched at all; we found a bypass in under a second. This led us to investigate. The metadata showed clear AI involvement in the patch. This was not the first time we saw this, and we expect it won’t be the last.
The goal of the article is to warn about the gap between discovering a vulnerability and patching it using GenAI.
When an LLM identifies a vulnerability, e.g., a SQL injection, it demonstrates something impressive: the ability to recognize a pattern, match it to a class of known vulnerabilities, and explain why it’s dangerous. That is, fundamentally, a retrieval and classification task.
Patching that vulnerability is a different kind of problem. It requires:
- Understanding the full execution context, how the code path is triggered, what data flows through it, and what assumptions the rest of the system makes.
- Knowledge of the business logic: a sanitization approach that’s correct for one use case may break valid input in another.
- Regression awareness. Does the fix interact with authentication, caching, logging, or other adjacent systems?
- Validation that the fix closes the attack surface, not just that it looks different.
LLMs are trained to produce code that looks correct. Security patches that look correct and patches that are actually correct are not always the same thing.
Real Failure Examples and Common Patterns
The following examples are drawn from documented incidents, public post-mortems, and security research. They illustrate what can happen when vibe coding is integrated into the remediation workflow.
The Cosmetic Fix
What Happens
A developer asks an LLM to fix a command execution flaw; the provided proof of concept (PoC) exploits it via a shell. The LLM prevents exploitation via shell while preserving other options.
The LLM changes the surface appearance of vulnerable code without addressing the underlying flaw.
Why It Happens
The model identifies the most obvious injection point and applies the remedy. It does not model the full output context and root cause of the vulnerability.
The Model Context Protocol (MCP) stdio command-execution flaw (CVE-2026-42271, GHSA-v4p8-mg3p-g94g, rated High / CVSS 8.7) is a great example.
The gateway application programming interface (API) endpoints accepted a full stdio server configuration and spawned the supplied command as a subprocess on the proxy host, gated only by a valid API key with no role check, so any low-privilege authenticated user could run arbitrary commands.
The fix in PR #25343 (v1.83.7) looks thorough: a command allowlist (MCP_STDIO_ALLOWED_COMMANDS), Pydantic validation on both the create and update request models, an execution-time defense-in-depth check, and a PROXY_ADMIN role gate on the test endpoints—multiple layers, the right concepts.
While the allowlist does not accept a shell interpreter, using Python, TypeScript, or JavaScript, or installing a third-party executable package from an untrusted source is a valid option. One exploit path is denied; an infinite number prevails.
The commit metadata closes the loop on how this happened: the fixing commits carry a “Co-Authored-By: Claude Opus 4.6” trailer (and a “Made-with: Cursor” trailer on a later commit). AI co-authored the patch that looks complete but isn’t.
We reported the vulnerability through Trend’s AI Zero Disclosure Initiative . Based on our communication with the vendor, the patch was supposed to fix the necessary role permissions. However, as confirmed, a whitelist was wrongly added and will be removed from the codebase.
Most importantly, stdio MCP servers are not allowed on the LiteLLM gateway by default since version 1.104.0 (released Oct, 3). The functionality can still be enabled when LITELLM_ENABLE_MCP_STDIO=true is set.
The Danger
The finding is marked “remediated” in the ticket. The developer, the reviewer, and the scanner may all miss what the security issue and the attack surface persist in a different rendering context.
The Incomplete Boundary
What Happens
A team uses an LLM to patch a path traversal vulnerability. The model adds a check that strips ../ sequences from user-supplied file paths. The fix passes the test the developer ran. But it does not account for URL-encoded traversals (%2e%2e%2f), double-encoded variants, or OS-specific alternate path representations on Windows (..\). Any one of these bypasses the filter entirely.
The fix handles the case where the LLM was shown, but not in all cases.
Why It Happens
LLMs generate fixes based on the most commonly documented version of a vulnerability class. Real-world exploit techniques include bypass methods that are well-known in offensive security but underrepresented in training data relative to the “canonical” fix pattern.
The Danger
The fix creates false confidence. The team now believes the issue is closed. A motivated attacker, or an automated scanner using a payload list, finds the bypass immediately.
Patched but Broken
What Happens
The AI-generated fix is technically correct in isolation but breaks business logic in context.
During our previous MCP server research, we came across a repository with a Kubernetes MCP server vulnerable to command-line injection. The MCP server exported the tool functionality as a wrapper around the kubectl command-line tool. The server spawned a new process with shell context adding joining all commands into one.
Later on, a “fix” was introduced to enhance security. The fix was technically correct in not using the shell and removing command joining. Nevertheless, it completely broke the business logic, and the feature stopped working completely.
Further analysis revealed the authors to be vibe coding enthusiasts.
Why It Happens
The model did not see the complete context of your business logic. It applied a textbook fix to a non-textbook codebase.
The Danger
The fix causes an outage or a privilege-escalation regression. The team reverts it. The vulnerability goes unfixed. Time was lost, confidence in the patching process erodes, and the team is now less likely to tackle the underlying architectural issue.
The Dependency Shell Game
What Happens
The LLM fixes a vulnerability by introducing a new one through a dependency change.
A developer asks an LLM to upgrade a vulnerable version of a serialization library. The model suggests a specific newer version. The developer updates package.json and considers the issue resolved. What neither the developer nor the model checked: the suggested version has a transitive dependency on a package that recently had a known remote code execution (RCE) vulnerability. The original CVE is closed. A new attack surface opens.
Why It Happens
LLM training data has a knowledge cutoff, and dependency security landscapes change daily. The model cannot reason about the current state of the supply chain; it can only recommend versions it has seen in training data, with no awareness of advisories published after its cutoff. Without explicit pipeline instructions to search for and validate dependency trees, the LLM has no chance of discovering these issues. The deeper mistake is architectural: an LLM is not a source of knowledge and should not be treated as one. Current version and advisory data must come from an authoritative source, such as a dependency database, an advisory feed, or software composition analysis tooling, with the model at most orchestrating that lookup, never answering from memory.
The Danger
The original CVE is closed. Teams satisfied with the initial fix often don’t re-scan. The new vulnerability requires a separate discovery process to surface, and it may not be triggered until an attacker finds it first.
Real-world example
The LiteLLM supply chain compromise of March 2026 illustrates the downstream blast radius this pattern enables. Anyone who ran pip install or pip install --upgrade on packages depending on LiteLLM during the roughly four-hour exposure window pulled the compromised version as a transitive dependency, without ever choosing LiteLLM directly.
The malicious package deployed a three-stage payload: a credential harvester targeting over 50 secret categories, a Kubernetes lateral movement toolkit, and a persistent backdoor enabling ongoing remote code execution. The developer who triggered the infection never audited LiteLLM. They didn’t even know it was in their dependency tree.
An LLM-suggested dependency upgrade carries identical blind-spot mechanics: the dangerous package is one level removed from the change you made, and nothing in a standard diff or code review will surface it. The LiteLLM incident wasn’t caused by an AI fix suggestion, but it shows exactly what happens when transitive dependency hygiene fails at scale.
The Security Theater Refactor
What Happens
The fix addresses a real problem, but the solution is underspecified in a way that looks deliberate and correct, creating the appearance of a security-conscious implementation while leaving the attack surface intact.
CVE-2026-35030: LiteLLM
LiteLLM’s OIDC userinfo cache needed a cache key. Using the raw full token would be wasteful; someone clearly thought about this. The solution implemented was token[:20], a truncated prefix. It looks like a considered choice: not the whole token, not a random value, something derived from the token.
An LLM asked to “implement a cache key for JWT tokens” will reliably produce exactly this kind of output: plausible, compact, structured around the right concept. But JWT headers generated by the same signing algorithm share the identical first 20 characters across all tokens from the same issuer. The “key” was effectively a constant. An unauthenticated attacker could craft a token whose prefix matched a legitimate user’s cached entry and inherit their full identity and permissions.
The fix in v1.83.0 was one line: key the cache on SHA-256(token) instead. The correct answer was always a hash of the full token. The implemented answer looked like it was in the same family of solutions.
Why It Happens
The LLM produces code that is locally coherent. It uses the token, it derives a key, it doesn’t store the whole thing verbatim. It satisfies a surface-level reading of “use the token to build a cache key”. What it doesn’t reason about is the cryptographic property required: that the key must be collision-resistant across all tokens a single issuer will ever produce. That property isn’t in the prompt, and the model doesn’t volunteer it.
The Danger
This is the hardest pattern to catch in review precisely because the implementation signals awareness of the problem. A reviewer seeing token[:20] thinks “they thought about this”, not “this is a constant”. The cosmetic fix pattern fails visibly; this one fails invisibly, behind code that looks like it was written by someone who knew what they were doing.
Conclusions: The Big Why
Reviewers’ Limitations
These failures are not caused by the LLM alone. They persist because reviewers miss them too. A fix that looks correct is easier to approve than a vulnerability was to spot in the original code. Reviewers are primed to ask, “Does this look right?” rather than “Does this fully close the attack surface?” The pace of AI-accelerated development compounds the problem, overloading reviewers with a growing volume of code, vulnerabilities, and patches, further widening the knowledge gap.
- The social proof of AI output is real. If the LLM and the developer both say the issue is fixed, the burden of proof shifts to the reviewer to prove otherwise.
- Vulnerability details are often not in the pull request (PR). The diff shows what changed. It does not show what the original finding was, what attack scenario was being addressed, or what edge cases the fix was tested against.
- Security expertise is often not in the review loop. In many organizations, the developer who wrote the fix and the developer who reviews it have similar knowledge of offensive techniques. Neither may recognize a bypass.
Warning: The Confident Knowledge Gap
Every failure pattern above assumes the developer or reviewer has enough context to be suspicious. In practice, LLMs remove the knowledge barrier that previously acted as a natural speed limit on risky changes.
A developer who would never have touched cryptographic code, access control logic, or authentication flows without specialist help will now apply a confident-looking fix without understanding what it does, because the explanation sounds authoritative, the code compiles, and the ticket has an answer. The LLM does not just generate the fix. It generates the justification for the fix. That justification is often detailed, well-structured, and wrong in ways the reader cannot detect.
This does not create a new failure mode. It amplifies all the existing ones. The cosmetic fix survives review because nobody recognizes the second rendering context. The Security Theater Refactor passes because token[:20] looks like a considered choice to someone who has never thought about cache key collision. The incomplete boundary ships because the developer didn’t know path traversal had twelve encoding variants, and the LLM only mentioned one.
The LLM’s confidence is contagious, and it flows upward to the reviewer, who inherits the assumption that the hard thinking has already been done. In organizations under velocity pressure, that assumption is rarely challenged. The result is not just unreviewed code. It is code that has been reviewed and approved by someone who didn’t understand it, which is harder to recover from than code that was never reviewed at all, because it carries the institutional endorsement of a closed ticket.
The Organizational Pitfalls
Beyond individual patches, organizations adopting AI-assisted remediation at scale face structural risks:
- Velocity creates false assurance. When tickets close faster, leadership interprets this as security improving. The backlog shrinks. Metrics look good. The actual attack surface may not have changed.
- Untested patches accumulate. Rapid AI-assisted patching without validation creates a new class of technical debt: code that was changed but not verified. Future developers inherit these changes as if they were solid.
- The audit trail becomes meaningless. If fixes are generated and applied with minimal human deliberation, the commit history and ticket comments do not reflect the reasoning behind the change. When something goes wrong, there is nothing to investigate.
- Teams deprioritize security expertise. If a developer can “fix” any vulnerability by prompting an LLM, the organizational incentive to build deep security knowledge erodes. This is a slow-moving and serious problem.
Best Practices: What Good Actually Looks Like
None of this means LLMs have no role in remediation. They have a useful role when used correctly:
- Use the LLM to explain the vulnerability, not just generate the fix. Ask it to describe the attack scenario, the root cause, and the class of weaknesses involved. This helps the developer reason about the fix rather than just apply one.
- Treat the generated fix as a starting point, not an answer. The LLM produces a hypothesis. The developer’s job is to verify it against the actual codebase, data flow, and threat model.
- Validate against the attack, not the code. Don’t ask “Does the fix look right?” Ask “Does this fix prevent the attack? Are there any other possible exploit paths?” Write a test that simulates the exploit/s. If the patch is real, the test should fail before the patch and pass after. Who writes that test matters. If the same model that produced the patch also writes the test proving it works, both artifacts inherit the same misreading of the attack surface, and the test passes for exactly the wrong reason. Either have someone with offensive security experience write it, or hold it to the human review in practice #6.
- Apply the fix in isolation and test adjacent systems. Particularly for access control, authentication, and cryptographic changes. Check what else calls the modified code.
- Use automated scanning after patching, not just before. Re-run the scanner that found the original issue. Run it against the variant inputs you know the model might have missed.
- Keep security reviewers in the loop on high-severity fixes. Velocity is not more important than correctness on a critical vulnerability. A second set of eyes from someone who thinks offensively is not optional.
Repercussions in the Real World
The enthusiasm for AI-assisted vulnerability finding is largely earned. The same enthusiasm for AI-assisted vulnerability fixing is not. Not yet, and not without significant process discipline around it. Otherwise, it might end up as a case study below.
LiteLLM Instances: Patched vs Vulnerable
This is where the two halves of the story meet. What we found was a patch that looked complete and wasn’t: a command allowlist, Pydantic validation, an execution-time check, and a role gate; every signal of a careful, security-conscious fix, shipped with an update path that skipped the allowlist and an allowlist that admitted Docker, all of it AI co-authored. What’s at large is the consequence of trusting that appearance. CVE-2026-42271 was fixed in v1.83.7, but a scan of internet-facing LiteLLM instances shows how far “fixed” is from “safe”. Of 4,459 reachable instances across 188 distinct versions, 2,914, roughly 65%, were still running a version older than v1.83.7. That number captures two distinct exposures, not one. The majority never took the patch at all and remain open to the original MCP stdio command-execution flaw. The rest are running the AI co-authored fix described above, a patch that narrowed the attack surface without closing it, which means even the “patched” third cannot be assumed safe. The version distribution below shows where those instances cluster: the bulk sit on the 1.80–1.83 line, just short of the patched release.
The risk is no longer hypothetical. The Cybersecurity and Infrastructure Security Agency (CISA) added CVE-2026-42271 to its Known Exploited Vulnerabilities catalogue, citing evidence of active exploitation, and directed federal agencies to remediate it.
Worse, the authenticated-only framing that made the original flaw feel contained has already collapsed: researchers chained it with CVE-2026-48710 , a “BadHost” host-header validation bypass in Starlette, to strip the authentication requirement entirely and reach unauthenticated remote code execution, no API key, no credentials, no prior access.
A compromised LiteLLM proxy is a credential aggregator: every model-provider API key it holds, every secret in its environment, and whatever internal network it can reach are all in scope. Two-thirds of the deployments we observed are sitting on the wrong side of that exposure, many of them behind a patch their operators may believe already closed it.
Deployment, Cloud Provider, and Region Concentration
The exposed LiteLLM surface is not merely cloud-prevalent; it is structurally concentrated in a handful of cloud ecosystems. Of the 23,898 operational hosts in scope, 17,579 (73.6%) are cloud-hosted, and a single provider dominates the rest by an order of magnitude: Amazon Web Services accounts for 13,444 of them, 76.5% of all cloud hosts and 56.3% of the entire population.
Every other provider trails far behind. Hetzner (805), Google Cloud Platform (655), Tencent Cloud (515), DigitalOcean (360), Azure (273), OVHcloud (260), Oracle Cloud (234), and Alibaba Cloud (209) together account for only a fraction of AWS alone.
The clustering tightens again at the region level: within AWS, five regions hold the densest pockets, us-east-1 (1,995), us-west-2 (1,313), eu-west-1 (602), eu-central-1 (594), and ap-southeast-1 (574). Hosts whose region could not be attributed are reported as an unknown-region category rather than dropped, so these counts should be read as a floor rather than an exact census.
This is not simply a story about cloud prevalence; it is a story about concentration risk. High-density provider and region clusters create asymmetric leverage. A working exploitation playbook does not need to be re-engineered for each victim; in a dense cluster of near-identical infrastructure, it can be reused at scale. The same property is available to defenders: first-response telemetry and detection effort prioritized in those same clusters yield the greatest coverage per unit of effort. Concentration is what transforms an individual misconfiguration into a systemic risk cluster.
Attempts at Exfiltrating Cloud Credentials
Our honeypot data shows what that leverage is actually used for. The majority of the exploitation attempts we captured were not aimed at model-serving functionality at all. They were attempts to exfiltrate cloud credentials. Attacker-supplied server configurations repeatedly pointed at the cloud instance metadata service at 169.254.169.254/latest/meta-data/, with several aimed squarely at the IAM credential path (.../iam/security-credentials/) and others probing internal addresses such as 127.0.0.1 and the 10.0.0.0/8 range. This is precisely the SSRF-to-credential-theft pattern the MCP stdio flaw enables, and it maps directly onto the concentration above: with 56.3% of exposed hosts on AWS, the metadata endpoint is the single highest-value pivot an attacker can script once and reuse everywhere. A compromised proxy that can reach it surrenders the IAM role of its underlying instance, and with it every key and secret that role can touch, exactly the credential-aggregator scenario described earlier.
Final Thoughts
The patterns described here are not edge cases. They are predictable failures that emerge when a tool designed to produce plausible-looking output is trusted to produce secure output without verification. They are also largely invisible in the aggregate statistics that organizations use to measure their security programs.
The most dangerous thing an LLM can do in a security remediation workflow is produce a patch that closes a ticket without fixing the vulnerability. That is not a hypothetical. It is happening now, at scale, in organizations that believe they are improving their security posture.
The CVE-2026-42271 vulnerability has been actively exploited, as confirmed by CISA KEV, since the vulnerability was responsibly disclosed through TrendAI™ Zero Day Initiative™ (ZDI). TrendAI™ customers were the first protected against exploitation by virtual patching using TrendAI Vision One™ TippingPoint™ 47322 protection filter, well before a vendor *attempt* for vulnerability patch.
TrendAI™ customers are protected against exploitation of CVE-2026-42271 by network protection filter #47322 (TippingPoint), published on April 28, 2026, and last updated on May 5, 2026.