pydantic-ai-slim is vulnerable to Incorrect Authorization
65
Medium Risk
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.
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.
pydantic-ai-slim is vulnerable to Incorrect Authorization in versions 1.88.0 - 1.107.0 and 2.0.0 - 2.4.0.
Upgrade the pydantic-ai-slim and/or the pydantic-ai library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant