Intel

AIKIDO-2026-680513

pydantic-ai-slim is vulnerable to Incorrect Authorization

Incorrect AuthorizationGHSA-jpr8-2v3g-wgf9 Published 5 days ago

65

Medium Risk

This Affects:

PYTHONpydantic-ai-slim
1.88.0 - 1.107.0
Fixed in 1.107.1
2.0.0 - 2.4.0
Fixed in 2.5.0
Are you affected? Scan for Free

TL;DR

Pydantic AI's UI adapters (AGUIAdapter and VercelAIAdapter) sanitize untrusted, client-submitted message history through UIAdapter.sanitize_messages before it reaches the agent, stripping unresolved dangling tool calls from the trailing response by default. The strip anchored to a message index computed before sanitization ran, so when a trailing client message sanitized to empty and was dropped, a preceding assistant response carrying an unresolved client-submitted tool call became the new tail and was dispatched unchecked. A remote client can use this to make a registered non-approval tool execute with attacker-supplied, schema-valid arguments, bypassing execution guardrails placed in model-request hooks. The fix moves the strip to a post-pass over the already-sanitized history so dangling tool calls are removed from whichever response actually survives as the tail.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and serve an agent over a UI adapter (AG-UI or Vercel AI) in its default configuration.

Background info

pydantic-ai-slim is vulnerable to Incorrect Authorization in versions 1.88.0 - 1.107.0 and 2.0.0 - 2.4.0.

How to fix this

Upgrade the pydantic-ai-slim and/or the pydantic-ai library to the patch version.