{"id":"CVE-2026-48782","aliases":["CVE-2026-48782","GHSA-cg7w-rg45-pc59","PYSEC-2026-2977","PYSEC-2026-2981"],"related":[],"kind":"vulnerability","state":"published","title":"pydantic-ai: SSRF blocklist bypass via IPv4-compatible, SIIT/IVI, and local NAT64 IPv6 addresses (incomplete fix of CVE-2026-46678)","summary":"Pydantic AI is a Python agent framework for building applications and workflows with Generative AI. In versions 1.56.0 through 1.101.0, 2.0.0b1, and 2.0.0b2, the cloud-metadata blocklist could be bypassed by encoding the metadata IP in an IPv6 transition form that the previous fix, CVE-2026-46678, did not decode, exposing cloud IAM short-term credentials. The previous remediation decoded only IPv4-mapped IPv6, 6to4, and the NAT64 well-known prefix, so the metadata guarantee did not hold for the remaining transition forms: IPv4-compatible IPv6 (::a.b.c.d), the NAT64 RFC 8215 local-use prefix (64:ff9b:1::/48), operator-chosen NAT64 prefixes, and ISATAP. The IPv6 wrapper is then delivered to the underlying IPv4 metadata endpoint. This occurs when an application using Pydantic AI opts a URL into force_download='allow-local' (which disables the default block on private/internal IPs) and runs on a network that actually routes the affected IPv6 transition forms: NAT64-configured networks (IPv6-only or dual-stack-with-NAT64 deployments, including some Kubernetes setups) for the NAT64 variants, or networks with an ISATAP tunnel for ISATAP. A standard dual-stack cloud VM or container does not route these forms and is not affected in practice. The IPv4-compatible and Teredo variants are deprecated and addressed as defense-in-depth. This is an incomplete fix of GHSA-cqp8-fcvh-x7r3 / CVE-2026-46678 (itself a follow-up to CVE-2026-25580). This issue has been fixed in version 2.0.0b3.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Pydantic AI is a Python agent framework for building applications and workflows with Generative AI. In versions 1.56.0 through 1.101.0, 2.0.0b1, and 2.0.0b2, the cloud-metadata blocklist could be bypassed by encoding the metadata IP in an IPv6 transition form that the previous fix, CVE-2026-46678, did not decode, exposing cloud IAM short-term credentials. The previous remediation decoded only IPv4-mapped IPv6, 6to4, and the NAT64 well-known prefix, so the metadata guarantee did not hold for the remaining transition forms: IPv4-compatible IPv6 (::a.b.c.d), the NAT64 RFC 8215 local-use prefix (64:ff9b:1::/48), operator-chosen NAT64 prefixes, and ISATAP. The IPv6 wrapper is then delivered to the underlying IPv4 metadata endpoint. This occurs when an application using Pydantic AI opts a URL into force_download='allow-local' (which disables the default block on private/internal IPs) and runs on a network that actually routes the affected IPv6 transition forms: NAT64-configured networks (IPv6-only or dual-stack-with-NAT64 deployments, including some Kubernetes setups) for the NAT64 variants, or networks with an ISATAP tunnel for ISATAP. A standard dual-stack cloud VM or container does not route these forms and is not affected in practice. The IPv4-compatible and Teredo variants are deprecated and addressed as defense-in-depth. This is an incomplete fix of GHSA-cqp8-fcvh-x7r3 / CVE-2026-46678 (itself a follow-up to CVE-2026-25580). This issue has been fixed in version 2.0.0b3.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nWhen an application using Pydantic AI opts a URL into `force_download='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.\n\n**The bypass is exploitable only in environments whose network actually routes these forms** — NAT64-configured networks (IPv6-only or dual-stack-with-NAT64 deployments, including some Kubernetes setups) for the NAT64 variants, or networks with an ISATAP tunnel for ISATAP. A standard dual-stack cloud VM or container does not route them and is not affected in practice. The IPv4-compatible and Teredo variants are deprecated and addressed as defense-in-depth.\n\nThis is an incomplete fix of [GHSA-cqp8-fcvh-x7r3](https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-cqp8-fcvh-x7r3) / [CVE-2026-46678](https://nvd.nist.gov/vuln/detail/CVE-2026-46678) (itself a follow-up to [CVE-2026-25580](https://nvd.nist.gov/vuln/detail/CVE-2026-25580)). The prior remediation decoded only IPv4-mapped IPv6, 6to4, and the NAT64 well-known prefix; the metadata guarantee did not hold for the remaining transition forms.\n\n## Severity\n\n**MEDIUM** — `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N` = **6.8**\n\nSame impact metrics and narrow attack surface as the parent advisory (AC:H): exploitation requires the application to have opted into `allow-local` on a URL influenced by untrusted input, and the NAT64/ISATAP variants additionally require the deployment network to route those forms.\n\n**CWE-918**: Server-Side Request Forgery (SSRF)\n\n## Affected Versions\n\n| Package | Vulnerable | Patched |\n|---|---|---|\n| `pydantic-ai` | `>= 1.56.0, < 1.102.0`; `>= 2.0.0b1, < 2.0.0b3` | `1.102.0`; `2.0.0b3` |\n| `pydantic-ai-slim` | `>= 1.56.0, < 1.102.0`; `>= 2.0.0b1, < 2.0.0b3` | `1.102.0`; `2.0.0b3` |\n\nThese transition forms have not been decoded since SSRF protection was introduced in `1.56.0`.\n\n## Who Is Affected\n\nUsers are affected **only if** their application explicitly opts a `FileUrl` (`ImageUrl`, `AudioUrl`, `VideoUrl`, `DocumentUrl`) into `force_download='allow-local'` on a URL that is, or could be, influenced by untrusted input.\n\nBeyond that precondition, the affected encodings only reach a metadata endpoint in environments whose network actually routes them. The broadly-routable IPv4-mapped form was addressed in `1.99.0` (CVE-2026-46678); the additional forms addressed here require a **NAT64-configured network** (IPv6-only or dual-stack-with-NAT64 deployments, including some Kubernetes setups) for the NAT64 variants, or an **ISATAP tunnel** for the ISATAP variant. The IPv4-compatible and Teredo forms are deprecated and not routed by modern stacks; they are addressed as defense-in-depth. Most deployments on a standard dual-stack cloud VM or container are therefore not exploitable in practice, but the fix restores the \"always blocked\" guarantee for the environments that are.\n\nUsers 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:\n\n- `Agent.to_web` / `clai web`\n- `VercelAIAdapter`\n- `AGUIAdapter` / `Agent.to_ag_ui`\n\nApplications that only download from developer-controlled URLs are not affected.\n\n## Remediation\n\nUpgrade 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.\n\n## Workaround for Unpatched Versions\n\nAvoid 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`.\n\n## Credits\n\nReported by [@SnailSploit](https://snailsploit.com).","format":"markdown","source":"ghsa"}],"published":"2026-06-16T22:49:26.750Z","modified":"2026-08-06T18:30:13.047Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N","score":6.8,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N","score":6.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N","score":6.8,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N","score":6.8,"rating":"MEDIUM"}],"cwes":["CWE-918"],"affected":[{"ranges":[{"version":">= 1.56.0, < 1.102.0","status":"affected"},{"version":">= 2.0.0b1, < 2.0.0b3","status":"affected"}],"vendor":"pydantic","product":"pydantic-ai","source":"cvelist"},{"ranges":[{"version":">= 2.0.0b1, < 2.0.0b3","status":"affected"},{"version":">= 1.56.0, < 1.102.0","status":"affected"}],"vendor":"pydantic","product":"pydantic-ai-slim","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"1.56.0","status":"affected","fixed":"1.102.0"}],"ecosystem":"PyPI","package":"pydantic-ai-slim","purl":"pkg:pypi/pydantic-ai-slim","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"1.56.0","status":"affected","fixed":"1.102.0"}],"ecosystem":"PyPI","package":"pydantic-ai","purl":"pkg:pypi/pydantic-ai","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.0.0b1","status":"affected","fixed":"2.0.0b3"}],"ecosystem":"PyPI","package":"pydantic-ai","purl":"pkg:pypi/pydantic-ai","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.0.0b1","status":"affected","fixed":"2.0.0b3"}],"ecosystem":"PyPI","package":"pydantic-ai-slim","purl":"pkg:pypi/pydantic-ai-slim","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"1.56.0","fixed":"1.102.0"},{"status":"affected","version":"2.0.0"},{"status":"affected","version":"2.0.0"}],"vendor":"pydantic","product":"pydantic_ai","cpe":"cpe:2.3:a:pydantic:pydantic_ai:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"1.56.0","status":"affected","fixed":"1.102.0"},{"type":"ecosystem","introduced":"2.0.0b1","status":"affected","fixed":"2.0.0b3"}],"ecosystem":"PyPI","package":"pydantic-ai","purl":"pkg:pypi/pydantic-ai","source":"pysec"},{"ranges":[{"type":"ecosystem","introduced":"1.56.0","status":"affected","fixed":"1.102.0"},{"type":"ecosystem","introduced":"2.0.0b1","status":"affected","fixed":"2.0.0b3"}],"ecosystem":"PyPI","package":"pydantic-ai-slim","purl":"pkg:pypi/pydantic-ai-slim","source":"pysec"}],"references":[{"url":"https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-cg7w-rg45-pc59","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pydantic/pydantic-ai/pull/5596","tags":["issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pydantic/pydantic-ai/commit/1add06179ba4de259f7ab977620b697b7209f7e4","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pydantic/pydantic-ai/releases/tag/v1.102.0","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-48782","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pydantic/pydantic-ai","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/pydantic-ai","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-cg7w-rg45-pc59","tags":["advisory"],"sources":["pysec"]},{"url":"https://pypi.org/project/pydantic-ai-slim","tags":["package"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-06-17T14:22:37.373Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-48782","url":"https://www.cve.org/CVERecord?id=CVE-2026-48782","licence":"CVE Terms of Use","modified":"2026-06-17T14:22:48.236Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-cg7w-rg45-pc59","url":"https://github.com/advisories/GHSA-cg7w-rg45-pc59","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:36.056Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-48782","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-48782","licence":"Public domain","modified":"2026-08-06T18:30:13.047Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2977","url":"https://osv.dev/vulnerability/PYSEC-2026-2977","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:36.056Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2981","url":"https://osv.dev/vulnerability/PYSEC-2026-2981","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:36.056Z"}],"updatedAt":"2026-11-25T22:59:24.916Z","epss":{"score":0.00401,"percentile":0.36425,"date":"2026-12-01T12:00:22.000Z"}}