Pydantic AI affected by Stored XSS via Path Traversal in Web UI CDN URL
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- High · Low · None
- Fix status
- Partial Red Hat: 1 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-79.
Summary
Pydantic AI is a Python agent framework for building applications and workflows with Generative AI. From 1.34.0 to before 1.51.0, 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. In affected versions, the CDN URL is constructed using a version query parameter from the request URL. This parameter is not validated, allowing path traversal sequences that cause the server to fetch and serve attacker-controlled HTML/JavaScript from an arbitrary source on the same CDN, instead of the legitimate chat UI package. 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.to_web to serve a chat interface and 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. This vulnerability is fixed in 1.51.0.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| pydantic | pydantic-ai | 1.34.0 to before 1.51.0 | 1.51.0 | Patch available | CNA |
| — | pydantic-ai (PyPI) | 1.34.0 to before 1.51.0 | 1.51.0 | Patch available | GHSA-wjp5-868j-wqv7 |
| — | pydantic-ai-slim (PyPI) | 1.34.0 to before 1.51.0 | 1.51.0 | Patch available | GHSA-wjp5-868j-wqv7 |
- pydantic-ai Vendorpydantic Affected 1.34.0 to before 1.51.0 Fixed in 1.51.0 Patch available CNA
- pydantic-ai (PyPI) Vendor— Affected 1.34.0 to before 1.51.0 Fixed in 1.51.0 Patch available GHSA-wjp5-868j-wqv7
- pydantic-ai-slim (PyPI) Vendor— Affected 1.34.0 to before 1.51.0 Fixed in 1.51.0 Patch available GHSA-wjp5-868j-wqv7
Remediation
- Fix · CNA pydantic-ai (pydantic) Fixed in 1.51.0
- Fix · GHSA-wjp5-868j-wqv7 pydantic-ai (PyPI) Fixed in 1.51.0 Advisory →
- Fix · GHSA-wjp5-868j-wqv7 pydantic-ai-slim (PyPI) Fixed in 1.51.0 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux AI (RHEL AI) 3 | Affected | No fix planned: Will not fix |
Timeline
- 2026-10-02 Threatist record created from CVE-2026-25640
- 2026-10-03 Alias added: GHSA-wjp5-868j-wqv7
References
More Pydantic Ai vulnerabilities
- TI-2026-20687 Pydantic AI Affected by Server-Side Request Forgery (SSRF) in URL Download Handling CVSS 3.1HIGH 8.6
- TI-2026-69551 Pydantic AI keeps concurrency slots after streams end early CVSS 3.1HIGH 7.5
- TI-2026-46990 Incorrect authorization in pydantic-ai CVSS 3.1MEDIUM 6.5
- TI-2026-69610 Cross-site requests run agent tools in pydantic-ai web chat CVSS 3.1HIGH 7.6
- TI-2026-69617 Pydantic AI blocklist bypass via IPv6 zone identifier allows SSRF CVSS 3.1MEDIUM 6.8
- TI-2026-39151 Server-side request forgery in pydantic-ai CVSS 3.1MEDIUM 6.8
Sources
- CVE-2026-25640 · CVE Program
- CVE-2026-25640 · NVD
- FIRST EPSS
- GHSA-wjp5-868j-wqv7 · GitHub Advisory Database · CC BY 4.0
- CVE-2026-25640 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences