CVE-2026-107287

Pydantic AI: Excessive resource use when local web fetching converts nested HTML

Published Oct 8, 2026 CVSS 3.1 · 6.5 Medium EPSS < 1% KEV · Not listed
Description
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 web_fetch_tool 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.

Analysis

AI-generated

Technical impact

An attacker can supply deeply nested HTML to Pydantic AI’s local web_fetch_tool or its fallback, causing the library to repeatedly reprocess already accumulated text during HTML‑to‑Markdown conversion. This manipulation can exponentially increase intermediate output volume before the model’s returned‑content limit is applied, leading to excessive CPU and memory use. The impact is a denial‑of‑service for the process running the framework. The flaw is a form of Uncontrolled Resource Consumption (CWE‑400) coupled with inefficient looping that resembles a Denial‑of‑Service via resource waste (CWE‑407), and can lead to excessive allocation of resources (CWE‑770).

Affected Systems

The vulnerability affects the Pydantic AI libraries pydantic‑ai and pydantic‑ai‑slim. Versions 1.77.0 through 1.107.6 (inclusive) and any 2.x build prior to 2.52.0 are impacted. Fixed versions are 1.107.7 and 2.52.0 and later releases.

Risk and Exploitability

With a CVSS score of 6.5 the flaw is rated as moderate severity. EPSS data is not available and the issue is not currently catalogued in CISA’s KEV list, indicating limited evidence of widespread exploitation. The likely attack vector involves an attacker who can control the input passed to the local web_fetch_tool or trigger a model‑directed fetch that supplies malicious nested HTML. Because the tool runs in‑process, the attacker can achieve denial of service against the host application without any network interaction, but requires the attacker to deliver the crafted HTML through the application’s fetch interface or by embedding it in a model prompt. The vulnerability’s exploitation does not involve arbitrary code execution or privilege escalation, but it can substantially degrade service availability for the affected process.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Pydantic AI to version 1.107.7 or later, or 2.52.0 or later, where the bug is fixed.
  • If upgrading is not immediately feasible, disable the local web_fetch_tool and its fallback so no HTML is fetched or converted locally.
  • Consider adding limits on HTML nesting depth or guarding the conversion routine to reject unusually deep structures, and monitor the application for abnormal CPU or memory usage that could indicate exploitation.

Generated by OpenCVE AI on October 9, 2026 at 01:42 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-v36g-jcw9-x7cw Pydantic AI: Excessive resource use when local web fetching converts nested HTML
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Pydantic pydantic Ai
CPEs cpe:2.3:a:pydantic:pydantic_ai:*:*:*:*:*:python:*:*
cpe:2.3:a:pydantic:pydantic_ai:*:-:*:*:*:python:*:*
Vendors & Products Pydantic pydantic Ai
Type Values Removed Values Added
First Time appeared Pydantic
Pydantic pydantic-ai
Vendors & Products Pydantic
Pydantic pydantic-ai
Type Values Removed Values Added
Description 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 web_fetch_tool 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.
Title Pydantic AI: Excessive resource use when local web fetching converts nested HTML
Weaknesses CWE-400
CWE-407
References
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H'}

Weaknesses
  • CWE-400

    Uncontrolled Resource Consumption

  • CWE-407

    Inefficient Algorithmic Complexity

  • CWE-770

    Allocation of Resources Without Limits or Throttling

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 14, 2026, 12:58 AM
Reserved
Oct 7, 2026, 3:53 PM
Status
Analyzed
Published
Oct 8, 2026, 4:17 PM
Modified
Oct 14, 2026, 1:17 AM
Severity
Moderate
Public date
Oct 8, 2026, 3:15 PM