{"cve":"CVE-2026-25640","nvd":{"published":"2026-02-06T20:16:11.110","modified":"2026-07-15T02:18:55.463","status":"Modified","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_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","score":5.4},"cwes":["CWE-22","CWE-79"],"references":["https://github.com/pydantic/pydantic-ai/releases/tag/v1.51.0","https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-wjp5-868j-wqv7","https://access.redhat.com/security/cve/CVE-2026-25640","https://bugzilla.redhat.com/show_bug.cgi?id=2437753","https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-25640.json"],"products":["pydantic:pydantic_ai"],"source":"nvd","synced_at":"2026-10-19T22:22:27.261130201+00:00"},"epss":{"cve":"CVE-2026-25640","score":0.00377,"percentile":0.317,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-wjp5-868j-wqv7","url":"https://osv.dev/vulnerability/GHSA-wjp5-868j-wqv7","summary":"Pydantic AI has Stored XSS via Path Traversal in Web UI CDN URL","modified":"2026-07-13T16:43:43.442896235Z","packages":[{"ecosystem":"PyPI","name":"pydantic-ai","purl":"pkg:pypi/pydantic-ai","ranges":[">=1.34.0 <1.51.0"],"fixed":["1.51.0"]},{"ecosystem":"PyPI","name":"pydantic-ai-slim","purl":"pkg:pypi/pydantic-ai-slim","ranges":[">=1.34.0 <1.51.0"],"fixed":["1.51.0"]}]},{"id":"PYSEC-2026-2979","url":"https://osv.dev/vulnerability/PYSEC-2026-2979","summary":"Pydantic AI has Stored XSS via Path Traversal in Web UI CDN URL","modified":"2026-07-13T16:43:43.442896235Z","packages":[{"ecosystem":"PyPI","name":"pydantic-ai","purl":"pkg:pypi/pydantic-ai","ranges":[">=1.34.0 <1.51.0"],"fixed":["1.51.0"]}]},{"id":"PYSEC-2026-2983","url":"https://osv.dev/vulnerability/PYSEC-2026-2983","summary":"Pydantic AI has Stored XSS via Path Traversal in Web UI CDN URL","modified":"2026-07-13T16:43:43.442896235Z","packages":[{"ecosystem":"PyPI","name":"pydantic-ai-slim","purl":"pkg:pypi/pydantic-ai-slim","ranges":[">=1.34.0 <1.51.0"],"fixed":["1.51.0"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}