CVE-2026-54249: Pydantic AI Unvalidated UploadedFile References Vulnerability

MODERATE
Advisory Identifier: GHSA-h7p7-w5gc-xj3w
CVSS 6.8
CWE-918
Published
Advisory Summary

CVE-2026-54249 is a MODERATE (CVSS 6.8) unvalidated uploadedfile references vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Pydantic AI libraries in the PyPI ecosystem. The issue involves unvalidated uploadedfile references in ui adapters allow server-side file access using the application's credentials. Remediation is available by upgrading affected packages to version 1.106.0, 2.0.0b6.

CVE-2026-54249 at a Glance

CVE Identifier CVE-2026-54249
GHSA Identifier GHSA-h7p7-w5gc-xj3w
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Pydantic AI
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.8

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:N/S:C/C:H/I:N/A:N).

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

How to Fix CVE-2026-54249

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-slim fixed: 1.106.0
pip install pydantic-ai-slim>=1.106.0
pydantic-ai-slim fixed: 2.0.0b6
pip install pydantic-ai-slim>=2.0.0b6
pydantic-ai fixed: 1.106.0
pip install pydantic-ai>=1.106.0
pydantic-ai fixed: 2.0.0b6
pip install pydantic-ai>=2.0.0b6
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-slim

How to Check if You Are Affected

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

pip show pydantic-ai-slim

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.106.0), your application is affected.

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. 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 A client that can submit message history to a Pydantic AI UI adapter can reference arbitrary files in the application's model-provider or cloud-storage account. The server forwards the reference to the model provider, which fetches it using the server's own credentials, allowing the client to read files it should not have access to. ### Details UI adapters reconstruct file parts from client-submitted message history and forward them to the model provider. File **URL** parts are validated against a scheme allowlist before being forwarded, but `UploadedFile` references — which point to a file by provider file ID or cloud-storage URI (e.g. `s3://…`, `gs://…`) — were forwarded without validation. Because the provider resolves an `UploadedFile` using the server-side identity (IAM role, service account, or provider API key) rather than the client's, a client that crafts message history containing an attacker-chosen `UploadedFile` can cause the server to read objects belonging to its own account or to other tenants, given a referenceable identifier. ### Impact Applications that pass untrusted client-submitted message history to an agent through a UI adapter (such as the Vercel AI adapter). Exploitation requires the attacker to reference a valid file identifier; depending on how the application names objects, such identifiers are not always unguessable. ### Patches Upgrade to `1.106.0` (1.x) or `2.0.0b6` (the 2.x beta line), which validate `UploadedFile` references on client-submitted messages the same way file URLs are validated. ### Workarounds If users cannot upgrade, do not pass untrusted client-submitted message history to the agent, or strip `UploadedFile` parts from incoming messages before running the agent.

CVE-2026-54249 Affected Pydantic AI Versions

4 component(s)
Fixed Versions:
1.106.02.0.0b6
Product / Package Ecosystem Affected Versions Fixed Version
pydantic-ai-slim
PyPI
≥ 1.65.0
< 1.106.0
1.106.0
pydantic-ai-slim
PyPI
≥ 2.0.0b1
< 2.0.0b6
2.0.0b6
pydantic-ai
PyPI
≥ 1.65.0
< 1.106.0
1.106.0
pydantic-ai
PyPI
≥ 2.0.0b1
< 2.0.0b6
2.0.0b6

References

Frequently Asked Questions

What is CVE-2026-54249?
CVE-2026-54249 is a security vulnerability in Pydantic AI involving Unvalidated UploadedFile references in UI adapters allow server-side file access using the application's credentials under CWE-918: Server-Side Request Forgery (SSRF).
Which Pydantic AI versions are affected?
Affected versions include releases prior to 1.106.0, 2.0.0b6 across affected packages: pydantic-ai-slim, pydantic-ai.
What version fixes CVE-2026-54249?
Upgrading to 1.106.0, 2.0.0b6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pydantic-ai-slim affected?
Yes, pydantic-ai-slim is affected in releases prior to 1.106.0, 2.0.0b6. Upgrade your dependency to 1.106.0, 2.0.0b6 or later.
Is pydantic-ai affected?
Yes, pydantic-ai is affected in releases prior to 1.106.0, 2.0.0b6. Upgrade your dependency to 1.106.0, 2.0.0b6 or later.
What is the CVSS score of CVE-2026-54249?
CVE-2026-54249 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2026-54249?
CVE-2026-54249 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check PyPI dependencies for CVE-2026-54249?
Run the dependency tree command: 'pip show pydantic-ai-slim'. 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-h7p7-w5gc-xj3w",
  "modified" : "2026-08-13T14:16:26Z",
  "published" : "2026-08-13T14:16:26Z",
  "aliases" : [ "CVE-2026-54249" ],
  "summary" : "Pydantic AI: Unvalidated UploadedFile references in UI adapters allow server-side file access using the application's credentials",
  "details" : "### Summary\n\nA client that can submit message history to a Pydantic AI UI adapter can reference arbitrary files in the application's model-provider or cloud-storage account. The server forwards the reference to the model provider, which fetches it using the server's own credentials, allowing the client to read files it should not have access to.\n\n### Details\n\nUI adapters reconstruct file parts from client-submitted message history and forward them to the model provider. File **URL** parts are validated against a scheme allowlist before being forwarded, but `UploadedFile` references — which point to a file by provider file ID or cloud-storage URI (e.g. `s3://…`, `gs://…`) — were forwarded without validation.\n\nBecause the provider resolves an `UploadedFile` using the server-side identity (IAM role, service account, or provider API key) rather than the client's, a client that crafts message history containing an attacker-chosen `UploadedFile` can cause the server to read objects belonging to its own account or to other tenants, given a referenceable identifier.\n\n### Impact\n\nApplications that pass untrusted client-submitted message history to an agent through a UI adapter (such as the Vercel AI adapter). Exploitation requires the attacker to reference a valid file identifier; depending on how the application names objects, such identifiers are not always unguessable.\n\n### Patches\n\nUpgrade to `1.106.0` (1.x) or `2.0.0b6` (the 2.x beta line), which validate `UploadedFile` references on client-submitted messages the same way file URLs are validated.\n\n### Workarounds\n\nIf users cannot upgrade, do not pass untrusted client-submitted message history to the agent, or strip `UploadedFile` parts from incoming messages before running the agent.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pydantic-ai-slim"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.65.0"
      }, {
        "fixed" : "1.106.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pydantic-ai-slim"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0b1"
      }, {
        "fixed" : "2.0.0b6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pydantic-ai"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.65.0"
      }, {
        "fixed" : "1.106.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pydantic-ai"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0b1"
      }, {
        "fixed" : "2.0.0b6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-h7p7-w5gc-xj3w"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-54249"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pydantic/pydantic-ai"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/releases/tag/v1.106.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pydantic/pydantic-ai/releases/tag/v2.0.0b6"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-13T14:16:26Z",
    "nvd_published_at" : "2026-07-29T21:17:47Z"
  }
}