Skip to main content

Pydantic AI EUVDEUVD-2026-131095

| CVE-2026-133505 MEDIUM
Access of Resource Using Incompatible Type (Type Confusion) (CWE-843)
2026-11-20 Pydantic GHSA-jvv4-fh7q-4c38
5.9
CVSS 3.1 · Vendor: Pydantic
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Control third-party data returned by a tool
  2. Delivery
    Embed JSON shaped like a Pydantic AI file item
  3. Exploit
    Message history serialized and reloaded
  4. Execution
    Mapping rebuilt as DocumentUrl/UploadedFile
  5. Persist
    Next model request downloads local URL or reads credentialed object
  6. Impact
    Exfiltrate content via attacker-controlled tool output

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Type safety enforcement
MITRE ATT&CK

1 technique across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that tool results can carry third-party-controlled data (for example JSON an MCP server or external API returns unchanged through a function tool), AND that message history containing those results is serialized and loaded again - via stored history (ModelMessagesTypeAdapter), server-held UI-adapter history (manage_message_history='server'), or Temporal/DBOS/Prefect durable execution - AND that the model in use is one Pydantic AI downloads files for, one that honors force_download, or one whose provider resolves non-HTTP file URLs or uploaded files. Local-network download specifically requires a DocumentUrl/ImageUrl rebuilt with force_download='allow-local' (cloud metadata addresses remain blocked). Limiting factors that reduce real-world exposure: history that a client submits through the Vercel AI or AG-UI adapter in default mode is NOT affected because sanitize_messages() resets force_download and drops non-HTTP URLs and uploaded files; and affected versions are pydantic-ai/pydantic-ai-slim >=1.50.0,<=1.107.9 and >=2.0.0b1,<=2.65.0. Exfiltration of downloaded document text further depends on the attacker being able to induce the model to repeat the content to a channel they control.

Impact

This is a moderate, conditional risk rather than a drop-everything emergency, and the signals are internally consistent on that point. The CVSS 3.1 vector (AV:N/AC:H/PR:N/UI:N, C:H/I:N/A:N, 5.9 Medium) captures a network-reachable, no-user-interaction flaw whose AC:H reflects the chain of specific preconditions required (history serialization plus reload plus a file-downloading/non-HTTP-resolving model). PR:N is appropriate because the assumed attacker is a third party with no application access who merely controls data a trusted tool returns (e.g., an MCP server or external API record) - it is not an authenticated application user. CWE here is type confusion (CWE-843), and the GHSA adds CWE-918 (SSRF), which matches the impact: internal-URL fetches and credentialed s3:///gs:// or uploaded-file reads. There is no CISA KEV listing and no EPSS score in the input, so there is no evidence of active or widespread exploitation; status is no public exploit identified at time of analysis. The vuln.today decision label is this_month, not act_now or emergency, consistent with a vendor-reported issue that is serious for a specific deployment shape but not mass-exploitable. The main caveat for prioritization is that real risk is highly architecture-dependent: only applications matching all of the serialize-reload-plus-file-model conditions are exposed, so blanket high-urgency treatment would overstate it while ignoring it in a qualifying architecture would understate it. EPSS and KEV data are absent and should be checked before final triage.

Exploit ScenarioDerived

An attacker who controls data returned by an MCP server or an external API (whose JSON a function tool returns unchanged) embeds a mapping shaped exactly like a Pydantic AI file item such as a DocumentUrl pointing at an internal-network URL, or an UploadedFile/s3:// reference. The model initially sees this only as JSON text, but once the message history is serialized and loaded again (stored history, server-held UI-adapter history, or Temporal/DBOS/Prefect durable execution), Pydantic AI rebuilds the mapping as a real file, so the next model request downloads the local URL or has the provider resolve the object using the application's credentials; the attacker recovers the content by inducing the model to repeat it to a tool they control. No public exploit is identified at time of analysis, and no injected instructions are needed - only a subsequent model request.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
No patch listed yet 0.6% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 20, 2026

