Summary
Pydantic AI: SSRF cloud-metadata blocklist bypass via IPv6 zone identifiers
When an application using Pydantic AI opts a URL into local network access, either a FileUrl with force_download='allow-local', or web_fetch_tool(allow_local_urls=True), the cloud-metadata blocklist could be bypassed by appending an IPv6 zone identifier to a metadata address (for example fd00:ec2::254%251). The host ignores the zone identifier on a destination that is not link-local and delivers the request to the metadata endpoint anyway, exposing cloud IAM short-term credentials.
This is an incomplete fix of GHSA-cqp8-fcvh-x7r3 / CVE-2026-46678 and GHSA-cg7w-rg45-pc59 / CVE-2026-48782, themselves follow-ups to CVE-2026-25580. The parent advisory's remediation guaranteed that cloud metadata endpoints are always blocked, even with local access allowed. That guarantee did not hold for zone-scoped spellings of the IPv6 metadata endpoints.
Details
The cloud-metadata guard compared IPv6 addresses against its blocklist by set membership. Python includes the zone identifier in IPv6Address equality and hashing, so a zone-scoped spelling of a blocked address did not match, while the network stack ignores the zone identifier for a destination that is not link-local. The private-range checks, and the IPv4 and transition-form metadata checks, were already unaffected, because they compare by network containment and by packed bytes respectively.
Only the IPv6 cloud metadata endpoints were reachable this way, so the issue requires an IPv6-enabled environment, for example AWS EC2 or EKS with IPv6, GCP IPv6-only instances, or Scaleway.
Who Is Affected
You are affected only if your application opts a URL that is, or could be, influenced by untrusted input into local network access, through either:
- a
FileUrl(ImageUrl,AudioUrl,VideoUrl,DocumentUrl) withforce_download='allow-local'; or web_fetch_tool(allow_local_urls=True), where the model chooses the URL.
Both are off by default.
You are not affected through the FileUrl path if you use any of the bundled integrations to ingest user input, because they do not propagate force_download from external data:
Agent.to_web/clai webVercelAIAdapterAGUIAdapter/Agent.to_ag_ui
web_fetch_tool is configured by your own application, so a client cannot turn on allow_local_urls.
Applications that only download from developer-controlled URLs are not affected.
Workaround for Unpatched Versions
Avoid opting into local network access, force_download='allow-local' or web_fetch_tool(allow_local_urls=True), on any URL that could be influenced by untrusted input. If you must, reject URL hosts containing % before constructing the FileUrl or configuring the tool.
Credits
Reported by @euriconicacio.
Impact
Untrusted input controls the target URL of a server-initiated request, which may reach internal services not otherwise accessible from outside. Typical impact: access to internal metadata services, internal APIs, or cloud credentials.
CVE-2026-107289 has a CVSS score of 6.8 (Medium). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (1.107.6, 2.44.0); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Upgrade to a patched version. The cloud-metadata and private-IP checks now drop an IPv6 zone identifier before evaluating the address, so every blocklist comparison is made on the address itself. A zone identifier is still carried on the connection, so legitimate link-local fetches under local network access continue to work.
Frequently Asked Questions
- What is CVE-2026-107289? CVE-2026-107289 is a medium-severity server-side request forgery (SSRF) vulnerability in pydantic-ai (pip), affecting versions >= 1.56.0, < 1.107.6. It is fixed in 1.107.6, 2.44.0. Untrusted input controls the target URL of a server-initiated request, which may reach internal services not otherwise accessible from outside.
- How severe is CVE-2026-107289? CVE-2026-107289 has a CVSS score of 6.8 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which packages are affected by CVE-2026-107289?
pydantic-ai(pip) (versions >= 1.56.0, < 1.107.6)pydantic-ai-slim(pip) (versions >= 1.56.0, < 1.107.6)
- Is there a fix for CVE-2026-107289? Yes. CVE-2026-107289 is fixed in 1.107.6, 2.44.0. Upgrade to this version or later.
- Is CVE-2026-107289 exploitable, and should I be worried? Whether CVE-2026-107289 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-107289 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-107289?
- Upgrade
pydantic-aito 1.107.6 or later - Upgrade
pydantic-aito 2.44.0 or later - Upgrade
pydantic-ai-slimto 1.107.6 or later - Upgrade
pydantic-ai-slimto 2.44.0 or later
- Upgrade