Cross-site Request Forgery (CSRF) Affecting pydantic-ai package, versions [1.34.0,1.107.4)[2.0.0b1,2.28.0)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.16% (5th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-PYDANTICAI-20574181
  • published8 Oct 2026
  • disclosed8 Oct 2026
  • creditThai Son Dinh

Introduced: 8 Oct 2026

NewCVE-2026-107295  (opens in a new tab)
CWE-346  (opens in a new tab)
CWE-352  (opens in a new tab)

How to fix?

Upgrade pydantic-ai to version 1.107.4, 2.28.0 or higher.

Overview

pydantic-ai is an AI Agent Framework, the Pydantic way

Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF) via the post_chat handler in pydantic_ai/ui/_web/api.py, which does not enforce a Content-Type: application/json requirement on the web UI chat endpoint. Because browsers can send CORS-safelisted content types (text/plain, multipart/form-data, application/x-www-form-urlencoded) cross-origin without a preflight, a malicious page visited by a developer running the local web UI can issue a forged POST request to the /chat endpoint. This causes the served agent to execute a run - including any tools it exposes - on behalf of the victim without their knowledge or consent.

CVSS Base Scores

version 4.0
version 3.1