Skip to main content

Pydantic AI CVE-2026-65975

| EUVDEUVD-2026-50555 MEDIUM
Incorrect Authorization (CWE-863)
2026-07-29 GitHub_M
6.5
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Send crafted message history to UI adapter endpoint
  2. Delivery
    Embed dangling tool call in assistant-turn message
  3. Exploit
    Append client system message as trailing entry
  4. Execution
    sanitize_messages drops system message, index off-by-one bypasses tool call inspection
  5. Persist
    Framework dispatches tool call with attacker-supplied arguments
  6. Impact
    Registered non-approval tool executes, bypassing model-request hooks

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V8 - Authorization Authorization logic validation
MITRE ATT&CK

1 technique across 1 tactic: Privilege Escalation

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 the target application uses one of the two affected UI adapters: the AG-UI adapter (instantiated via Agent.to_ag_ui() or AGUIAdapter) or the Vercel AI adapter (VercelAIAdapter). The triggering condition is the combination of a client-submitted system message trailing the message history (which is dropped under the default manage_system_prompt='server' setting) and a preceding assistant message containing an unresolved tool call. This default configuration is what most deployments will have, making the attack surface broadly applicable within the affected population. Exploitation is blocked if the targeted tool has requires_approval=True, since approval-gated tools are not dispatched by the auto-execute path. Applications that do not expose any UI adapter endpoint (using only the programmatic agent API) are entirely unaffected regardless of version.

Impact

The NVD CVSS vector AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N correctly captures that this is a network-reachable, zero-prerequisite attack with bounded impact. The CVSS score of 6.5 is reasonable: the actual blast radius is constrained by which registered tools the application exposes and what those tools can do - a deployment with only read-only or low-privilege tools faces limited real-world impact, while one exposing tools that modify data, call external APIs, or interact with infrastructure faces meaningfully higher risk. The most critical exploitation scenario targets applications that rely on before_model_request or after_model_request hooks as an authorization or content-filtering guardrail, since forged tool calls skip the model turn entirely and therefore bypass those hooks. No EPSS score was provided in the input data and no KEV listing exists, suggesting no confirmed widespread exploitation. The attack requires no special conditions against any application using the affected UI adapters under default configuration, making this a genuine medium-priority item for the affected population, despite the moderate base score.

Exploit ScenarioDerived

An attacker interacting with an application that exposes the AG-UI or Vercel AI streaming endpoint crafts a message history that includes an assistant-turn message with an unresolved tool call followed by a client system message. Under the default manage_system_prompt='server' policy, sanitize_messages drops the trailing system message, causing the off-by-one index error that leaves the dangling tool call uninspected at the new tail. The framework dispatches the tool with the attacker's chosen arguments - for example, calling a data-export or API-interaction tool with attacker-controlled parameters - without the model ever having produced that call. No public proof-of-concept code has been identified at time of analysis.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.2% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Jul 29, 2026

Tool call injection in Pydantic AI's UI adapters (AG-UI via Agent.to_ag_ui()/AGUIAdapter, and Vercel AI via VercelAIAdapter) enables remote unauthenticated clients to force execution of registered server-side tools with attacker-supplied arguments, bypassing the framework's message-sanitization defense. The flaw affects pydantic-ai and pydantic-ai-slim versions 1.88.0-1.107.0 and 2.0.0b1-2.4.x. No public exploit code or CISA KEV listing exists at time of analysis, but the attack is low-complexity and exploitable against default configurations of applications using either UI adapter.

RemediationAI

The primary fix is to upgrade pydantic-ai or pydantic-ai-slim to version 1.107.1 (v1 branch) or 2.5.0 (v2 branch), as confirmed by the vendor advisory at https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-jpr8-2v3g-wgf9. If an immediate upgrade is not possible, annotate every registered tool that performs sensitive or state-modifying actions with requires_approval=True - this prevents auto-dispatch via the vulnerable path, though it adds user-interaction friction to the approval workflow. Alternatively, applications can temporarily avoid the AG-UI and Vercel AI adapters entirely and interact with the agent through the standard programmatic API, which is not affected by this sanitization flaw. Do not rely on model-request hooks (before_model_request / after_model_request) as a sole authorization control in affected versions, as forged tool calls bypass those hooks.

