Skip to content
Heist/ feed
Back to feed
High

Pydantic AI affected by Stored XSS via Path Traversal in Web UI CDN URL

Type: advisorySources: OSV

Pydantic AI is a Python agent framework for building applications and workflows with Generative AI. From 1.34.0 to before 1.51.0, a path traversal vulnerability in the Pydantic AI web UI allows an attacker to serve arbitrary JavaScript in the context of the application by crafting a malicious URL. In affected versions, the CDN URL is constructed using a version query parameter from the request URL. This parameter is not validated, allowing path traversal sequences that cause the server to fetch and serve attacker-controlled HTML/JavaScript from an arbitrary source on the same CDN, instead of the legitimate chat UI package. If a victim clicks the link or visits it via an iframe, attacker-controlled code executes in their browser, enabling theft of chat history and other client-side data. This vulnerability only affects applications that use Agent.to_web to serve a chat interface and clai web to serve a chat interface from the CLI. These are typically run locally (on localhost), but may also be deployed on a remote server. This vulnerability is fixed in 1.51.0.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-25640
Confirmed fixed CVEs
Not specified
Updated in this feed
5 Nov 2026, 05:58 UTC · Revision 1

Source evidence

Pydantic AI affected by Stored XSS via Path Traversal in Web UI CDN URL

core-osv · Original source

Published 6 Feb 2026, 20:01 UTC

Pydantic AI is a Python agent framework for building applications and workflows with Generative AI. From 1.34.0 to before 1.51.0, a path traversal vulnerability in the Pydantic AI web UI allows an attacker to serve arbitrary JavaScript in the context of the application by crafting a malicious URL. In affected versions, the CDN URL is constructed using a version query parameter from the request URL. This parameter is not validated, allowing path traversal sequences that cause the server to fetch and serve attacker-controlled HTML/JavaScript from an arbitrary source on the same CDN, instead of the legitimate chat UI package. If a victim clicks the link or visits it via an iframe, attacker-controlled code executes in their browser, enabling theft of chat history and other client-side data. This vulnerability only affects applications that use Agent.to_web to serve a chat interface and clai web to serve a chat interface from the CLI. These are typically run locally (on localhost), but may also be deployed on a remote server. This vulnerability is fixed in 1.51.0.

osv:CVE-2026-25640
Complete source record
{
  "id": "1cffb73119baeb8dc0919a05ff13561218b6eb68a39d1ddddf773db5405a65e9",
  "url": "https://osv.dev/vulnerability/CVE-2026-25640",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Pydantic AI affected by Stored XSS via Path Traversal in Web UI CDN URL",
    "summary": "Pydantic AI is a Python agent framework for building applications and workflows with Generative AI. From 1.34.0 to before 1.51.0, a path traversal vulnerability in the Pydantic AI web UI allows an attacker to serve arbitrary JavaScript in the context of the application by crafting a malicious URL. In affected versions, the CDN URL is constructed using a version query parameter from the request URL. This parameter is not validated, allowing path traversal sequences that cause the server to fetch and serve attacker-controlled HTML/JavaScript from an arbitrary source on the same CDN, instead of the legitimate chat UI package. If a victim clicks the link or visits it via an iframe, attacker-controlled code executes in their browser, enabling theft of chat history and other client-side data. This vulnerability only affects applications that use Agent.to_web to serve a chat interface and clai web to serve a chat interface from the CLI. These are typically run locally (on localhost), but may also be deployed on a remote server. This vulnerability is fixed in 1.51.0.",
    "evidence": "osv:CVE-2026-25640",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2026-25640",
      "aliases": [
        "CVE-2026-25640",
        "GHSA-wjp5-868j-wqv7",
        "PYSEC-2026-2979",
        "PYSEC-2026-2983"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/pydantic/pydantic-ai",
              "type": "GIT",
              "events": [
                {
                  "introduced": "afde1c431371ce24757179ed1cad09af0f382d29"
                },
                {
                  "fixed": "5ab6940f7f0231dc1fc62ab16dea35de018ceebc"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "1.34.0"
                      },
                      {
                        "fixed": "1.51.0"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "fixed": "5ab6940f7f0231dc1fc62ab16dea35de018ceebc"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "v1.51.0"
                  },
                  {
                    "cpe": "cpe:2.3:a:pydantic:pydantic_ai:*:*:*:*:*:python:*:*",
                    "range": [
                      {
                        "introduced": "1.34.0"
                      },
                      {
                        "fixed": "1.51.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v1.50.0",
            "v1.46.0",
            "v1.49.0",
            "v1.48.0",
            "v1.47.0",
            "v1.45.0",
            "v1.44.0",
            "v1.43.0",
            "v1.42.0",
            "v1.41.0",
            "v1.40.0",
            "v1.39.1",
            "v1.39.0",
            "v1.38.0",
            "v1.37.0",
            "v1.36.0",
            "v1.35.0",
            "v1.34.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-25640.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:43.191123138Z",
      "provider": "osv",
      "references": [
        "https://github.com/pydantic/pydantic-ai/releases/tag/v1.51.0",
        "https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-25640.json",
        "https://access.redhat.com/security/cve/CVE-2026-25640",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/25xxx/CVE-2026-25640.json",
        "https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-wjp5-868j-wqv7",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-25640",
        "https://bugzilla.redhat.com/show_bug.cgi?id=2437753"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-22",
          "CWE-79"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/25xxx/CVE-2026-25640.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-25640",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 510898,
  "published_at": "2026-02-06T20:01:53.892+00:00"
}