CVE-2026-25640Pydantic Ai
Medium 5.4 No auth needed
Follow: this CVE · Pydantic · Pydantic Ai We alert you by email or Slack (account required).
- Priority
- 47
- CVSS 3.1
- 5.4
- EPSS
- —
- Auth required
- No
- Published
- Feb 6, 2026
- Updated
- Jul 15, 2026
- Category
- Application · Cross-platform
- SSVC (CISA)
- Exploitation: none · Automatable: no · Technical impact: partial
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
What happens
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.
What to do
- Apply the vendor's security update for Pydantic Ai.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| PyPI | pydantic-ai |
≥ 1.34.0 < 1.51.0 |
1.51.0 |
pip install "pydantic-ai>=1.51.0" |
| PyPI | pydantic-ai |
≥ 1.34.0 < 1.51.0 |
1.51.0 |
pip install "pydantic-ai>=1.51.0" |
| PyPI | pydantic-ai-slim |
≥ 1.34.0 < 1.51.0 |
1.51.0 |
pip install "pydantic-ai-slim>=1.51.0" |
| PyPI | pydantic-ai-slim |
≥ 1.34.0 < 1.51.0 |
1.51.0 |
pip install "pydantic-ai-slim>=1.51.0" |
Per OSV / GitHub Advisories (GHSA-wjp5-868j-wqv7, PYSEC-2026-2979, PYSEC-2026-2983). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| pydantic | pydantic_ai | ≥ 1.34.0 < 1.51.0 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Product Release Notes
- github.com Vendor Advisory
- access.redhat.com
- bugzilla.redhat.com
- security.access.redhat.com