{"id":"CVE-2026-25640","published":"2026-02-06T20:01:53Z","modified":"2026-07-15T01:16:10Z","title":"Pydantic AI affected by Stored XSS via Path Traversal in Web UI CDN URL","vendor":"pydantic","product":"pydantic-ai","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.1,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00371,"percentile":0.31885,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"},{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"references":[{"url":"https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-wjp5-868j-wqv7","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/pydantic/pydantic-ai/releases/tag/v1.51.0","tags":["x_refsource_MISC"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-25640","tags":["vdb-entry","x_refsource_REDHAT"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2437753","tags":["issue-tracking","x_refsource_REDHAT"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-25640.json","tags":["x_sadp-csaf-vex"]}],"priority":{"score":11.3,"factors":[{"name":"EPSS percentile","points":6.38},{"name":"CVSS severity","points":4.97}]},"vendorSlug":"pydantic","affectedVersions":[{"vendor":"pydantic","product":"pydantic-ai","versions":[">= 1.34.0, < 1.51.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-02-06T20:16:17.763231Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"pydantic-ai","vulnerableRanges":[">=1.34.0, <1.51.0"],"patched":["1.51.0"],"from":["GHSA-wjp5-868j-wqv7","PYSEC-2026-2979"],"provenance":"source"},{"ecosystem":"PyPI","package":"pydantic-ai-slim","vulnerableRanges":[">=1.34.0, <1.51.0"],"patched":["1.51.0"],"from":["GHSA-wjp5-868j-wqv7","PYSEC-2026-2983"],"provenance":"source"}],"euvd":{"id":"EUVD-2026-5593","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2026-25640","published":"2026-02-06","fixed":"1.51.0","kev":false},{"cve":"CVE-2026-25580","published":"2026-02-06","fixed":"1.56.0","kev":false,"link":{"from":"CVE-2026-25640","to":"CVE-2026-25580","relation":"successor","confidence":"low","kind":"sequence","orderedBy":"description","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:pydantic-ai","fromFixed":"1.51.0","toFixed":"1.56.0","daysApart":0},{"kind":"version-step","provenance":"source","package":"PyPI:pydantic-ai-slim","fromFixed":"1.51.0","toFixed":"1.56.0","daysApart":0}]}},{"cve":"CVE-2026-46678","published":"2026-07-29","fixed":"1.99.0","kev":false},{"cve":"CVE-2026-48782","published":"2026-06-16","fixed":"2.0.0b3","kev":false}],"package":"PyPI:pydantic-ai"}}