CVE-2026-107295: Pydantic ai A Website Visited By The Vulnerability

HIGH
Advisory Identifier: GHSA-h4xc-3qfq-jf93
CVSS 7.6
CWE-346 CWE-352
Published
Advisory Summary

CVE-2026-107295 is a HIGH (CVSS 7.6) a website visited by the vulnerability (CWE-346: Origin Validation Error) affecting Pydantic ai libraries in the PyPI ecosystem. The issue involves a website visited by the developer can trigger agent runs and server-side tool execution on the local chat endpoint. Remediation is available by upgrading affected packages to version 1.107.4, 2.28.0.

CVE-2026-107295 at a Glance

CVE Identifier CVE-2026-107295
GHSA Identifier GHSA-h4xc-3qfq-jf93
Severity HIGH
CVSS v3.1 Base Score 7.6
CWE Classification CWE-346: Origin Validation Error
Affected Product Pydantic ai
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:L).

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

How to Fix CVE-2026-107295

To remediate this vulnerability, upgrade all affected Pydantic ai dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pydantic-ai fixed: 1.107.4
pip install pydantic-ai>=1.107.4
pydantic-ai fixed: 2.28.0
pip install pydantic-ai>=2.28.0
pydantic-ai-slim fixed: 1.107.4
pip install pydantic-ai-slim>=1.107.4
pydantic-ai-slim fixed: 2.28.0
pip install pydantic-ai-slim>=2.28.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show pydantic-ai

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-107295, inspect your installed packages using pip:

pip show pydantic-ai

Analyze the terminal output to locate any version of Pydantic ai in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.107.4), your application is affected.

Note: The pip show pydantic-ai command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-346: Origin Validation Error, where the product does not properly verify that the source of data or communication is valid. In Pydantic ai, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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)

CVE-2026-107295 Affected Pydantic ai Versions

4 component(s)
Fixed Versions:
1.107.42.28.0
Product / Package Ecosystem Affected Versions Fixed Version
pydantic-ai
PyPI
≥ 1.34.0
< 1.107.4
1.107.4
pydantic-ai
PyPI
≥ 2.0.0b1
< 2.28.0
2.28.0
pydantic-ai-slim
PyPI
≥ 1.34.0
< 1.107.4
1.107.4
pydantic-ai-slim
PyPI
≥ 2.0.0b1
< 2.28.0
2.28.0

References

Frequently Asked Questions

What is CVE-2026-107295?
CVE-2026-107295 is a security vulnerability in Pydantic ai involving a website visited by the developer can trigger agent runs and server-side tool execution on the local chat endpoint under CWE-346: Origin Validation Error.
Which Pydantic ai versions are affected?
Affected versions include releases prior to 1.107.4, 2.28.0 across affected packages: pydantic-ai, pydantic-ai-slim.
What version fixes CVE-2026-107295?
Upgrading to 1.107.4, 2.28.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pydantic-ai affected?
Yes, pydantic-ai is affected in releases prior to 1.107.4, 2.28.0. Upgrade your dependency to 1.107.4, 2.28.0 or later.
Is pydantic-ai-slim affected?
Yes, pydantic-ai-slim is affected in releases prior to 1.107.4, 2.28.0. Upgrade your dependency to 1.107.4, 2.28.0 or later.
What is the CVSS score of CVE-2026-107295?
CVE-2026-107295 has a CVSS v3.1 base score of 7.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:L.
What CWE is associated with CVE-2026-107295?
CVE-2026-107295 is classified under CWE-346: Origin Validation Error (The product does not properly verify that the source of data or communication is valid.).
How can I check PyPI dependencies for CVE-2026-107295?
Run the dependency tree command: 'pip show pydantic-ai'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-h4xc-3qfq-jf93",
  "modified" : "2026-10-08T17:16:36Z",
  "published" : "2026-10-08T17:16:36Z",
  "aliases" : [ "CVE-2026-107295" ],
  "summary" : "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",
  "details" : "### Summary\n\nThe 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.\n\nBinding 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.\n\n### Impact\n\nApplications 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.\n\n### Mitigation\n\nUpgrade 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.\n\nIf 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.\n\n### Credits\n- Thai Son Dinh from VinSOC Labs (R&D)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pydantic-ai"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.34.0"
      }, {
        "fixed" : "1.107.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pydantic-ai"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0b1"
      }, {
        "fixed" : "2.28.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pydantic-ai-slim"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.34.0"
      }, {
        "fixed" : "1.107.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pydantic-ai-slim"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0b1"
      }, {
        "fixed" : "2.28.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-h4xc-3qfq-jf93"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/pull/7382"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/pull/7383"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/commit/d2690201a1834005d382dbf5c47e0ed94ef8bf46"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/commit/dd2abbdfa029c9ad138e7cc0edd2eaeaf9ed69c0"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pydantic/pydantic-ai"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/releases/tag/v1.107.4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/releases/tag/v2.28.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-346", "CWE-352" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-08T17:16:36Z",
    "nvd_published_at" : null
  }
}