pydantic-ai: server-side request forgery
Medium6.8CVE-2026-54249 · Published Aug 13, 2026 · updated Aug 19, 2026
### 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 th...
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| pydantic-ai PyPI | >= 1.65.0, < 1.106.0 | 1.106.0 |
| >= 2.0.0b1, < 2.0.0b6 | 2.0.0b6 |
Details and references
### 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.
- CVSS 3.1
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N
- Severity from
- GitHub (reviewed advisory)
- Weakness
- CWE-918
- Also known as
- CVE-2026-54249, PYSEC-2026-3692, PYSEC-2026-3693
More pydantic-ai advisories
All pydantic-ai| Date | Advisory | Severity | Fixed in |
|---|---|---|---|
| Jun 26 | pydantic-ai: server-side request forgery | Medium6.8 | 1.102.0+1 more |
| May 21 | Pydantic AI: SSRF cloud-metadata blocklist bypass via IPv4-mapped IPv6 (Incomplete fix of CVE-2026-25580) | Medium6.8 | 1.99.0 |
| Feb 6 | Pydantic AI has Stored XSS via Path Traversal in Web UI CDN URL | High7.1 | 1.51.0 |
| Feb 6 | Pydantic AI has Server-Side Request Forgery (SSRF) in URL Download Handling | High8.6 | 1.56.0 |