# 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\`

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 6.5
- **CVSS:** 6.5 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: Low; Integrity impact: Low; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.33% (percentile 19, 2026-11-26)
- **CWE:** CWE-863
- **Published:** 2026-07-29T20:06:09.177Z
- **Modified:** 2026-08-04T12:43:40.373Z

## Who should check

- Anyone running pydantic-ai \>= 1.88.0, \< 1.107.1; \>= 2.0.0b1, \< 2.5.0
- Anyone running pydantic-ai-slim \>= 1.88.0, \< 1.107.1; \>= 2.0.0b1, \< 2.5.0

## Description

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.

## Affected and fixed versions

- pydantic-ai: \>= 1.88.0, \< 1.107.1; \>= 2.0.0b1, \< 2.5.0 (cvelist)
- pydantic-ai-slim: \>= 1.88.0, \< 1.107.1; \>= 2.0.0b1, \< 2.5.0 (cvelist)

## Mitigation

- Upgrade pydantic-ai to 2.5.0 or later.
- Upgrade pydantic-ai-slim to 2.5.0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-65975. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-65975.md
Affected: pydantic-ai >= 1.88.0, < 1.107.1; >= 2.0.0b1, < 2.5.0; pydantic-ai-slim >= 1.88.0, < 1.107.1; >= 2.0.0b1, < 2.5.0
Fixed in: pydantic-ai 1.107.1, pydantic-ai 2.5.0, pydantic-ai-slim 1.107.1, pydantic-ai-slim 2.5.0

Steps:
1. Search this machine and project for pydantic-ai, pydantic-ai-slim: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-65975 being exploited?

There is no confirmed exploitation: CVE-2026-65975 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.33% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-65975?

Medium: CVSS 6.5 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2026-65975?

pydantic-ai \>= 1.88.0, \< 1.107.1; \>= 2.0.0b1, \< 2.5.0; pydantic-ai-slim \>= 1.88.0, \< 1.107.1; \>= 2.0.0b1, \< 2.5.0.

### Is there a fix for CVE-2026-65975?

Yes. Fixed in pydantic-ai 1.107.1, pydantic-ai 2.5.0, pydantic-ai-slim 1.107.1, pydantic-ai-slim 2.5.0. Upgrade pydantic-ai to 2.5.0 or later. Upgrade pydantic-ai-slim to 2.5.0 or later.

### How do I check if I'm affected by CVE-2026-65975?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-jpr8-2v3g-wgf9>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-65975>

HTML: <https://flawdb.com/CVE-2026-65975> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-65975>
