CVE-2026-46678: Pydantic AI SSRF Cloud-metadata Blocklist Bypass Vulnerability
MODERATECVE-2026-46678 is a MODERATE (CVSS 6.8) ssrf cloud-metadata blocklist bypass vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Pydantic AI libraries in the PyPI ecosystem. The issue involves ssrf cloud-metadata blocklist bypass via ipv4-mapped ipv6 (incomplete fix of cve-2026-25580). Remediation is available by upgrading affected packages to version 1.99.0.
CVE-2026-46678 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-46678
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>=1.99.0
pip install pydantic-ai-slim>=1.99.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show pydantic-ai
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-46678, inspect your installed packages using pip:
pip show pydantic-ai
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.99.0), your application is affected.
Note: The pip show pydantic-ai 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-46678 Affected Pydantic AI Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pydantic-ai
|
PyPI |
≥ 1.56.0
< 1.99.0
|
1.99.0
|
|
pydantic-ai-slim
|
PyPI |
≥ 1.56.0
< 1.99.0
|
1.99.0
|
References
Frequently Asked Questions
What is CVE-2026-46678?
Which Pydantic AI versions are affected?
What version fixes CVE-2026-46678?
Is pydantic-ai affected?
Is pydantic-ai-slim affected?
What is the CVSS score of CVE-2026-46678?
What CWE is associated with CVE-2026-46678?
How can I check PyPI dependencies for CVE-2026-46678?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cqp8-fcvh-x7r3",
"modified" : "2026-05-21T21:35:18Z",
"published" : "2026-05-21T21:35:18Z",
"aliases" : [ "CVE-2026-46678" ],
"summary" : "Pydantic AI: SSRF cloud-metadata blocklist bypass via IPv4-mapped IPv6 (Incomplete fix of CVE-2026-25580)",
"details" : "## Summary\n\nWhen an application using Pydantic AI opts a URL into `force_download='allow-local'` (which disables the default block on private/internal IPs), the cloud-metadata blocklist could be bypassed by encoding the metadata IP in an IPv6 transition form (IPv4-mapped IPv6, 6to4, or NAT64). Dual-stack and translated networks route the IPv6 wrapper to the underlying IPv4 endpoint, exposing cloud IAM short-term credentials.\n\nThis is an incomplete fix of [GHSA-2jrp-274c-jhv3](https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-2jrp-274c-jhv3) / [CVE-2026-25580](https://nvd.nist.gov/vuln/detail/CVE-2026-25580). The parent advisory's remediation guaranteed that \"cloud metadata endpoints are always blocked, even with `allow-local`.\" That guarantee did not hold for IPv6-encoded forms of the metadata IPs.\n\n## Severity\n\nSame impact metrics as the parent CVE, but materially narrower attack surface (AC:H instead of AC:L), because exploitation requires the application to have opted into `allow-local` on a URL influenced by untrusted input.\n\n## Who Is Affected\n\nApplications are affected **only if** they explicitly opt for `FileUrl` (`ImageUrl`, `AudioUrl`, `VideoUrl`, `DocumentUrl`) into `force_download='allow-local'` on a URL that is, or could be, influenced by untrusted input.\n\nApplications are **not** affected if they use any of the bundled integrations to ingest user input, because they do not propagate `force_download` from external data:\n\n- `Agent.to_web` / `clai web`\n- `VercelAIAdapter`\n- `AGUIAdapter` / `Agent.to_ag_ui`\n\nApplications that only download from developer-controlled URLs are not affected.\n\n## Remediation\n\nUpgrade to `1.99.0` or later. The cloud-metadata and private-IP blocklists now apply to IPv6 transition forms that route to a blocked IPv4 endpoint (IPv4-mapped IPv6, 6to4, and NAT64 well-known prefix). The blocklists have also been extended to cover additional IANA-reserved IPv4 and IPv6 special-purpose ranges.\n\n## Workaround for Unpatched Versions\n\nAvoid passing `force_download='allow-local'` on any URL that could be influenced by untrusted input. If developers must, resolve the hostname themselves and validate the result against their own metadata blocklist — including IPv6-encoded forms — before constructing the `FileUrl`.\n\n## Credits\n\nReported by [j0hndo](mailto:dohyun4466@gmail.com).",
"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"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.56.0"
}, {
"fixed" : "1.99.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "pydantic-ai-slim"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.56.0"
}, {
"fixed" : "1.99.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-2jrp-274c-jhv3"
}, {
"type" : "WEB",
"url" : "https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-cqp8-fcvh-x7r3"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pydantic/pydantic-ai"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-918" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-21T21:35:18Z",
"nvd_published_at" : null
}
}