CVE-2026-25640: Pydantic AI affected by Stored XSS via Path Traversal in Web UI CDN URL
Vulnerability summary
CVE-2026-25640 is a high (CVSS 7.1) vulnerability in pydantic pydantic_ai. EPSS estimates a 0.37% chance of exploitation in the next 30 days, higher than 31.1% of scored vulnerabilities.
Not severe (CVSS 7.1, network access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Timeline
- 06-02-2026PublishedVulnerability first disclosed.
- 15-07-2026Last modifiedVulnerability information updated.
Description
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.
CVSS metrics
3 scores · 3 sources · 1 version- OSV · PypiEcosystem advisory · calculated7.1HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N
- NVDNIST5.4MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:NDiffers
EPSS trend
Probability
0.37%
Chance of exploitation in the next 30 days
Percentile
31%
Versus all other CVEs
30-day change
Decrease -0.09 pp
From 0.46% on 04-10-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root cause- CWE-22Improper Limitation of a Pathname to a Restricted DirectoryThe product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
- CWE-79Improper Neutralization of Input During Web Page GenerationThe product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Affected systems
Known conditions: network-reachable, no authentication, user interaction (CVSS vector). Other conditions: not stated in public data.
Pydantic2 products
- pydantic_ai≥ 1.34.0, < 1.51.0
- pydantic-ai≥ 1.34.0, < 1.51.0
PyPI2 products
- pydantic-ai≥ 1.34.0, < 1.51.0
- pydantic-ai-slim≥ 1.34.0, < 1.51.0
2 vendors · 4 products
References
10 links- github.com/pydantic/pydantic-ai/security/advisories/GHSA-wjp5-868j-wqv7X Refsource CONFIRMWEBVendor Advisory
- pypi.org/project/pydantic-aiPACKAGE