← All advisories
CVE-2026-133505mediumSSRF & network2026-11-20

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.

01.

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.

02.

How to check

  1. pip show pydantic-ai pydantic-ai-slim to check versions.
  2. Check whether you persist and reload message history, use a server-side UI adapter history, or run agents with Temporal, DBOS or Prefect.
  3. Check whether any tool or MCP server returns data from third parties (tickets, emails, web pages, CRM records).
03.

How to fix

  1. Upgrade pydantic-ai / pydantic-ai-slim to 1.107.10 (1.x) or 2.66.0 (2.x) or later.
  2. 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)'
04.

Sources

Related on VibeVulns
The weekly email

One email a week. Only what changed.

Every new security hole in AI coding tools, MCP servers, app builders and the stacks they generate (Next.js, Supabase, Node, PHP), each with how to check your app and the fix. No roundups of things you already read.

Free, one email a week. Read the latest issue first if you like. One-click unsubscribe in every email. We never sell or share addresses.