UTC
High

Pydantic AI has Stored XSS via Path Traversal in Web UI CDN URL

CVE-2026-25640 · GHSA-wjp5-868j-wqv7 · published 2026-02-06

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

A Path Traversal vulnerability in the Pydantic AI web UI allows an attacker to serve arbitrary JavaScript in the context of the application by crafting a malicious URL. If a victim clicks the link or visits it via an iframe, attacker-controlled code executes in their browser, enabling theft of chat history and other client-side data. This vulnerability only affects applications that use: Agent.toweb to serve a chat interface clai web** to serve a chat interface from the CLI These are typically run locally (on localhost), but may also be deployed on a remote server.

What to do

Upgrade pydantic-ai to 1.51.0 or later, and pydantic-ai-slim to 1.51.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.

Upgrade to the patched version or later. The fix removes the user-controllable version parameter entirely. The CDN URL is now hardcoded at startup and cannot be influenced by request parameters. A new htmlsource parameter is available on Agent.toweb and createwebapp for applications that need to customize the UI source (e.g., for enterprise environments, offline usage, or custom UI builds). This parameter is only settable in application code, not via query parameters.

Affected
PackageRegistryAffectedFixed in
pydantic-aiPyPI>= 1.34.0, < 1.51.01.51.0
pydantic-ai-slimPyPI>= 1.34.0, < 1.51.01.51.0

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].