Pydantic AI AG-UI Adapter: A dangling client-submitted tool call can execute when a trailing message is dropped during sanitize_messages
Overview
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.
- Published
- 7/29/2026
- Last modified
- 8/4/2026
- CVE assigner
- Not available
- NVD analysis
- Not available
Exploitation
No CISA KEV flag in the saved record
An absent KEV flag does not establish that exploitation has never occurred. Verify current intelligence before prioritizing work.
EPSS predictions and CISA SSVC assessments are not imported here. Review additional intelligence on Cloudflare
Affected products
Affected-version rules published in the advisory. Conditions and uncertain comparisons require verification.
| Vendor / product | Affected versions | Platform / conditions | Evidence |
|---|---|---|---|
pydantic ai pydantic | ≥ 1.88.0, < 1.107.1 | Verify advisory The advisory has platform, edition, hardware, or configuration conditions not verified by software inventory. | Source |
pydantic ai pydantic | ≥ 2.0.0, < 2.5.0 | Verify advisory The advisory has platform, edition, hardware, or configuration conditions not verified by software inventory. | Source |
pydantic-ai pydantic | >= 1.88.0, < 1.107.1 | Verify advisory Verify the advisory platform, edition, update channel, and any version exceptions. | Source |
pydantic-ai pydantic | >= 2.0.0b1, < 2.5.0 | Verify advisory Verify the advisory platform, edition, update channel, and any version exceptions. | Source |
pydantic-ai-slim pydantic | >= 1.88.0, < 1.107.1 | Verify advisory | Source |
pydantic-ai-slim pydantic | >= 2.0.0b1, < 2.5.0 | Verify advisory | Source |
Recommended actions
Verify the product, installed version, platform, and advisory prerequisites on each system. Apply the vendor's applicable fixed release or mitigation. An affected-range boundary alone is not a universal update recommendation.
Vendor advisory links
Derived from non-aggregator references because the source record has no vendor tags. Verify the advisory before acting on it.
Severity
CVSS describes technical impact. It is separate from exploitation evidence.
Published headline score: 6.5. Score version, vector, and attribution are not available in this record. Additional score details appear when the source record is next refreshed.
Sources & references
Sources: Official CVE List, NVD and cve.now (summaries CC BY 4.0). Uses NVD data; not endorsed by NVD.