GHSA-5PFM-2G3G-GH85
UI adapters: a client-submitted tool call can execute because the compaction-part drop runs after the dangling-call strip
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-5PFM-2G3G-GH85 divulgada · CVSS 5.4 (GitHub) | |
| Remediación | Parche 2.58.0 | pydantic-ai-slim · 0 d desde divulgación | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Pydantic AI's UI adapters, Vercel AI (`VercelAIAdapter`) and AG-UI (`AGUIAdapter` / `Agent.to_ag_ui()`), remove unresolved tool calls from the end of client-submitted history, so that a run without a new prompt does not execute a tool call the model never made. This is the protection fixed in GHSA-jpr8-2v3g-wgf9 https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-jpr8-2v3g-wgf9.
When the application passes its own server-side `message_history`, the adapters also drop client-submitted compaction parts. That drop ran after the unresolved-tool-call check. A client could arrange its history so that dropping a compaction-only message left an unchecked tool call at the end, and the agent then ran that tool with arguments the client chose, without a model request.
Details
The impact is bounded in the same way as GHSA-jpr8-2v3g-wgf9:
- Tool arguments are still validated against the tool's schema.
- Tools that require approval (`requires_approval=True` or `ApprovalRequiredToolset`) are not executed by this path.
- Only tools available to the agent can be reached, and a client can often obtain the same call by prompting the model.
The difference from a model-produced call is that this call skips the model request. The model cannot decline it, and guardrails in `before_model_request` or `after_model_request` do not see it. Guardrails in `before_tool_execute` and authorization inside tool functions are unaffected.
You are affected if all of the following apply:
- You serve an agent through the Vercel AI or AG-UI adapter.
- You pass a non-empty server-side `message_history` to the adapter's run method.
- `manage_system_prompt` is `'server'` (the default).
- You rely on the model or a model-request hook, rather than on the tool function or `before_tool_execute`, to constrain how a tool that does not require approval is called.
Mitigation
Upgrade to a patched version. The adapters now drop client-submitted compaction parts before checking the end of the history.
Until you can upgrade:
- Enforce authorization inside each tool function, against the authenticated user carried in your dependencies.
- Place tool-execution guardrails in `before_tool_execute`, which runs however a tool call entered the history.
- Require approval for tools whose effects matter.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
pypipydantic-ai-slim |
Corregida | 2.58.0 | 0 d | 2.71.0 no afectada |
pypipydantic-ai |
Corregida | 2.58.0 | 0 d | 2.68.0 no afectada |
2.58.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-5pfm-2g3g-gh85Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
