CVE-2026-54249: Pydantic AI: Unvalidated UploadedFile references in UI adapters allow server-side file access using the application's credentials
Pydantic AI's UI adapters, such as the Vercel AI adapter, forward `UploadedFile` references from client-submitted message history without validating them. A client can name a file in the application's model-provider or cloud-storage account, and the provider fetches it with the server's credentials. Fixed in 1.106.0 and 2.0.0b6.
Published Aug 13, 2026 · Updated Oct 22, 2026 · Analysis Oct 25, 2026
What an attacker can do
UI adapters rebuild file parts from message history that the browser sends. File URL parts are checked against a scheme allowlist. UploadedFile parts are not. They point at a file by provider file ID or by a storage URI like s3://... or gs://....
The model provider resolves such a reference with the server-side identity: an IAM role, a service account or the provider API key. The client's own rights do not matter. A client that puts a chosen UploadedFile into its history makes the application's credentials fetch that object. The file content reaches the model, and so the client, through the model's answer. The objects can belong to the application's own account or to other tenants.
The attacker must know a valid identifier. The advisory says these are not always unguessable, depending on how the application names objects. That is why the CVSS vector has high complexity.
Only applications that pass untrusted, client-submitted message history to an agent through a UI adapter are exposed. An agent that builds its own messages server-side is not.
Who is affected
PyPI packages pydantic-ai and pydantic-ai-slim, versions >= 1.65.0, < 1.106.0 and >= 2.0.0b1, < 2.0.0b6. You are exposed if you use a UI adapter (the advisory names the Vercel AI adapter) and accept message history from clients. Check the versions:
pip show pydantic-ai pydantic-ai-slimpydantic-ai-slim
- Ecosystem
- PyPI
- Affected
- >= 1.65.0, < 1.106.0
- Fixed in
- 1.106.0
- Check
pip show pydantic-ai-slim
pydantic-ai-slim
- Ecosystem
- PyPI
- Affected
- >= 2.0.0b1, < 2.0.0b6
- Fixed in
- 2.0.0b6
- Check
pip show pydantic-ai-slim
pydantic-ai
- Ecosystem
- PyPI
- Affected
- >= 1.65.0, < 1.106.0
- Fixed in
- 1.106.0
- Check
pip show pydantic-ai
pydantic-ai
- Ecosystem
- PyPI
- Affected
- >= 2.0.0b1, < 2.0.0b6
- Fixed in
- 2.0.0b6
- Check
pip show pydantic-ai
How to fix it
Upgrade to 1.106.0 on the 1.x line, or 2.0.0b6 on the 2.x beta line:
pip install --upgrade "pydantic-ai-slim>=1.106.0"Both releases validate UploadedFile references on client-submitted messages the same way file URLs are validated.
If you cannot upgrade, the advisory gives two workarounds: do not pass untrusted client-submitted message history to the agent, or strip UploadedFile parts from incoming messages before the agent runs.
How to tell if you were hit
Review the message payloads your UI endpoint received for UploadedFile parts, particularly ones with s3:// or gs:// URIs or file IDs that your application did not issue. Compare them with the files you actually created. On the cloud side, check object-access logs (for example S3 or GCS audit logs) for reads by the application's role on objects that do not belong to the requesting user or tenant. Check the model provider's file-access logs for the same.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
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.
Credited to EQSTLab, knm6777.
Questions
- Is this SSRF in the usual sense?
It is classed as CWE-918. The server does not fetch a URL itself. It forwards a reference and the model provider fetches it with the server's credentials.
- Am I affected if I build messages on the server?
The advisory describes apps that pass untrusted client-submitted message history to the agent through a UI adapter. Server-built history does not carry client-chosen references.
- Which versions are patched?
1.106.0 for 1.x and 2.0.0b6 for the 2.x betas, in both
pydantic-aiandpydantic-ai-slim.- Is it exploited in the wild?
No source reports exploitation, and it is not in CISA's KEV catalog.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More Pydantic AI vulnerabilities
All Pydantic AI entriesCVE-2026-107286
Pydantic AI: Concurrency-limited models can keep their slot when a streamed request ends early
high7.5Oct 8, 2026CVE-2026-107287
Pydantic AI: Excessive resource use when local web fetching converts nested HTML
medium6.5Oct 8, 2026CVE-2026-107289
Pydantic AI: SSRF cloud-metadata blocklist bypass via IPv6 zone identifiers
medium6.8Oct 8, 2026CVE-2026-107290
Pydantic AI: Event loop blocked by quadratic title extraction in `web_fetch`
medium6.5Oct 8, 2026CVE-2026-107291
Pydantic AI OpenTelemetry instrumentation: exception events on tool and agent run spans include content when `include_content=False`
low2.3Oct 8, 2026CVE-2026-107292
Pydantic AI Web chat UI (`Agent.to_web()`, `clai web`): the local chat endpoint does not validate the `Host` header
medium6.4Oct 8, 2026
