PyPI: pydantic-ai

CVE-2026-46678

Safety vulnerability ID: SFTY-20260521-78027

Safety legacy ID: pyup.io-98860

Affected versions of the pydantic-ai package are vulnerable to Server-Side Request Forgery due to the cloud-metadata and private-IP blocklists failing to handle IPv6 transition representations of blocked IPv4 endpoints. When an application opts a FileUrl, ImageUrl, AudioUrl, VideoUrl, or DocumentUrl into force_download='allow-local', the existing blocklist does not recognise IPv4-mapped IPv6 addresses, 6to4 addresses, or the NAT64 well-known prefix that resolve to cloud-metadata IPs on dual-stack or translated networks. An attacker who can influence such a URL with untrusted input can bypass the parent advisory metadata block and retrieve short-term IAM credentials from the cloud-metadata endpoint.

Created at: Jun 4, 2026Updated at: Jun 4, 2026

Overview

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

Advisory

Affected versions of the pydantic-ai package are vulnerable to Server-Side Request Forgery due to the cloud-metadata and private-IP blocklists failing to handle IPv6 transition representations of blocked IPv4 endpoints. When an application opts a FileUrl, ImageUrl, AudioUrl, VideoUrl, or DocumentUrl into force_download='allow-local', the existing blocklist does not recognise IPv4-mapped IPv6 addresses, 6to4 addresses, or the NAT64 well-known prefix that resolve to cloud-metadata IPs on dual-stack or translated networks. An attacker who can influence such a URL with untrusted input can bypass the parent advisory metadata block and retrieve short-term IAM credentials from the cloud-metadata endpoint.

Affected Package

Affecting pydantic-ai package, versions
>=1.56.0,<1.99.0

Also affects

---

How to Fix

Upgrade
pydantic-ai
to
1.99.0
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more