CVE-2026-25640
Pydantic AI affected by Stored XSS via Path Traversal in Web UI CDN URL
Also known as GHSA-wjp5-868j-wqv7, PYSEC-2026-2979, PYSEC-2026-2983
Mitigation
- Upgrade pydantic-ai to 1.51.0 or later.
- Upgrade pydantic-ai-slim to 1.51.0 or later.
Who should check
- Projects that depend on PyPI package pydantic-ai (>= 1.34.0, < 1.51.0)
- Projects that depend on PyPI package pydantic-ai-slim (>= 1.34.0, < 1.51.0)
- Anyone running pydantic-ai >= 1.34.0, < 1.51.0
Vulnerability facts
- Affected
- pydantic-ai >= 1.34.0, < 1.51.0; pydantic-ai-slim >= 1.34.0, < 1.51.0
- Fixed in
- 1.51.0
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 7.1 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: None
- User interaction: Required
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: Low
- Availability impact: None
- EPSS
- 0.49% chance of exploitation in 30 days (percentile 35, 2026-11-26)
- CWE
- CWE-22, CWE-79
- 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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| PyPI pydantic-ai | >= 1.34.0, < 1.51.0 | 1.51.0 | osv |
| PyPI pydantic-ai-slim | >= 1.34.0, < 1.51.0 | 1.51.0 | osv |
| pydantic-ai | >= 1.34.0, < 1.51.0 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2026-25640. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2026-25640.md Affected: pydantic-ai >= 1.34.0, < 1.51.0; pydantic-ai-slim >= 1.34.0, < 1.51.0 Fixed in: 1.51.0 Steps: 1. Search this machine and project for pydantic-ai (PyPI), pydantic-ai-slim (PyPI), pydantic-ai: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Other
- https://github.com/pydantic/pydantic-ai/releases/tag/v1.51.0
- 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
- https://github.com/pydantic/pydantic-ai
- https://pypi.org/project/pydantic-ai
- https://pypi.org/project/pydantic-ai-slim
FAQ
Is CVE-2026-25640 being exploited?
There is no confirmed exploitation: CVE-2026-25640 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.49% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2026-25640?
High: CVSS 7.1 (v3.1, scored by CNA). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work.
Which versions are affected by CVE-2026-25640?
pydantic-ai >= 1.34.0, < 1.51.0; pydantic-ai-slim >= 1.34.0, < 1.51.0.
Is there a fix for CVE-2026-25640?
Yes. Fixed in 1.51.0. Upgrade pydantic-ai to 1.51.0 or later. Upgrade pydantic-ai-slim to 1.51.0 or later.
How do I check if I'm affected by CVE-2026-25640?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.