CVE-2026-107295: CWE-352: Cross-Site Request Forgery (CSRF) in pydantic 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
Affected software
pydantic
pydantic-ai
pydantic
pydantic-ai-slim
pkg:pypi/pydantic-aiRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
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.
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 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.