CVE-2026-133505: In Pydantic AI, third-party data in a tool result shaped like a file object was rebuilt as a real file when message history was reloaded, triggering local-network downloads or s3:// reads with the app's credentials (fixed 1.107.10 / 2.66.0)
When Pydantic AI loads serialized message history, it rebuilds file items (ImageUrl, DocumentUrl, AudioUrl, VideoUrl, UploadedFile) nested in tool results. A plain mapping a tool returned that serialized to the same JSON shape was rebuilt as a file too. A third party who controls data that reaches a tool result, such as a record an MCP server or function tool fetches from an external system, could make the application download a URL on its local network (DocumentUrl/ImageUrl with force_download='allow-local' turns off the private-network block; cloud metadata stays blocked), or make the model provider read an s3://, gs:// or uploaded file with the application's credentials. No prompt injection needed: the next model request does it. Fixed in pydantic-ai / pydantic-ai-slim 1.107.10 and 2.66.0.
What it is
Reload paths that are affected: stored history loaded with ModelMessagesTypeAdapter, history a UI adapter holds with manage_message_history='server', and Temporal, DBOS or Prefect durable execution (which serialize tool results between steps within a single run).
History that a client submits through the Vercel AI or AG-UI adapter in the default mode is not affected.
For plain-text documents and models that honour force_download, the downloaded body is sent to the model provider as part of the conversation, so the attacker can obtain it if the model can be induced to repeat it.
Affected: pydantic-ai and pydantic-ai-slim >= 1.50.0, <= 1.107.9 and >= 2.0.0b1, <= 2.65.0. GitHub published the advisory on 4 November 2026; NVD published the CVE on 20 November 2026.
How to check
- pip show pydantic-ai pydantic-ai-slim to check versions.
- Check whether you persist and reload message history, use a server-side UI adapter history, or run agents with Temporal, DBOS or Prefect.
- Check whether any tool or MCP server returns data from third parties (tickets, emails, web pages, CRM records).
How to fix
- Upgrade pydantic-ai / pydantic-ai-slim to 1.107.10 (1.x) or 2.66.0 (2.x) or later.
- Until then, don't reload history that contains third-party tool results, and keep the app's cloud-storage credentials scoped to what the agent needs.
pip show pydantic-ai pydantic-ai-slim 2>/dev/null | grep -E '^(Name|Version)' Sources
- highCVE-2026-133161: Pydantic AI Harness's ToolOutputLimits(strip_ansi=True) can be stalled for minutes by crafted tool output, blocking every agent run in the process (fixed 0.70.0)
- highCVE-2026-107295: any website can make the Pydantic AI web chat UI (Agent.to_web, clai web) run your agent and its tools, upgrade to 1.107.4 or 2.28.0