CVE-2026-107295

`pydantic-ai-slim` web UI `/api/chat` accepts browser-simple cross-origin requests that can trigger agent tool execution

Published Oct 8, 2026 CVSS 3.1 · 7.6 High EPSS < 1% KEV · Not listed
Description
Pydantic AI is a Python agent framework for building applications and workflows with Generative AI. From 1.34.0 until 1.107.4 and 2.28.0, the Agent.to_web() and clai web development chat endpoint has missing request content-type validation. A website visited by a developer can submit a browser-compatible request to a loopback-hosted chat server, causing the served agent to run and execute tools with the privileges and credentials of the local process; client-relayed approval decisions also leave requires_approval=True tools exposed. Binding to localhost does not prevent a browser page from reaching the loopback address. This issue is fixed in versions 1.107.4 and 2.28.0.

Analysis

AI-generated

Technical impact

Pydantic AI’s web UI endpoint at /api/chat lacks allowing a browser-compatible cross‑origin request to reach a locally bound chat server. When a developer visits a malicious site, the browser can send such a request to the loopback address, causing the served agent to invoke tools with the privileges and credentials of the running process. This also exposes tools requiring approval because client‑relayed approval decisions are not validated, permitting the execution of potentially dangerous operations. The vulnerability effectively grants remote code execution on the local machine for an attacker with only a malicious web page in the victim’s browser.

Affected Systems

The issue affects the pydantic‑ai and pydantic‑ai‑slim products from version 1.34.0 up to but not including 1.107.4, and earlier 2.x releases up to but not including 2.28.0. Any installation of these packages within those version ranges is vulnerable. The problem was addressed in releases 1.107.4 and 2.28.0, so upgrading to those or newer versions removes the flaw.

Risk and Exploitability

The CVSS score of 7.6 indicates a high severity, while the EPSS information is unavailable. The attack can be triggered remotely through a web browser and does not require direct access to the host. A vulnerability flag is not listed in CISA’s KEV catalog, but the ease of exploitation and the local privilege escalation make this a critical concern for developers running the framework on local machines.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade pydantic‑ai to version 1.107.4 or later, or to 2.28.0 or newer; this fixes the missing validation.
  • Re‑configure the chat server to listen only on non‑loopback interfaces, or apply firewall rules that block inbound requests to 127.0.0.1.
  • Ensure the /api/chat endpoint requires authentication and enforces a valid Content‑Type header (e.g., application/json) to reject any cross‑origin or malformed requests.

Generated by OpenCVE AI on October 9, 2026 at 03:10 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-h4xc-3qfq-jf93 Pydantic AI Web chat UI (`Agent.to_web()`, `clai web`): a website visited by the developer can trigger agent runs and server-side tool execution on the local chat endpoint
History
Type Values Removed Values Added
First Time appeared Pydantic pydantic Ai
CPEs cpe:2.3:a:pydantic:pydantic_ai:*:*:*:*:*:python:*:*
cpe:2.3:a:pydantic:pydantic_ai:*:-:*:*:*:python:*:*
Vendors & Products Pydantic pydantic Ai
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Pydantic
Pydantic pydantic-ai
Vendors & Products Pydantic
Pydantic pydantic-ai
Type Values Removed Values Added
Description Pydantic AI is a Python agent framework for building applications and workflows with Generative AI. From 1.34.0 until 1.107.4 and 2.28.0, the Agent.to_web() and clai web development chat endpoint has missing request content-type validation. A website visited by a developer can submit a browser-compatible request to a loopback-hosted chat server, causing the served agent to run and execute tools with the privileges and credentials of the local process; client-relayed approval decisions also leave requires_approval=True tools exposed. Binding to localhost does not prevent a browser page from reaching the loopback address. This issue is fixed in versions 1.107.4 and 2.28.0.
Title `pydantic-ai-slim` web UI `/api/chat` accepts browser-simple cross-origin requests that can trigger agent tool execution
Weaknesses CWE-352
References
Metrics cvssV3_1

{'score': 7.6, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:L'}

Weaknesses
  • CWE-346

    Origin Validation Error

  • CWE-352

    Cross-Site Request Forgery (CSRF)

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 8, 2026, 5:53 PM
Reserved
Oct 7, 2026, 3:53 PM
Status
Analyzed
Published
Oct 8, 2026, 5:17 PM
Modified
Oct 13, 2026, 2:16 PM
Severity
Important
Public date
Oct 8, 2026, 5:02 PM