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
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.
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.
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| pydantic-ai | PyPI | >= 1.34.0, < 1.51.0 | 1.51.0 |
| pydantic-ai-slim | PyPI | >= 1.34.0, < 1.51.0 | 1.51.0 |
- CriticalMCP Path Traversal Allows Full-Filesystem Read and JWT Secret Exfiltration Leading to Account Takeoverlangflow, langflow-base
- Critical@zereight/mcp-gitlab: Unauthenticated arbitrary file read via `upload_markdown` enables PAT exfiltration and full account takeover@zereight/mcp-gitlab
- CriticalFlowise RCE via SQL Database Chain Nodeflowise, flowise-components
- CriticalLangroid: SQLChatAgent dangerous-function blocklist can be bypassed with quoted or schema-qualified pg_read_file callslangroid
- Criticalfast-mcp-telegram: Bearer token path traversal bypasses reserved Telegram session protectionfast-mcp-telegram
- CriticalMCP Toolbox HTTP tool path parameters allow traversal to unintended endpointsgithub.com/googleapis/mcp-toolbox
- HighPydantic AI: Concurrency-limited models can keep their slot when a streamed request ends earlypydantic-ai, pydantic-ai-slim
- 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
- HighPydantic AI has Server-Side Request Forgery (SSRF) in URL Download Handlingpydantic-ai, pydantic-ai-slim
- MediumPydantic AI: Event loop blocked by quadratic title extraction in `web_fetch`pydantic-ai, pydantic-ai, pydantic-ai-slim, pydantic-ai-slim
- 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
- 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.