UTC
Medium

Pydantic AI Web chat UI (`Agent.to_web()`, `clai web`): the local chat endpoint does not validate the `Host` header

CVE-2026-107292 · GHSA-q2xc-rrxj-58x9 · published 2026-10-08

Severity
Medium
CVSS score
6.4
Chance of exploitation (EPSS)
0.13%
Fixed in
2.30.0
  • Exploitation No known exploitation
  • Automatable No
  • Technical impact Partial
  • CISA SSVC
What it is

Applications and developers serving an agent through Agent.to_web() 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. Current browser protections reduce but do not remove this exposure: Chromium's Local Network Access gates loopback subresource requests, but does not cover top-level navigations, and Safari does not implement it.

What to do

Upgrade pydantic-ai to 2.30.0 or later, and pydantic-ai-slim to 2.30.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 pydantic-ai/pydantic-ai-slim >= 2.30.0, or >= 1.107.5 on the v1 maintenance line. The fix validates the Host header and rejects anything other than localhost, a loopback/LAN IP address, or an explicitly allowed host, responding 421 Misdirected Request otherwise. If you serve the web chat UI under a real hostname — behind a reverse proxy, tunnel, or similar — name it explicitly:

Affected
PackageRegistryAffectedFixed in
pydantic-aiPyPI>= 1.34.0, < 1.107.51.107.5
pydantic-aiPyPI>= 2.0.0b1, < 2.30.02.30.0
pydantic-ai-slimPyPI>= 1.34.0, < 1.107.51.107.5
pydantic-ai-slimPyPI>= 2.0.0b1, < 2.30.02.30.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 Web chat UI (`Agent.to_web()`, `clai web`): a website visited by the developer can trigger agent runs and server-side tool execupydantic-ai, pydantic-ai, pydantic-ai-slim, pydantic-ai-slim
  3. HighPydantic AI has Server-Side Request Forgery (SSRF) in URL Download Handlingpydantic-ai, pydantic-ai-slim
  4. HighPydantic AI has Stored XSS via Path Traversal in Web UI CDN URLpydantic-ai, pydantic-ai-slim
  5. MediumPydantic AI: Event loop blocked by quadratic title extraction in `web_fetch`pydantic-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].