Live threats

All CVEs / Pydantic

CVE-2026-25640Pydantic Ai

Medium 5.4 No auth needed

Priority
47
CVSS 3.1
5.4
EPSS
—
Auth required
No
Published
Feb 6, 2026
Updated
Jul 15, 2026
Category
Application · Cross-platform
Weakness (CWE)
CWE-22, CWE-79
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.

Original NVD text.

What to do

  1. Apply the vendor's security update for Pydantic Ai.
  2. It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.

Affected packages

EcosystemPackageAffected versionsFixed inHow 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)

VendorProductVersions
pydanticpydantic_ai≥ 1.34.0 < 1.51.0

Official sources

References

Links published by the sources. Open them with care.