Deserialization type confusion in Pydantic AI (pydantic-ai and pydantic-ai-slim) lets third-party-controlled tool result data be rebuilt as a file object when serialized message history is loaded again, so the application then downloads an attacker-named URL on its local network or the model provider reads an s3:// object or uploaded file using the application's credentials. Affected versions are >=1.50.0 through <=1.107.9 and >=2.0.0b1 through <=2.65.0; exploitation requires that tool results can carry untrusted data, that history containing them is serialized and reloaded (stored history, server-held UI adapter history, or Temporal/DBOS/Prefect durable execution), and that the model in use is one Pydantic AI downloads files for, one that honors force_download, or one whose provider resolves non-HTTP file URLs or uploaded files, making this a conditional confidentiality-only issue scored 5.9 (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N) with no public exploit identified at time of analysis. Fixed in 1.107.10 and 2.66.0.

RemediationAI

Vendor-released patch: upgrade to pydantic-ai / pydantic-ai-slim 1.107.10 (1.x branch) or 2.66.0 (2.x branch); both are listed as fixed versions and older releases ignore the new provenance record, so rolling upgrades of durable-execution workers are safe and in-flight runs keep their files. Where upgrading is not immediately possible: run sanitize_messages() on stored history before reusing it, which resets force_download on file URLs in tool results and drops uploaded-file references and non-HTTP URLs - note it also applies its other untrusted-history rules, such as removing unresolved tool calls at the end, so check those against how your application resumes runs; and have function tools return third-party data as a JSON string (for example pydantic_core.to_json(data).decode()) rather than as a dict or list, since a string is never rebuilt as a file - this changes how tools consume such data downstream. To audit already-stored history, look for tool-return content containing "kind" values such as "document-url", "image-url" or "uploaded-file" that your own tools did not produce, especially with "force_download" set or a non-HTTP "url". If you stored history yourself and fully trust its contents, load it with ModelMessagesTypeAdapter.validate_json(data, context={'pydantic_ai': {'rebuild_unrecorded_tool_files': True}}) (or validate_python) to restore the previous file-rebuild behavior, then save it again so it carries the record; only do this for history no third party could have shaped, because it restores the earlier behavior for any lookalike already present. For Temporal/DBOS/Prefect journals, harness step persistence, saved conversations and delegated-task records that may contain tool results built from third-party data, finish or discard runs started before the upgrade rather than continuing them, or sanitize the history first.

Affected VersionsENISA

pydantic-ai-slim 1.50.0 ≤1.107.9
pydantic-ai-slim 2.0.0b1 ≤2.65.0
pydantic-ai 1.50.0 ≤1.107.9
pydantic-ai 2.0.0b1 ≤2.65.0

Affected Packages

euvd pydantic_ai no fix
euvd pydantic_ai_slim no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The root cause is CWE-843 (access of a resource using an incompatible type), with an SSRF-style consequence also tracked as CWE-918. Pydantic AI rebuilds file items - ImageUrl, DocumentUrl, AudioUrl, VideoUrl and UploadedFile - nested inside tool results when message history is deserialized, so that genuine files a tool returned survive a round trip. The check was shape-based rather than provenance-based: a plain mapping returned by a tool that serializes to the same JSON as one of those file items was rebuilt as a file too. During the original run the model received the mapping as JSON text; after reload it becomes a file that the next model request downloads or references. The relevant serialization boundaries are ModelMessagesTypeAdapter-based stored history, UI adapter history held server-side with manage_message_history='server', and Temporal, DBOS or Prefect durable execution, which serialize tool results between steps within a single run. The fix records which file items a tool result actually held at serialization time, outside the tool's data, and rebuilds only those; legacy history without that record rebuilds lookalikes only as HTTP(S) URLs with force_download reset, and keeps UploadedFile and non-HTTP URLs as plain mappings. The assessed vector (AC:H) reflects that the attacker cannot directly reach the flaw and must win a chain of preconditions rather than a single request.

