Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-25640: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in pydantic pydantic-ai

0
High
VulnerabilityCVE-2026-25640cvecve-2026-25640cwe-22cwe-79
Published: Fri Feb 06 2026 (02/06/2026, 20:01:53 UTC)
Source: CVE Database V5
Vendor/Project: pydantic
Product: pydantic-ai

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.

AI-Powered Analysis

AILast updated: 02/06/2026, 20:29:31 UTC

Technical Analysis

Pydantic AI is a Python framework that facilitates building applications and workflows with Generative AI, including a web-based chat UI served via Agent.to_web or the CLI tool clai web. Versions from 1.34.0 up to but not including 1.51.0 contain a path traversal vulnerability (CWE-22) in the construction of the CDN URL used to load JavaScript resources for the chat interface. The vulnerability arises because the version query parameter in the request URL is not properly validated or sanitized, allowing an attacker to inject path traversal sequences (e.g., '../') that cause the server to fetch and serve arbitrary HTML/JavaScript files from the same CDN but outside the intended directory. This enables an attacker to execute arbitrary JavaScript in the victim’s browser context (CWE-79), effectively a stored cross-site scripting attack. Exploitation requires the victim to click a crafted URL or load it in an iframe, leading to execution of attacker-controlled scripts that can steal sensitive client-side data such as chat history. The vulnerability affects both local deployments (commonly on localhost) and potentially remote deployments if the interface is exposed externally. The flaw does not require any authentication or elevated privileges, and the attack complexity is low. The vulnerability was publicly disclosed and assigned CVE-2026-25640 with a CVSS 3.1 score of 7.1, indicating high severity. No known exploits are currently reported in the wild. The issue is resolved in pydantic-ai version 1.51.0 by properly validating and sanitizing the version parameter to prevent path traversal.

Potential Impact

For European organizations using pydantic-ai to deploy Generative AI chat interfaces, this vulnerability poses a significant risk of client-side data compromise. Attackers can steal sensitive chat histories and potentially other browser-stored information, leading to confidentiality breaches. Organizations deploying these interfaces on remote servers face increased risk of targeted attacks, especially if the interface is publicly accessible. The attack can facilitate further social engineering or lateral movement by exposing user interactions and data. Given the growing adoption of AI frameworks in Europe’s tech and research sectors, exploitation could impact intellectual property and user privacy. The vulnerability undermines trust in AI-powered applications and may lead to regulatory repercussions under GDPR if personal data is exposed. Although exploitation requires user interaction, phishing campaigns leveraging this vulnerability could be effective. The lack of known exploits in the wild suggests a window for proactive mitigation. Overall, the impact on confidentiality is high, with limited integrity and availability impact.

Mitigation Recommendations

European organizations should immediately upgrade all pydantic-ai deployments to version 1.51.0 or later to eliminate the vulnerability. For environments where immediate upgrade is not feasible, implement strict input validation and sanitization on the version query parameter at the web server or application proxy level to block path traversal sequences. Restrict access to the chat interface to trusted internal networks or VPNs to reduce exposure. Employ Content Security Policy (CSP) headers to limit the execution of unauthorized scripts in the browser context. Educate users to avoid clicking suspicious links and monitor for phishing attempts leveraging this vulnerability. Conduct regular security audits and penetration tests focusing on web UI components of AI frameworks. Implement logging and alerting for unusual URL requests containing path traversal patterns. Finally, review deployment architectures to minimize exposure of local interfaces on public networks.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-02-04T05:15:41.791Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 69864bcdf9fa50a62f2f48a6

Added to database: 2/6/2026, 8:15:09 PM

Last enriched: 2/6/2026, 8:29:31 PM

Last updated: 2/6/2026, 9:20:48 PM

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats