NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Pydantic AI

CVE-2026-107289: Pydantic AI: SSRF cloud-metadata blocklist bypass via IPv6 zone identifiers

mediumCVSS 3.1 6.8GHSA-vmxc-h2x2-jmf3

Pydantic AI's cloud-metadata blocklist can be bypassed by appending an IPv6 zone identifier, such as `fd00:ec2::254%251`, to a metadata address. If an app opts a URL into local network access, the request reaches the metadata endpoint and can expose cloud IAM credentials. Fixed in 1.107.6 (1.x) and 2.44.0 (2.x).

Published Oct 8, 2026 · Analysis Oct 21, 2026

What an attacker can do

The guard compared IPv6 addresses to its blocklist by set membership. Python includes the zone identifier in IPv6Address equality and hashing, so fd00:ec2::254%1 did not match fd00:ec2::254. The network stack ignores the zone on a destination that is not link-local, so the request goes to the metadata service anyway. IPv4 and transition-form checks were not affected.

The flaw is an incomplete fix of earlier SSRF advisories in the same code, whose promise was that cloud metadata endpoints are always blocked even with local access allowed.

The attacker needs influence over a URL that the app opts into local access, and an IPv6-enabled cloud host such as AWS EC2 or EKS with IPv6, GCP IPv6-only instances or Scaleway. They get short-term IAM credentials from the metadata service. Both opt-ins are off by default, and the vector's high complexity reflects that.

Who is affected

Affected: pydantic-ai and pydantic-ai-slim from 1.56.0 up to 1.107.6, and from 2.0.0b1 up to 2.44.0. You are affected only if you use FileUrl types (ImageUrl, AudioUrl, VideoUrl, DocumentUrl) with force_download='allow-local', or web_fetch_tool(allow_local_urls=True), with URLs that untrusted input can influence.

Not affected through FileUrl: Agent.to_web / clai web, VercelAIAdapter and AGUIAdapter, which do not pass force_download from external data.

pip show pydantic-ai pydantic-ai-slim

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

How to fix it

Upgrade to 1.107.6 or 2.44.0. The metadata and private-IP checks now drop the IPv6 zone identifier before evaluating the address, while the zone is still carried on the connection, so legitimate link-local fetches still work.

Without an upgrade, avoid force_download='allow-local' and web_fetch_tool(allow_local_urls=True) on any URL that untrusted input can influence. If you must use them, reject URL hosts containing % before building the FileUrl or configuring the tool.

How to tell if you were hit

Search logs of outbound requests for hosts containing % or IPv6 literals such as fd00:ec2::254. Review cloud audit logs (for example CloudTrail) for use of the instance role's credentials from unexpected places. Check the code for the two opt-in settings above.

Original advisory

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) with force_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 web
  • VercelAIAdapter
  • AGUIAdapter / 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.

Questions

Is my agent affected by default?

No. Both force_download='allow-local' and allow_local_urls=True are off by default, and you need untrusted influence over the URL.

Is an IPv4-only environment safe?

Per the advisory, only the IPv6 metadata endpoints were reachable this way, so it requires an IPv6-enabled environment.

How is this related to CVE-2026-46678?

It is an incomplete fix of that advisory and of CVE-2026-48782, which tried to guarantee that cloud metadata endpoints stay blocked.

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 entries