Know when Pydantic Ai gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (Pydantic) PRIMARY 5.9 MEDIUM
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
vuln.today AI 5.9 MEDIUM

A remote third party controlling tool-returned data needs no application privileges (PR:N) but depends on multiple preconditions - serialize/reload plus a file-resolving model - so AC:H; impact is credentialed read/SSRF disclosure, hence C:H, I:N, A:N.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (Pydantic).

CVSS VectorVendor: Pydantic

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

DescriptionCVE.org

When message history is serialized and loaded again, a tool result that contains a JSON object in the serialized shape of one of Pydantic AI's file types is rebuilt as that file. A third party who controls data a tool returns, such as a record that an MCP server or a function tool returns from an external system, can use this to make the application download a URL on its local network, or make the model provider read an s3:// object or uploaded file with the application's credentials. Applications are affected when tool results can contain third-party data, message history containing those results is serialized and loaded again (stored history, history a UI adapter holds on the server, or Temporal, DBOS or Prefect durable execution), and the model is one Pydantic AI downloads files for, one that honors force_download, or one whose provider resolves non-HTTP file URLs or uploaded files. History that a client submits through the Vercel AI or AG-UI adapter in the default mode is not affected. The issue is fixed in pydantic-ai and pydantic-ai-slim 1.107.10 and 2.66.0.

Threat Intelligence Overview

EPSS Score
0.6%
Top 52% exploitable
Prevalence
Medium
popular but newer Python AI-agent framework, growing yet limited production footprint
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.6%
Patch available No
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

31
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +30
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

CVE-2026-25580 HIGH POC
8.6 Feb 06

Pydantic AI versions 0.0.26 through 1.55.x contain a server-side request forgery vulnerability in URL download functiona

CVE-2026-107295 HIGH
7.6 Oct 08

Cross-site request forgery in Pydantic AI's development web chat UI allows any website a developer happens to visit whil

CVE-2026-107286 HIGH
7.5 Oct 08

Concurrency slot exhaustion in Pydantic AI 2.10.0 through 2.52.x lets streamed model requests permanently occupy slots i

CVE-2026-48782 MEDIUM
6.8 Jun 16

Server-Side Request Forgery in Pydantic AI (versions 1.56.0-1.101.0, 2.0.0b1, 2.0.0b2) allows unauthenticated network at

CVE-2026-107289 MEDIUM
6.8 Oct 08

Server-side request forgery in Pydantic AI's URL-fetching guards lets an application that has explicitly opted a URL int

CVE-2026-54249 MEDIUM POC
6.8 Jul 29

Server-Side Request Forgery in Pydantic AI's UI adapter layer (versions 1.65.0-1.105.0 and 2.0.0b1-2.0.0b5) allows unaut

CVE-2026-107294 MEDIUM
6.5 Oct 08

Pydantic AI, a Python framework for building Generative AI agents, buffers complete HTTP response bodies before applying

CVE-2026-107290 MEDIUM
6.5 Oct 08

Denial of service in Pydantic AI (pydantic-ai and pydantic-ai-slim) versions 1.77.0 through 1.107.5 and 2.0.0b1 through

CVE-2026-107287 MEDIUM
6.5 Oct 08

Denial of service in Pydantic AI's local web_fetch_tool and WebFetch local fallback allows an attacker-controlled HTML p

CVE-2026-65975 MEDIUM
6.5 Jul 29

Tool call injection in Pydantic AI's UI adapters (AG-UI via Agent.to_ag_ui()/AGUIAdapter, and Vercel AI via VercelAIAdap

CVE-2026-107292 MEDIUM
6.4 Oct 08

DNS rebinding against the Pydantic AI development web chat server (Agent.to_web() and `clai web`) lets a hostile website

CVE-2026-25640 MEDIUM
5.4 Feb 06

Pydantic AI versions 1.34.0 through 1.50.x contain a path traversal vulnerability in the web UI that allows unauthentica

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy