CVE-2026-54249: Pydantic AI Unvalidated UploadedFile References Vulnerability
MODERATECVE-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
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).
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.
pip install pydantic-ai-slim>=1.106.0
pip install pydantic-ai-slim>=2.0.0b6
pip install pydantic-ai>=1.106.0
pip install pydantic-ai>=2.0.0b6
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
CVE-2026-54249 Affected Pydantic AI Versions
4 component(s)| 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?
Which Pydantic AI versions are affected?
What version fixes CVE-2026-54249?
Is pydantic-ai-slim affected?
Is pydantic-ai affected?
What is the CVSS score of CVE-2026-54249?
What CWE is associated with CVE-2026-54249?
How can I check PyPI dependencies for CVE-2026-54249?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}