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

CVE-2026-46678: Pydantic AI: SSRF cloud-metadata blocklist bypass via IPv4-mapped IPv6 (Incomplete fix of CVE-2026-25580)

mediumCVSS 3.1 6.8GHSA-cqp8-fcvh-x7r3

Pydantic AI's cloud-metadata blocklist can be bypassed by writing the metadata IP in an IPv6 transition form, when an app opts a URL into `force_download='allow-local'`. The request then reaches the cloud metadata service and can return short-term IAM credentials. This is an incomplete fix of CVE-2026-25580. Upgrade to 1.99.0.

Published May 21, 2026 · Analysis Oct 26, 2026

What an attacker can do

force_download='allow-local' on a FileUrl type (ImageUrl, AudioUrl, VideoUrl, DocumentUrl) turns off the default block on private and internal IPs. The earlier advisory promised that cloud metadata endpoints stay blocked even then. That promise failed for IPv6-encoded forms: IPv4-mapped IPv6, 6to4 and NAT64. Dual-stack and translated networks route the IPv6 wrapper to the real IPv4 metadata endpoint (CWE-918).

The attacker needs the application to have opted into allow-local for a URL that untrusted input can influence, such as a file URL a user supplies to an agent. They supply a URL that points to the metadata service in IPv6 form. The server fetches it and the response can contain cloud IAM short-term credentials.

The maintainers rate the attack complexity as high, narrower than the parent flaw, because of that opt-in. Applications are not affected if they take user input through the bundled integrations, which do not pass force_download from external data: Agent.to_web and clai web, VercelAIAdapter, and AGUIAdapter or Agent.to_ag_ui. Apps that download only from developer-controlled URLs are also not affected.

Who is affected

The pydantic-ai and pydantic-ai-slim packages, from 1.56.0 up to but not including 1.99.0. You are exposed only if code passes force_download='allow-local' on a FileUrl whose URL can come from untrusted input. Check:

pip show pydantic-ai pydantic-ai-slim

Then search your code:

grep -rn "allow-local" .

If nothing matches, the vulnerable path is not used.

pydantic-ai

Ecosystem
PyPI
Affected
>= 1.56.0, < 1.99.0
Fixed in
1.99.0
Check
pip show pydantic-ai

pydantic-ai-slim

Ecosystem
PyPI
Affected
>= 1.56.0, < 1.99.0
Fixed in
1.99.0
Check
pip show pydantic-ai-slim

How to fix it

Upgrade to 1.99.0 or later, for both packages:

pip install --upgrade 'pydantic-ai>=1.99.0'

Use pydantic-ai-slim>=1.99.0 if that is what you install. The cloud-metadata and private-IP blocklists now cover IPv6 transition forms that route to a blocked IPv4 endpoint: IPv4-mapped IPv6, 6to4 and the NAT64 well-known prefix. They are also extended to more IANA-reserved IPv4 and IPv6 special-purpose ranges.

Workaround for unpatched versions: do not pass force_download='allow-local' on any URL that untrusted input can influence. If you must, resolve the hostname yourself and check the result against your own blocklist, including IPv6-encoded forms, before you build the FileUrl.

How to tell if you were hit

Search outbound request logs from the application for connections to the cloud metadata address in any form, including IPv6 wrappers such as ::ffff:169.254.169.254. Check cloud audit logs for use of the instance role's credentials from addresses outside your own network. Check application logs for FileUrl values with unusual IPv6 hostnames. Enforcing IMDSv2 and limiting the instance role reduce the damage if a request got through.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

When 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.

This is an incomplete fix of GHSA-2jrp-274c-jhv3 / 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.

Severity

Same 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.

Who Is Affected

Applications 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.

Applications 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:

  • Agent.to_web / clai web
  • VercelAIAdapter
  • AGUIAdapter / Agent.to_ag_ui

Applications that only download from developer-controlled URLs are not affected.

Remediation

Upgrade 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.

Workaround for Unpatched Versions

Avoid 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.

Credits

Reported by [j0hndo](mailto:[email protected]).

Credited to j0hndo.

Questions

Is my app affected if I do not use allow-local?

No. The bypass only matters when an app explicitly sets force_download='allow-local' on a URL that untrusted input can influence.

Does `Agent.to_web` or the Vercel adapter expose me?

No. The advisory says the bundled integrations (Agent.to_web and clai web, VercelAIAdapter, AGUIAdapter) do not propagate force_download from external data.

Which version fixes CVE-2026-46678?

pydantic-ai and pydantic-ai-slim 1.99.0. Versions from 1.56.0 up to 1.99.0 are affected.

How does it relate to CVE-2026-25580?

It is an incomplete fix of that SSRF. The earlier remediation guaranteed that cloud metadata endpoints are always blocked, but IPv6-encoded forms slipped through.

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