CVE-2026-107294: Pydantic AI: Unbounded memory use when downloading remote content via web_fetch or FileUrl

Published Oct 8, 2026
·
Updated

Summary

Several remote-content download paths in Pydantic AI buffered the entire HTTP response body into memory before enforcing any size limit. An application that exposes the local web-fetch tool (webfetchtool, or the WebFetch capability's local fallback) to untrusted prompts can be driven to fetch an attacker-chosen URL that streams a very large body, exhausting process memory and crashing the worker. The same unbounded buffering applied to FileUrl media downloads (ImageUrl, DocumentUrl, VideoUrl, AudioUrl).

This is an availability issue only. SSRF protections (scheme allowlist, private-IP and cloud-metadata blocking) are unaffected; there is no confidentiality or integrity impact.

Details

The download helpers read the full response body before applying content-size controls, so an existing text-length limit only truncated after the whole body was already in memory, and media downloads had no wire-level cap at all. A single large response could grow process memory without bound .

Who Is Affected

You are affected if your application registers the local web-fetch tool (or relies on the WebFetch capability's local fallback) and exposes the agent to untrusted prompts, or if it downloads large remote FileUrls influenced by untrusted input. Applications that only fetch developer-controlled URLs are not exposed to the model-chosen attack path.

Remediation

Upgrade to 2.24.0 or later (v2) or 1.107.2 or later (v1). Patched versions enforce a default 50 MiB cap on web-fetch and FileUrl downloads while streaming; pass None to the limit to restore the previous unbounded behavior.

Credits

Identified during internal review of media-download hardening.

Other sources

Pydantic AI is a Python agent framework for building applications and workflows with Generative AI. From 1.77.0 until 1.107.2 and 2.24.0, webfetchtool, the WebFetch local fallback, and remote FileUrl media downloads buffer the complete HTTP response body before enforcing content-size controls. An attacker-influenced URL can stream an arbitrarily large response that exhausts process memory and crashes the worker; affected media types include ImageUrl, DocumentUrl, VideoUrl, and AudioUrl. SSRF protections remain effective, and the impact is limited to availability. This issue is fixed in versions 1.107.2 and 2.24.0.

— MITRE

Affected Software

5 affected componentsFixes available
pypi/pydantic-ai>=1.77.0<1.107.2, <2.24.0
pip/pydantic-ai-slim>=2.0.0b1<=2.23.0
2.24.0
pip/pydantic-ai-slim>=1.77.0<1.107.2
1.107.2
pip/pydantic-ai>=2.0.0b1<=2.23.0
2.24.0
pip/pydantic-ai>=1.77.0<1.107.2
1.107.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/pydantic-ai-slim to a version that resolves this vulnerability.

    Fixed in 2.24.0
  2. Upgrade

    Upgrade pip/pydantic-ai-slim to a version that resolves this vulnerability.

    Fixed in 1.107.2
  3. Upgrade

    Upgrade pip/pydantic-ai to a version that resolves this vulnerability.

    Fixed in 2.24.0
  4. Upgrade

    Upgrade pip/pydantic-ai to a version that resolves this vulnerability.

    Fixed in 1.107.2
  5. Upgrade

    Upgrade Pydantic AI v1 to a version that resolves this vulnerability.

    Fixed in 1.107.2
  6. Upgrade

    Upgrade Pydantic AI v2 to a version that resolves this vulnerability.

    Fixed in 2.24.0

Event History

Oct 8, 2026
CVE Published
via MITRE·04:59 PM
Data Sourced
via MITRE·04:59 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·05:16 PM
Data Sourced
via GitHub·05:16 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via NVD·05:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Applications are affected when they register the local web-fetch tool or use the WebFetch capability's local fallback and expose the agent to untrusted prompts. FileUrl media download paths are also affected for ImageUrl, DocumentUrl, VideoUrl, and AudioUrl.

2

What does an attacker need to trigger the issue?

An attacker needs the ability to cause the application to fetch an attacker-chosen URL. A URL serving a very large streaming response can cause the worker's memory use to grow until the process crashes.

3

Does an existing text-length limit prevent memory exhaustion?

No. The affected download helpers buffered the complete HTTP response before applying the text-length limit, so truncation occurred only after the response had already been held in memory.

4

Does this vulnerability bypass SSRF protections or expose data?

No. Scheme allowlisting and private-IP and cloud-metadata blocking are unaffected, and the reported impact is availability only; there is no stated confidentiality or integrity impact.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203