pydantic-ai: SSRF blocklist bypass via IPv4-compatible, SIIT/IVI, and local NAT64 IPv6 addresses (incomplete fix of CVE-2026-46678)
CVE-2026-48782 · GHSA-cg7w-rg45-pc59 · published 2026-06-26
- Severity
- Medium
- CVSS score
- 6.8
- Chance of exploitation (EPSS)
- 0.40%
- Fixed in
- 2.0.0b3
- Exploitation No known exploitation
- Automatable No
- Technical impact Partial
- CISA SSVC
When an application using Pydantic AI opts a URL into forcedownload='allow-local' (which disables the default block on private/internal IPs) and runs on a network that routes the affected IPv6 transition forms (NAT64- or ISATAP-configured networks), the cloud-metadata blocklist could be bypassed by encoding the metadata IP in an IPv6 transition form that the previous fix did not decode — IPv4-compatible IPv6 (::a.b.c.d), the NAT64 RFC 8215 local-use prefix (64:ff9b:1::/48), operator-chosen NAT64 prefixes, or ISATAP. The IPv6 wrapper is then delivered to the underlying IPv4 metadata endpoint, exposing cloud IAM short-term credentials.
Upgrade pydantic-ai to 2.0.0b3 or later, and pydantic-ai-slim to 2.0.0b3 or later. If you start it from an MCP config with npx or uvx, pin that version so an old cached copy is not used.
Upgrade to 1.102.0 or later (or 2.0.0b3 or later on the 2.0 pre-release line). The cloud-metadata and private-IP blocklists now decode the embedded IPv4 of every standardized IPv6 transition form before evaluating it — IPv4-mapped, IPv4-compatible, 6to4, NAT64 across all prefix lengths (including the RFC 8215 local-use prefix and operator-chosen prefixes), ISATAP, and Teredo. The set of always-blocked cloud metadata/credential endpoints has also been expanded across providers.
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 transition forms — before constructing the FileUrl.
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| pydantic-ai | PyPI | >= 1.56.0, < 1.102.0 | 1.102.0 |
| pydantic-ai | PyPI | >= 2.0.0b1, < 2.0.0b3 | 2.0.0b3 |
| pydantic-ai-slim | PyPI | >= 1.56.0, < 1.102.0 | 1.102.0 |
| pydantic-ai-slim | PyPI | >= 2.0.0b1, < 2.0.0b3 | 2.0.0b3 |
- CriticalMLflow: Unauthenticated full-read SSRF in webhook delivery: _validate_webhook_url bypassed via unvalidated HTTP redirects (and DNS rebindingmlflowExploited
- Critical@zereight/mcp-gitlab Vulnerable to Server-Side Request Forgery@zereight/mcp-gitlab
- CriticalSSRF + LLM API key exfiltration via user-controlled basepath / baseUrl in 8 chat-model nodesflowise, flowise-components
- CriticalLocalAI POST /models/apply permits unauthenticated server-side request forgery through gallery URLsgithub.com/mudler/LocalAI
- CriticalFastMCP OpenAPI Provider has an SSRF & Path Traversal Vulnerabilityfastmcp
- CriticalBentoML SSRF Vulnerability in File Upload Processingbentoml
- HighPydantic AI: Concurrency-limited models can keep their slot when a streamed request ends earlypydantic-ai, pydantic-ai-slim
- HighPydantic AI Web chat UI (`Agent.to_web()`, `clai web`): a website visited by the developer can trigger agent runs and server-side tool execupydantic-ai, pydantic-ai, pydantic-ai-slim, pydantic-ai-slim
- HighPydantic AI has Server-Side Request Forgery (SSRF) in URL Download Handlingpydantic-ai, pydantic-ai-slim
- HighPydantic AI has Stored XSS via Path Traversal in Web UI CDN URLpydantic-ai, pydantic-ai-slim
- MediumPydantic AI: Event loop blocked by quadratic title extraction in `web_fetch`pydantic-ai, pydantic-ai, pydantic-ai-slim, pydantic-ai-slim
- MediumPydantic AI Web chat UI (`Agent.to_web()`, `clai web`): the local chat endpoint does not validate the `Host` headerpydantic-ai, pydantic-ai, pydantic-ai-slim, pydantic-ai-slim
The impact, patch and workaround text comes from the advisory, shortened (GitHub Advisory Database, CC BY 4.0). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.