Impact
A path traversal flaw in Pydantic AI’s web UI allows an attacker to construct a malicious URL that causes the server to load and serve arbitrary JavaScript from the CDN. When the vulnerable version query parameter is unvalidated, the server fetches attacker‑controlled HTML/JavaScript and delivers it to the victim’s browser, resulting in a stored cross‑site scripting (XSS) attack that can steal chat history and other client‑side data. The weakness is reflected in CWE‑22 (Path Traversal) and CWE‑79 (Cross‑Site Scripting).
Affected Systems
The vulnerability is present in Pydantic AI versions from 1.34.0 up to, but not including, 1.51.0. It affects applications that use Agent.to_web or Agent.cli to expose a chat interface, typically running locally on localhost but also possible on remote servers.
Risk and Exploitability
The CVSS score of 7.1 indicates a moderate‑to‑high severity; the EPSS score is below 1%, implying a low current exploitation probability, and it is not listed in the CISA KEV catalog. An attacker would need to deliver a crafted URL to a victim or embed it in an iframe; the victim must then view the page for the XSS to execute. The risk is higher if the web interface is publicly accessible, whereas a strictly local deployment limits exposure.
OpenCVE Enrichment
Github GHSA