UTC
High

Pydantic AI Web chat UI (`Agent.to_web()`, `clai web`): a website visited by the developer can trigger agent runs and server-side tool execu

CVE-2026-107295 · GHSA-h4xc-3qfq-jf93 · published 2026-10-08

Severity
High
CVSS score
7.6
Chance of exploitation (EPSS)
0.16%
Fixed in
2.28.0
  • Exploitation No known exploitation
  • Automatable No
  • Technical impact Partial
  • CISA SSVC
What it is

Applications and developers serving an agent through Agent.toweb() or clai web. The consequences depend on the tools the served agent exposes, and can include data disclosure as well as unwanted tool side effects. Tools marked requiresapproval=True were not protected either, because the endpoint trusts approval decisions relayed by the client.

What to do

Upgrade pydantic-ai to 2.28.0 or later, and pydantic-ai-slim to 2.28.0 or later. If you start it from an MCP config with npx or uvx, pin that version so an old cached copy is not used.

If you cannot upgrade yet

Upgrade to a patched version. The chat endpoint now requires Content-Type: application/json and rejects other requests before the request body is parsed and before the agent runs. The bundled chat UI already sends this header; scripts and other non-browser clients that call the endpoint directly may need to be updated to send it. If you cannot upgrade, don't run the web UI while browsing untrusted sites, stop it when you aren't using it, and don't serve an agent with side-effecting tools through it.

Affected
PackageRegistryAffectedFixed in
pydantic-aiPyPI>= 1.34.0, < 1.107.41.107.4
pydantic-aiPyPI>= 2.0.0b1, < 2.28.02.28.0
pydantic-ai-slimPyPI>= 1.34.0, < 1.107.41.107.4
pydantic-ai-slimPyPI>= 2.0.0b1, < 2.28.02.28.0
Also in pydantic-ai, pydantic-ai, pydantic-ai-slim, pydantic-ai-slim
  1. HighPydantic AI: Concurrency-limited models can keep their slot when a streamed request ends earlypydantic-ai, pydantic-ai-slim
  2. HighPydantic AI has Server-Side Request Forgery (SSRF) in URL Download Handlingpydantic-ai, pydantic-ai-slim
  3. HighPydantic AI has Stored XSS via Path Traversal in Web UI CDN URLpydantic-ai, pydantic-ai-slim
  4. MediumPydantic AI: Event loop blocked by quadratic title extraction in `web_fetch`pydantic-ai, pydantic-ai, pydantic-ai-slim, pydantic-ai-slim
  5. MediumPydantic AI Web chat UI (`Agent.to_web()`, `clai web`): the local chat endpoint does not validate the `Host` headerpydantic-ai, pydantic-ai, pydantic-ai-slim, pydantic-ai-slim
  6. MediumPydantic AI: Unbounded memory use when downloading remote content via web_fetch or FileUrlpydantic-ai, pydantic-ai, pydantic-ai-slim, pydantic-ai-slim

The impact, patch and workaround text comes from the advisory, shortened (GitHub Advisory Database, CC BY 4.0). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.

Sources: GitHub Advisory Database, reviewed and malware advisories (CC BY 4.0, https://github.com/advisories); advisories published by Cursor (https://github.com/cursor/cursor/security/advisories); advisories published by OpenClaw (https://github.com/openclaw/openclaw/security/advisories); advisories published by vLLM (https://github.com/vllm-project/vllm/security/advisories); advisories published by Open WebUI (https://github.com/open-webui/open-webui/security/advisories); advisories published by n8n (https://github.com/n8n-io/n8n/security/advisories); advisories published by Flowise (https://github.com/FlowiseAI/Flowise/security/advisories); advisories published by Langflow (https://github.com/langflow-ai/langflow/security/advisories); advisories published by the MCP Python SDK project (https://github.com/modelcontextprotocol/python-sdk/security/advisories); advisories published by MLflow (https://github.com/mlflow/mlflow/security/advisories); CISA Known Exploited Vulnerabilities catalog (CC0). Data as of 2026-11-22. ShieldMap describes how each problem works and how to fix it; it does not publish exploit code. Report a correction to [email protected].