CVE-2026-107292: Pydantic ai The Local Chat Endpoint Does Vulnerability

MODERATE
Advisory Identifier: GHSA-q2xc-rrxj-58x9
CVSS 6.4
CWE-350 CWE-346
Published
Advisory Summary

CVE-2026-107292 is a MODERATE (CVSS 6.4) the local chat endpoint does vulnerability (CWE-350: Reliance on Reverse DNS Resolution for a Security-Critical Action) affecting Pydantic ai libraries in the PyPI ecosystem. The issue involves the local chat endpoint does not validate the `host` header. Remediation is available by upgrading affected packages to version 1.107.5, 2.30.0.

CVE-2026-107292 at a Glance

CVE Identifier CVE-2026-107292
GHSA Identifier GHSA-q2xc-rrxj-58x9
Severity MODERATE
CVSS v3.1 Base Score 6.4
CWE Classification CWE-350: Reliance on Reverse DNS Resolution for a Security-Critical Action
Affected Product Pydantic ai
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.4

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

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
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-107292

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.5
pip install pydantic-ai>=1.107.5
pydantic-ai fixed: 2.30.0
pip install pydantic-ai>=2.30.0
pydantic-ai-slim fixed: 1.107.5
pip install pydantic-ai-slim>=1.107.5
pydantic-ai-slim fixed: 2.30.0
pip install pydantic-ai-slim>=2.30.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-107292, 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.5), 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-350: Reliance on Reverse DNS Resolution for a Security-Critical Action, where the product performs reverse dns resolution on an ip address to obtain the hostname and make a security decision, but it does not properly ensure that the ip address is truly associated with the hostname. 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`) does not validate the `Host` header of incoming requests. A website a developer visits can use DNS rebinding to make requests to a chat UI running on that developer's machine appear same-origin to the browser, causing the served agent to run and to execute its tools with the privileges and credentials of the local process. ### Details Once a name the attacker controls resolves to the loopback address, the browser treats the request as same-origin, so neither an `Origin` check nor a CSRF token constrains it — a same-origin page can read the served UI and any token in it. Binding the web UI to localhost — the default — does not prevent this. ### 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. Current browser protections reduce but do not remove this exposure: Chromium's Local Network Access gates loopback subresource requests, but does not cover top-level navigations, and Safari does not implement it. ### Mitigation Upgrade to `pydantic-ai`/`pydantic-ai-slim` >= 2.30.0, or >= 1.107.5 on the v1 maintenance line. The fix validates the `Host` header and rejects anything other than localhost, a loopback/LAN IP address, or an explicitly allowed host, responding `421 Misdirected Request` otherwise. If you serve the web chat UI under a real hostname — behind a reverse proxy, tunnel, or similar — name it explicitly: ```python app = agent.to_web(allowed_hosts=['ui.example.com']) ```

CVE-2026-107292 Affected Pydantic ai Versions

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

References

Frequently Asked Questions

What is CVE-2026-107292?
CVE-2026-107292 is a security vulnerability in Pydantic ai involving the local chat endpoint does not validate the `Host` header under CWE-350: Reliance on Reverse DNS Resolution for a Security-Critical Action.
Which Pydantic ai versions are affected?
Affected versions include releases prior to 1.107.5, 2.30.0 across affected packages: pydantic-ai, pydantic-ai-slim.
What version fixes CVE-2026-107292?
Upgrading to 1.107.5, 2.30.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.5, 2.30.0. Upgrade your dependency to 1.107.5, 2.30.0 or later.
Is pydantic-ai-slim affected?
Yes, pydantic-ai-slim is affected in releases prior to 1.107.5, 2.30.0. Upgrade your dependency to 1.107.5, 2.30.0 or later.
What is the CVSS score of CVE-2026-107292?
CVE-2026-107292 has a CVSS v3.1 base score of 6.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:H/A:L.
What CWE is associated with CVE-2026-107292?
CVE-2026-107292 is classified under CWE-350: Reliance on Reverse DNS Resolution for a Security-Critical Action (The product performs reverse DNS resolution on an IP address to obtain the hostname and make a security decision, but it does not properly ensure that the IP address is truly associated with the hostname.).
How can I check PyPI dependencies for CVE-2026-107292?
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-q2xc-rrxj-58x9",
  "modified" : "2026-10-08T17:16:39Z",
  "published" : "2026-10-08T17:16:39Z",
  "aliases" : [ "CVE-2026-107292" ],
  "summary" : "Pydantic AI Web chat UI (`Agent.to_web()`, `clai web`): the local chat endpoint does not validate the `Host` header",
  "details" : "### Summary\n\nThe Pydantic AI development web chat UI (`Agent.to_web()`, `clai web`) does not validate the `Host` header of incoming requests. A website a developer visits can use DNS rebinding to make requests to a chat UI running on that developer's machine appear same-origin to the browser, causing the served agent to run and to execute its tools with the privileges and credentials of the local process.\n\n### Details\n\nOnce a name the attacker controls resolves to the loopback address, the browser treats the request as same-origin, so neither an `Origin` check nor a CSRF token constrains it — a same-origin page can read the served UI and any token in it.\n\nBinding the web UI to localhost — the default — does not prevent this.\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.\n\nCurrent browser protections reduce but do not remove this exposure: Chromium's Local Network Access gates loopback subresource requests, but does not cover top-level navigations, and Safari does not implement it.\n\n### Mitigation\n\nUpgrade to `pydantic-ai`/`pydantic-ai-slim` >= 2.30.0, or >= 1.107.5 on the v1 maintenance line.\n\nThe fix validates the `Host` header and rejects anything other than localhost, a loopback/LAN IP address, or an explicitly allowed host, responding `421 Misdirected Request` otherwise. If you serve the web chat UI under a real hostname — behind a reverse proxy, tunnel, or similar — name it explicitly:\n\n```python\napp = agent.to_web(allowed_hosts=['ui.example.com'])\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/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.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pydantic-ai"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0b1"
      }, {
        "fixed" : "2.30.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pydantic-ai-slim"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.34.0"
      }, {
        "fixed" : "1.107.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pydantic-ai-slim"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0b1"
      }, {
        "fixed" : "2.30.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-q2xc-rrxj-58x9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/pull/7437"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/pull/7438"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/commit/394cc1d31656620704a703a2daed752afa5135fe"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/commit/871c7aeec5dfed2138655ccbccbf15c6d763bae7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pydantic/pydantic-ai"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/releases/tag/v1.107.5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/releases/tag/v2.30.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-346", "CWE-350" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-08T17:16:39Z",
    "nvd_published_at" : null
  }
}