Skip to main content

CVE-2026-107295: CWE-352: Cross-Site Request Forgery (CSRF) in pydantic pydantic-ai

0
High
Published: 10/08/2026 (10/08/2026, 17:16:36 UTC)
Source: CVE Database V5
Vendor/Project: pydantic
Product: pydantic-ai

Description

### Summary The Pydantic AI development web chat UI (`Agent.to_web()`, `clai web`) did not check the content type of requests to its chat endpoint. This allowed a website visited by a developer to submit a request to a chat UI running on that developer's machine, causing the served agent to run and to execute its tools with the privileges and credentials of the local process. Binding the web UI to localhost — the default — does not prevent this, because a page open in the developer's browser can reach the loopback address. ### Impact Applications and developers serving an agent through `Agent.to_web()` or `clai web`. The consequences depend on the tools the served agent exposes, and can include data disclosure as well as unwanted tool side effects. Tools marked `requires_approval=True` were not protected either, because the endpoint trusts approval decisions relayed by the client. ### Mitigation Upgrade to a patched version. The chat endpoint now requires `Content-Type: application/json` and rejects other requests before the request body is parsed and before the agent runs. The bundled chat UI already sends this header; scripts and other non-browser clients that call the endpoint directly may need to be updated to send it. If you cannot upgrade, don't run the web UI while browsing untrusted sites, stop it when you aren't using it, and don't serve an agent with side-effecting tools through it. ### Credits - Thai Son Dinh from VinSOC Labs (R&D)

CVSS v3.1

Score 7.6high

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
High
Availability
Low
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:L

Affected software

pydantic

pydantic-ai

Affected versions
>=1.34.0 <1.107.4>=2.0.0b1 <2.28.0

pydantic

pydantic-ai-slim

Affected versions
>=1.34.0 <1.107.4>=2.0.0b1 <2.28.0
pydantic-ai
pkg:pypi/pydantic-ai
Affected versions
>=1.34.0 <1.107.4>=2.0.0b1 <2.28.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 10/08/2026, 17:33:26 UTC

Technical Analysis

The vulnerability CVE-2026-107295 in pydantic-ai is a CSRF issue (CWE-352) affecting the Agent.to_web() and clai chat endpoints due to missing validation of request content-type. This enables a remote attacker to submit crafted requests from a developer's browser to a loopback-hosted chat server, causing the agent to run tools with the local process's privileges and credentials. Additionally, tools requiring approval can be exposed if client-relayed approval decisions are used. The vulnerability affects versions >=1.34.0 <1.107.4 and >=2.0.0b1 <2.28.0 and is resolved in versions 1.107.4 and 2.28.0.

Potential Impact

An attacker can exploit this CSRF vulnerability to execute arbitrary tools with the privileges of the local process running the pydantic-ai agent. This could lead to unauthorized actions and potential compromise of the local environment. The vulnerability also exposes tools that require approval if client-relayed approval is enabled, increasing the risk of unauthorized tool execution. The attack can be performed from a malicious website visited by the developer, leveraging the loopback interface despite localhost binding.

Mitigation Recommendations

This vulnerability is fixed in pydantic-ai versions 1.107.4 and 2.28.0. Users should upgrade to these versions or later to remediate the issue. No additional mitigation is required if the software is updated. Patch status is confirmed fixed in these versions.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-10-07T15:53:23.587Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6ac7d1292cdf04f6562ba9ad

Added to database: 10/08/2026, 17:21:45 UTC

Last enriched: 10/08/2026, 17:33:26 UTC

Last updated: 10/08/2026, 21:48:54 UTC

Views: 7

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 for AI refresh and higher limits.

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

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses