CVE-2026-65975: Pydantic AI AG-UI Adapter: A dangling client-submitted tool call can execute when a trailing message is dropped during `sanitize_messages`

Published Jul 29, 2026
·
Updated

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.toagui()/AGUIAdapter, and Vercel AI via VercelAIAdapter) use sanitizemessages 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 managesystemprompt='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 (beforemodelrequest / aftermodelrequest), since a forged call skips the model turn and bypasses that guardrail; approval-gated tools (requiresapproval=True) are not auto-executed by this path. This issue has been fixed in versions 1.107.1 and 2.5.0.

Affected Software

4 affected components
pydantic-ai>1.88.0<1.107.1
pydantic-ai>2.0.0b1<2.5.0
Pydantic Pydantic Ai Python>=1.88.0<1.107.1
Pydantic Pydantic Ai Python>=2.0.0<2.5.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pydantic-ai to a version that resolves this vulnerability.

    Fixed in 1.107.1
  2. Upgrade

    Upgrade pydantic-ai to a version that resolves this vulnerability.

    Fixed in 2.5.0

Event History

Jul 29, 2026
CVE Published
via MITRE·08:06 PM
Data Sourced
via MITRE·08:06 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:17 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-65975?

The severity of CVE-2026-65975 is medium, rated at 6.5.

2

How do I fix CVE-2026-65975?

To fix CVE-2026-65975, upgrade to Pydantic AI version 1.107.1 or later, or 2.5.0 or later.

3

What type of vulnerability is CVE-2026-65975?

CVE-2026-65975 is a dangling client-submitted tool call vulnerability related to message sanitization.

4

What software is affected by CVE-2026-65975?

CVE-2026-65975 affects the Pydantic AI framework versions 1.88.0 up to but not including 1.107.1 and 2.0.0b1 up to but not including 2.5.0.

5

When was CVE-2026-65975 published?

CVE-2026-65975 was published on July 29, 2026.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203