CVE-2026-107287: Pydantic AI: Excessive resource use when local web fetching converts nested HTML

Published Oct 8, 2026
·
Updated

Summary

Applications using Pydantic AI's local web-fetch tool can experience excessive CPU and memory use when it converts attacker-controlled HTML. An agent must fetch the affected page; provider-native web fetching is not affected.

Details

Nested block elements cause HTML-to-Markdown conversion to reprocess accumulated text at each level and can greatly expand the intermediate output. The response-body limit bounds downloaded bytes, while the returned-content limit is applied only after conversion. On current releases, conversion runs in a worker thread but can still consume substantial resources and delay other work in the process. Older releases performed conversion on the event loop.

Mitigation

Upgrade to a patched release of pydantic-ai or pydantic-ai-slim. If you cannot upgrade yet, avoid using local web fetching for attacker-controlled HTML.

Other sources

Pydantic AI is a Python agent framework for building applications and workflows with Generative AI. From 1.77.0 until 1.107.7 and 2.52.0, the local webfetchtool and the WebFetch local fallback can consume excessive CPU and memory during HTML-to-Markdown conversion of attacker-controlled HTML containing deeply nested block elements. Conversion repeatedly reprocesses accumulated text and can greatly expand intermediate output before the returned-content limit is applied, allowing a model-directed fetch to delay other work in the process. Provider-native web fetching is not affected. This issue is fixed in versions 1.107.7 and 2.52.0.

— MITRE

Affected Software

5 affected componentsFixes available
pypi/pydantic-ai>=1.77.0<1.107.7, >=2.0.0<2.52.0
pip/pydantic-ai-slim>=2.0.0b1<2.52.0
2.52.0
pip/pydantic-ai-slim>=1.77.0<1.107.7
1.107.7
pip/pydantic-ai>=2.0.0b1<2.52.0
2.52.0
pip/pydantic-ai>=1.77.0<1.107.7
1.107.7

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

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

    Fixed in 1.107.7
  3. Upgrade

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

    Fixed in 2.52.0
  4. Upgrade

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

    Fixed in 1.107.7
  5. Upgrade

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

    Fixed in 1.107.7
  6. Upgrade

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

    Fixed in 2.52.0
  7. Compensating control

    Avoid using local web fetching for attacker-controlled HTML until upgrading.

Event History

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

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Deployments using Pydantic AI's local web_fetch_tool or the local fallback of WebFetch are exposed when they fetch attacker-controlled HTML. Provider-native web fetching is not affected.

2

What does an attacker need to trigger the resource exhaustion?

An attacker needs a model-directed fetch to retrieve HTML they control containing deeply nested block elements. No authentication is required, but user interaction is required according to the supplied severity vector.

3

How should this be remediated or mitigated?

Upgrade to Pydantic AI version 1.107.7 or 2.52.0, which contain the fix. If upgrading is not immediately possible, use provider-native web fetching rather than the affected local fetching paths.

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