Skip to main content

Field Guide

0-Day Protection: How CVE Pattern Scanning Catches Vulnerabilities in AI Agent Code

AI agents write code, execute code, and process code from tool responses. Every one of those interactions can carry known vulnerability patterns. CVE pattern scanning catches them before they execute.

Diagram showing code flowing through a CVE pattern scanner that matches against known vulnerability signatures and blocks or flags dangerous patterns

Published March 2026 · ~10 min read

The Problem

LLMs Reproduce Vulnerabilities. That Is Not a Bug — It Is a Feature of How They Were Trained.

Large language models learned to write code by reading billions of lines of it. A meaningful percentage of that training data contained security vulnerabilities — SQL injection, path traversal, insecure deserialization, command injection, hardcoded credentials. The model did not learn these were wrong. It learned they were common.

When an AI agent generates code through an MCP tool call, it will reproduce these patterns. Not always, not intentionally, but predictably. Ask an agent to write a database query and there is a non-trivial chance it produces string interpolation instead of parameterised queries. Ask it to handle file paths and it may not sanitise for traversal. Ask it to deserialise data and it may reach for pickle.loads() or yaml.unsafe_load().

The problem is bidirectional. When an agent calls a tool and receives a response containing code — a file read, a search result, a code generation output — that response may itself contain vulnerability patterns. The agent then acts on that code, potentially executing it, embedding it in further tool calls, or passing it to other agents in a mesh.

This is not theoretical. Every production MCP deployment we have audited has had instances of agents generating or processing code that matched known CVE patterns. The question is not whether it happens, but whether you catch it when it does.

The Approach

Pattern Matching Against Real-World Security Research

CVE pattern scanning is not static analysis. It does not build an AST, resolve dependencies, or trace data flow. It does something simpler and faster: it matches code fragments against a database of vulnerability signatures extracted from real CVEs.

Every CVE that involves a code-level vulnerability has a pattern — the specific construct that makes code exploitable. Sometimes it is a function call (pickle.loads() on untrusted input). Sometimes it is a structural pattern (string formatting into a SQL query). Sometimes it is a known-dangerous configuration (verify=False on an HTTP request). These patterns are extractable, indexable, and matchable at speed.

The key insight is that you do not need to understand the full program semantics to catch most vulnerability classes. You need to recognise the patterns that security researchers have already identified and catalogued. The CVE database is, in effect, a crowd-sourced collection of "code that should never appear in production" — and you can match against it at the speed of a tool call.

Architecture

Real-Time Scanning Inside the MCP Pipeline

In an MCP deployment, CVE pattern scanning sits inline on the tool call path — not as a sidecar, not as a batch job, but as a synchronous step in every tool invocation. When an agent sends a tool call, the scanner inspects the arguments before they reach the target server. When a tool returns a response, the scanner inspects the content before it reaches the agent.

Bidirectional by design. Outbound scanning catches vulnerabilities the agent is trying to introduce — SQL injection in a database query, command injection in a shell command. Inbound scanning catches vulnerabilities arriving from tool responses — malicious code in a file read, exploit payloads in search results, poisoned code snippets from a compromised server.

Pattern risk tiering. Not every match warrants the same response. Tier 1 patterns are vendor-prefixed, CVE-specific signatures that are dangerous in any context — these block immediately and the tool call is rejected. Tier 2 patterns are generic constructs (string interpolation into queries, unsanitised path concatenation) that are suspicious but context-dependent — these are flagged for review and logged, but the call proceeds.

Latency budget. Inline scanning must be fast enough that agents do not time out waiting for tool responses. Pattern matching against a pre-compiled signature database operates in single-digit milliseconds for typical payloads. The scanner adds less overhead than TLS negotiation on a cold connection.

Detection Categories

What Kinds of Patterns Get Caught

