pydantic-ai: Cross-Site Request Forgery
CVE-2026-107295 is a high-severity cross-site request forgery vulnerability in pydantic-ai from Pydantic, with a CVSS 3.1 base score of 7.6 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, but only if a user takes part, for example by opening a link or file. Affected pydantic-ai versions: >= 1.34.0, < 1.107.4; >= 2.0.0b1, < 2.28.0. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 0.16% chance of exploitation within 30 days, which is low compared with other CVEs.
High severity with no evidence of exploitation so far.
What to do
- Check which version of pydantic-ai you run against the affected versions below, and install the vendor's latest release.
- Read the advisory on github.com for workarounds and exact fixed builds.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
- Because the attack needs a user to take part, warn users about unexpected links and files related to this product until it is patched.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Pydantic | pydantic-ai | >= 1.34.0, < 1.107.4; >= 2.0.0b1, < 2.28.0 | Not stated |
| Pydantic | pydantic-ai-slim | >= 1.34.0, < 1.107.4; >= 2.0.0b1, < 2.28.0 | Not stated |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- RequiredA user must take an action such as opening a file or link.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- LowSome restricted data can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- LowPerformance or availability is reduced.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:L. Scored by CNA (github.com).
Official 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.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Cross-Site Request Forgery
The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.
How developers prevent this class of flaw
- Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, use anti-CSRF packages such as the OWASP CSRFGuard. Another example is the ESAPI Session Management control, which includes a component for CSRF.
- Ensure that the application is free of cross-site scripting issues (CWE-79), because most CSRF defenses can be bypassed using attacker-controlled script.
- Generate a unique nonce for each form, place the nonce into the form, and verify the nonce upon receipt of the form. Be sure that the nonce is not predictable (CWE-330).
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: partial).
- Record last changed materially (score, affected products, status or references).
References
Advisories
Patches and release notes
- github.com/pydantic/pydantic-ai/commit/d2690201a1834005d382dbf5c47e0ed94ef8bf46
- github.com/pydantic/pydantic-ai/commit/dd2abbdfa029c9ad138e7cc0edd2eaeaf9ed69c0
- github.com/pydantic/pydantic-ai/pull/7382Issue Tracking
- github.com/pydantic/pydantic-ai/pull/7383Issue Tracking
- github.com/pydantic/pydantic-ai/releases/tag/v1.107.4Release Notes
- github.com/pydantic/pydantic-ai/releases/tag/v2.28.0Release Notes
Other vulnerabilities in pydantic-ai
- 7.5 High severity
- 8.6 High severity
Recent Cross-Site Request Forgery vulnerabilities
- 8.8 High severity
- 7.1 High severity
- 7.1 High severity
- 8.8 High severity
- 7.1 High severity
- 8.7 High severity
Spotted an error? Tell us.