PyPI: pydantic-ai

CVE-2026-25640

Safety vulnerability ID: SFTY-20260206-15384

Safety legacy ID: pyup.io-86134

Affected versions of the pydantic-ai package are vulnerable to Cross-site Scripting (XSS) due to an unvalidated version query parameter being used to build a CDN URL. In the Pydantic AI web UI served via Agent.to_web or clai web, the server constructs the frontend fetch URL from the request’s version parameter without neutralizing path traversal sequences, allowing it to retrieve and serve attacker-controlled HTML/JavaScript from another path on the same CDN instead of the intended UI bundle.

Created at: May 22, 2026Updated at: May 22, 2026

Overview

Pydantic AI has Stored XSS via Path Traversal in Web UI CDN URL

Advisory

Affected versions of the pydantic-ai package are vulnerable to Cross-site Scripting (XSS) due to an unvalidated version query parameter being used to build a CDN URL. In the Pydantic AI web UI served via Agent.to_web or clai web, the server constructs the frontend fetch URL from the request’s version parameter without neutralizing path traversal sequences, allowing it to retrieve and serve attacker-controlled HTML/JavaScript from another path on the same CDN instead of the intended UI bundle.

Affected Package

Affecting pydantic-ai package, versions
>=1.34.0,<1.51.0

Also affects

---

How to Fix

Upgrade
pydantic-ai
to
1.51.0
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more