Affected VersionsENISA

pydantic-ai 1.88.0, < 1.107.1
pydantic-ai 2.0.0b1, < 2.5.0
pydantic-ai-slim 1.88.0, < 1.107.1
pydantic-ai-slim 2.0.0b1, < 2.5.0

Affected Packages

euvd pydantic_ai_1_88_0 fix: 1.107.1
euvd pydantic_ai_2_0_0b1 fix: 2.5.0
euvd pydantic_ai_slim_1_88_0 fix: 1.107.1
euvd pydantic_ai_slim_2_0_0b1 fix: 2.5.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 4 packages in euvd

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

Technical ContextAI · show details

Pydantic AI (CPE: cpe:2.3:a:pydantic:pydantic-ai:*:*:*:*:*:*:*:* and cpe:2.3:a:pydantic:pydantic-ai-slim:*:*:*:*:*:*:*:*) is a Python agent framework that wires LLM models to typed tool registries. Its AG-UI and Vercel AI adapters accept untrusted message histories from browser or streaming clients and are designed to scrub 'dangling' (unresolved, client-fabricated) tool calls via the sanitize_messages routine before forwarding history to the agent. The root cause is CWE-863 (Incorrect Authorization): the index used to anchor the sanitization pass was computed from the original message list length before any messages were dropped. When the default manage_system_prompt='server' policy caused a trailing client-submitted system message to be discarded during sanitization, the list shrank by one, and the preceding assistant message carrying an unresolved tool call became the new tail - at an index the sanitizer had already passed. The framework then dispatched that tool call as legitimate model output, skipping authorization checks entirely. Approval-gated tools (requires_approval=True) are handled by a separate pathway and are not affected.

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 (GitHub_M) PRIMARY 6.5 MEDIUM
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
vuln.today AI 6.5 MEDIUM

Network-reachable with no authentication under default adapter config; impact bounded to low C/I since tool registry scope limits blast radius and no availability impact applies.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
Red Hat 6.5 MEDIUM

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

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

Lifecycle Timeline

1
Patch available
Jul 29, 2026 - 21:17 EUVD

DescriptionCVE.org

Pydantic AI is a Python agent framework for building applications and workflows with Generative AI. In versions 1.88.0 up to but not including 1.107.1 and 2.0.0b1 up to but not including 2.5.0, the UI adapters (AG-UI via Agent.to_ag_ui()/AGUIAdapter, and Vercel AI via VercelAIAdapter) use sanitize_messages to strip unresolved ("dangling") client-submitted tool calls from untrusted message history before it reaches the agent, a defense-in-depth default that prevents the agent from executing tool calls the model never emitted. However, the strip anchored to a message index computed before sanitization ran, so when a trailing client message sanitized to empty and was dropped (for example a client system message under the default manage_system_prompt='server'), a preceding assistant response carrying an unresolved tool call became the new tail and was dispatched without inspection. As a result, a remote client could cause a registered, non-approval server tool to run with client-supplied arguments rather than arguments the model produced. The impact is bounded by what the affected tools do and is most significant for applications that gate tool execution in a model-request hook (before_model_request / after_model_request), since a forged call skips the model turn and bypasses that guardrail; approval-gated tools (requires_approval=True) are not auto-executed by this path. This issue has been fixed in versions 1.107.1 and 2.5.0.

Threat Intelligence Overview

EPSS Score
0.2%
Top 89% exploitable
Prevalence
Low
emerging AI agent framework, growing but niche production adoption
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor GitHub

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.2%
Patch available Yes
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
Yes
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

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

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

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-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

CVE-2026-107288 LOW
3.7 Oct 08

A domain-denylist bypass in Pydantic AI's local web-fetch tooling (web_fetch_tool and the WebFetch local fallback) lets

Vendor StatusVendor

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