CVE-2026-107289: Pydantic AI: SSRF cloud-metadata blocklist bypass via IPv6 zone identifiers
Summary When an application using Pydantic AI opts a URL into local network access — either a FileUrl with forcedownload='allow-local', or webfetchtool(allowlocalurls=True) — the cloud-metadata blocklist could be bypassed by appending an IPv6 zone identifier to a metadata address (for example fd00:ec2::254%251).
Published Oct 8, 2026
Affected packages
pydantic-ai
- Ecosystem
- PyPI
- Affected
- >= 1.56.0, < 1.107.6
- Fixed in
- 1.107.6
- Check
pip show pydantic-ai
pydantic-ai
- Ecosystem
- PyPI
- Affected
- >= 2.0.0b1, < 2.44.0
- Fixed in
- 2.44.0
- Check
pip show pydantic-ai
pydantic-ai-slim
- Ecosystem
- PyPI
- Affected
- >= 1.56.0, < 1.107.6
- Fixed in
- 1.107.6
- Check
pip show pydantic-ai-slim
pydantic-ai-slim
- Ecosystem
- PyPI
- Affected
- >= 2.0.0b1, < 2.44.0
- Fixed in
- 2.44.0
- Check
pip show pydantic-ai-slim
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
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.
Remediation
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.
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.
Credited to euriconicacio.
References
- https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-vmxc-h2x2-jmf3
- https://github.com/pydantic/pydantic-ai/pull/8401
- https://github.com/pydantic/pydantic-ai/pull/8402
- https://github.com/pydantic/pydantic-ai/commit/02157e1b87bd45d3f2e111ce07afdf89f9fb0e5b
- https://github.com/pydantic/pydantic-ai/commit/4da70591460f51a8c4f128eaeef70a33340dbd55
- https://github.com/pydantic/pydantic-ai/releases/tag/v1.107.6
- https://github.com/pydantic/pydantic-ai/releases/tag/v2.44.0
- https://github.com/advisories/GHSA-vmxc-h2x2-jmf3
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. No analysis has been written for this entry yet. 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-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, 2026CVE-2026-107293
Pydantic AI OpenTelemetry instrumentation: retry prompt content is not redacted when `include_content=False`
low2.3Oct 8, 2026