90 Scanner Rules64 MCP CVEs
Command Injection/RCE25 CVEs
CVE-2026-27825nvdMar 2026
CVE-2026-27826nvdMar 2026
CVE-2026-27824nvdMar 2026
CVE-2025-47274nvdH2 2025
CVE-2025-8665nvdH2 2025
CVE-2025-58357nvdH2 2025
CVE-2026-0621osvJan 2026
CVE-2025-68144osvSep 2025
CVE-2025-68145osvSep 2025
CVE-2025-52882nvdJul 2025
malicious-local-serversvulnerablemcpH2 2025
github-mcp-exploitvulnerablemcpMay 2025
mcp-inspector-rce-cve-2025-49596vulnerablemcpJun 2025
heroku-mcp-exploitvulnerablemcpJul 2025
cve-2025-6514-mcp-remote-rcevulnerablemcpJul 2025
cve-2025-54994-command-injection-mcp-stdiovulnerablemcpAug 2025
zero-click-rce-google-docs-mcpvulnerablemcpH2 2025
cursor-jira-mcp-zero-clickvulnerablemcpH2 2025
cursor-browser-injection-rogue-mcpvulnerablemcpH2 2025
cve-2025-53355-k8s-mcp-command-injectionvulnerablemcpAug 2025
cve-2025-53967-figma-mcp-rcevulnerablemcpJul 2025
cve-2025-68145-anthropic-git-mcp-rce-chainvulnerablemcpSep 2025
cve-2026-0755-gemini-mcp-command-injectionvulnerablemcpJan 2026
cve-2026-23744-mcpjam-inspector-rcevulnerablemcpFeb 2026
cve-2026-0756-github-kanban-mcp-rcevulnerablemcpJan 2026
SSRF3 CVEs
cve-2025-65513-fetch-mcp-ssrfvulnerablemcpOct 2025
tra-2025-36-microsoft-learn-mcp-ssrfvulnerablemcpH2 2025
microsoft-markitdown-mcp-ssrfvulnerablemcpH2 2025
Path Traversal5 CVEs
CVE-2025-53110nvdJun 2025
CVE-2025-53109nvdJun 2025
CVE-2025-68143nvdSep 2025
cve-2025-66689-zen-mcp-path-traversalvulnerablemcpNov 2025
cve-2025-67366-filesystem-mcp-path-traversalvulnerablemcpNov 2025
Tool Poisoning8 CVEs
tool-poisoning-attacksvulnerablemcpApr 2025
rug-pulls-silent-redefinitionvulnerablemcpH2 2025
cross-server-tool-shadowingvulnerablemcpH2 2025
tool-name-collisionsvulnerablemcpH2 2025
tool-poisoning-rce-rug-pullvulnerablemcpH2 2025
tool-function-parameter-abusevulnerablemcpH2 2025
cyberark-universal-output-poisoningvulnerablemcpH2 2025
cve-2025-54136-cursor-mcpoisonvulnerablemcpJul 2025
DNS Rebinding4 CVEs
CVE-2025-66416nvdDec 2025
cve-2025-66414-66416-dns-rebinding-mcp-sdksvulnerablemcpDec 2025
cve-2025-59163-vet-mcp-dns-rebindingvulnerablemcpOct 2025
neo4j-mcp-dns-rebinding-database-takeovervulnerablemcpNov 2025
Data Exfiltration5 CVEs
whatsapp-message-exfiltrationvulnerablemcpApr 2025
conversation-history-theftvulnerablemcpH2 2025
cve-2026-25536-sdk-cross-client-data-leakvulnerablemcpFeb 2026
coder-agent-api-chat-history-exposurevulnerablemcpJan 2026
amp-ai-agent-api-key-exfiltrationvulnerablemcpJan 2026
Supply Chain2 CVEs
mcp-registry-hijackingvulnerablemcpH2 2025
kilo-code-supply-chain-attackvulnerablemcpJan 2026
Access Control4 CVEs
session-ids-exposed-in-urlsvulnerablemcpH2 2025
insecure-credential-storagevulnerablemcpH2 2025
grafana-mcp-unauthenticated-ssevulnerablemcpJan 2026
thirdweb-mcp-unauthorized-cryptovulnerablemcpJan 2026
Sandbox Escape1 CVE
cve-2025-53372-sandbox-escape-mcpvulnerablemcpAug 2025
Other7 CVEs
line-jumping-attackvulnerablemcpH2 2025
consent-fatigue-attacksvulnerablemcpH2 2025
ansi-terminal-code-deceptionvulnerablemcpH2 2025
cve-2025-59944-cursor-case-sensitivity-bypassvulnerablemcpSep 2025
mcp-sampling-exploitationvulnerablemcpH2 2025
mcp-safety-audit-systematic-analysisvulnerablemcpH2 2025
kluster-verify-mcp-credit-exhaustionvulnerablemcpJan 2026

Limitations of Traditional Tools

Why SAST and DAST Cannot Solve This Problem

Static Application Security Testing runs at build time. Dynamic Application Security Testing runs at deploy time or against a running application. Neither operates where MCP traffic lives: at runtime, inside the tool call path, on code that was generated seconds ago and may never be persisted to a file.

When an AI agent generates a SQL query through a tool call, that query exists only as a string in a JSON payload. It is not in a source file. It is not in a repository. It will never be committed. SAST will never see it. By the time DAST could detect the resulting vulnerability, the agent has already executed the query, processed the results, and moved on to the next task.

The temporal gap is the vulnerability. Traditional security tools operate on a build-test-deploy cycle that assumes code is written by humans, reviewed by humans, and deployed on a predictable schedule. MCP traffic breaks every one of those assumptions. Code is generated in milliseconds, executed immediately, and may flow through multiple agents before any human reviews it.

This does not mean SAST and DAST are irrelevant — they remain essential for application security. But they cover a different surface. MCP tool call traffic is a new surface that requires inline, real-time scanning. Anything less is a gap in coverage.

The Database

8.6 Million Patterns. 46 Languages. Continuously Growing.

Effective pattern scanning requires a database that reflects the real world, not a hand-curated list of the top 50 vulnerability patterns. mistaike's Bug Vault indexes over 8.6 million real-world error and vulnerability patterns extracted from open-source codebases across 46 programming languages.

These patterns are sourced from real commit diffs — the actual code changes where developers fixed vulnerabilities. Each pattern captures both the vulnerable construct and the context in which it appeared, enabling more precise matching than generic regex rules. When a new CVE is published and a fix is committed to an open-source project, the pattern database grows automatically.

This matters because vulnerability patterns are language-specific and framework-specific. A SQL injection in Django looks different from one in Express.js. A path traversal in Go's filepath.Join() has different characteristics than one in Python's os.path.join(). Broad coverage across languages and frameworks is not optional — it is the difference between catching the vulnerability and missing it.

AI agents are polyglot by nature. A single agent session might generate Python, invoke a JavaScript tool, process a SQL response, and read a YAML config file. The scanner must match patterns across all of these. A monolingual pattern database is a false sense of security.

Try It

Scan Your Agent's Tool Calls Against 8.6M+ Patterns

Connect your MCP server to mistaike in under 2 minutes. Every tool call scanned for known CVE patterns. Free tier, no credit card.