Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-107294 Overview
CVE-2026-107294 is a resource exhaustion vulnerability [CWE-400] in Pydantic AI, a Python agent framework for building Generative AI applications and workflows. The flaw affects versions 1.77.0 through 1.107.1 and 2.x releases prior to 2.24.0. The web_fetch_tool, the WebFetch local fallback, and remote FileUrl media downloads buffer the complete HTTP response body in memory before enforcing content-size controls. An attacker who can influence a fetched URL can stream an arbitrarily large response, exhaust process memory, and crash the worker. Affected media types include ImageUrl, DocumentUrl, VideoUrl, and AudioUrl. Server-Side Request Forgery (SSRF) protections are unaffected, and impact is limited to availability.
Critical Impact
An authenticated attacker can trigger worker process crashes and application-wide denial of service by causing Pydantic AI agents to download attacker-controlled URLs that return oversized response bodies.
Affected Products
- Pydantic AI pydantic_ai versions 1.77.0 through 1.107.1
- Pydantic AI pydantic_ai versions 2.0.0 through 2.23.x
- Components: web_fetch_tool, WebFetch local fallback, and FileUrl media downloads (ImageUrl, DocumentUrl, VideoUrl, AudioUrl)
Discovery Timeline
- 2026-10-08 - CVE-2026-107294 published to the National Vulnerability Database (NVD)
- 2026-10-13 - Last updated in NVD database
Technical Details for CVE-2026-107294
Vulnerability Analysis
The vulnerability resides in how Pydantic AI retrieves remote content for agent tooling. When web_fetch_tool or the WebFetch local fallback issues an HTTP request, the response body is read into memory in full before any size validation runs. The same pattern applies to media FileUrl downloads used by multimodal messages. Because enforcement happens post-buffering, declared size limits never protect the process from oversized payloads.
An attacker who can influence the URL passed to an agent, for example by injecting a link into a prompt or tool argument, can direct the framework to a server that streams megabytes or gigabytes of data. The worker allocates memory for the full body and is terminated by the operating system when physical and swap memory are exhausted.
Root Cause
The root cause is a missing streaming size check in the download path. The pre-patch implementation did not define a maximum download threshold, so no code path could reject responses while they were still being read. The fix introduces explicit byte caps:
# Patch for pydantic_ai_slim/pydantic_ai/common_tools/web_fetch.py
__all__ = ('WebFetchResult', 'web_fetch_tool')
_EXCESSIVE_NEWLINES_RE = re.compile(r'\n{3,}')
_MAX_DOWNLOAD_BYTES = 50 * 1024 * 1024
class WebFetchResult(TypedDict):
...
# Patch for pydantic_ai_slim/pydantic_ai/models/__init__.py
_MAX_FILE_URL_DOWNLOAD_BYTES = 50 * 1024 * 1024
"""Default maximum response body size when downloading a [`FileUrl`][pydantic_ai.messages.FileUrl]."""
Source: Pydantic AI commit 7a64d04 and commit e3824a5. The constants bound the maximum response body size to 50 MiB for both web_fetch and FileUrl downloads.
Attack Vector
Exploitation requires network access and low-privilege authenticated interaction with an application that uses an affected version of Pydantic AI. The attacker needs the ability to influence a URL consumed by web_fetch_tool or a media URL field. The target host then issues an outbound HTTP request to an attacker-controlled endpoint that returns a response far larger than available process memory, driving the worker to an out-of-memory termination.
Detection Methods for CVE-2026-107294
Indicators of Compromise
- Worker processes terminated with out-of-memory (OOM) signals shortly after inbound agent requests containing external URLs.
- Outbound HTTP requests from application hosts to unexpected domains referenced inside LLM prompts, tool arguments, or FileUrl message fields.
- Sudden spikes in resident memory for Python processes hosting Pydantic AI agents, followed by container or pod restarts.
Detection Strategies
- Inspect application and container logs for repeated MemoryError, Killed, or Kubernetes OOMKilled events correlated with agent tool invocations.
- Audit prompts and tool-call payloads for user-supplied URLs reaching web_fetch_tool, WebFetch, ImageUrl, DocumentUrl, VideoUrl, or AudioUrl.
- Monitor egress traffic for long-lived HTTP responses with abnormally high byte counts originating from Pydantic AI worker hosts.
Monitoring Recommendations
- Alert on process memory usage exceeding a baseline threshold for agent worker containers.
- Track outbound response sizes per destination host and flag transfers larger than the 50 MiB post-patch cap.
- Capture Pydantic AI version metadata during deployment to identify hosts still running vulnerable releases between 1.77.0 and 1.107.1 or 2.0.0 through 2.23.x.
How to Mitigate CVE-2026-107294
Immediate Actions Required
- Upgrade Pydantic AI to version 1.107.2 on the 1.x branch or 2.24.0 on the 2.x branch.
- Inventory agents and tool configurations that expose web_fetch_tool, the WebFetch fallback, or FileUrl media inputs.
- Restrict which users and upstream systems can submit URLs to Pydantic AI agents until patching is complete.
Patch Information
The maintainers released fixes in Pydantic AI v1.107.2 and Pydantic AI v2.24.0. Both releases introduce _MAX_DOWNLOAD_BYTES and _MAX_FILE_URL_DOWNLOAD_BYTES constants that bound HTTP response body sizes to 50 MiB. See Pull Request #7141, Pull Request #7308, and the GHSA-v2xh-2vp8-57h8 advisory.
Workarounds
- Place an egress HTTP proxy in front of agent workers that enforces per-response byte limits and rejects oversized downloads.
- Apply container memory limits and automatic restart policies so a single oversized download cannot destabilize an entire host.
- Validate and allowlist URL destinations before passing them to web_fetch_tool or media FileUrl fields.
# Upgrade Pydantic AI to a patched release
pip install --upgrade 'pydantic-ai>=1.107.2,<2' \
|| pip install --upgrade 'pydantic-ai>=2.24.0'
# Verify installed version
python -c "import pydantic_ai; print(pydantic_ai.__version__)"
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

