CVE-2026-107290: Pydantic AI Event Loop Blocked by Quadratic Title Extraction in web_fetch
Summary
CVE-2026-107290: Pydantic AI: Event loop blocked by quadratic title extraction in web_fetch. Affects pydantic-ai across 2 version ranges.
>= 1.77.0, < 1.107.6
>= 2.0.0b1, < 2.44.0
Fixed in 1.107.6 or 2.44.0, depending on the release line you run. How to fix ↓
Also tracked for
- pydantic-ai-slim · PyPI
The same CVE-2026-107290 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Pydantic AI is a Python library designed for data validation and settings management using Python type annotations. It provides a powerful and flexible way to define data models and validate data, making it widely used in applications that require data integrity. However, a recent vulnerability has been identified in its local web-fetch tool, which can lead to significant performance issues when processing server-controlled inputs.
Vulnerability Detail
The vulnerability arises from the local web-fetch tool's handling of responses, where the processing time grows quadratically with the size of certain inputs. This includes decoding the response body, extracting the page title using a backtracking regular expression, and converting HTML to markdown. An attacker can exploit this by sending a large response, causing the event loop to be blocked for an extended period, which stalls other coroutines and affects application availability. The issue is exacerbated by the use of inefficient regex patterns and the potential for deep recursion in HTML-to-markdown conversion, leading to application crashes.
How To Fix
Latest published version: 2.60.0 as of 23 Oct 2026
pip install --upgrade "pydantic-ai==2.60.0"
Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.
If you can't move to the latest
The minimum fixed version depends on the release line you run.
-
>= 1.77.0, < 1.107.61.107.6pip install --upgrade "pydantic-ai==1.107.6" -
>= 2.0.0b1, < 2.44.02.44.0pip install --upgrade "pydantic-ai==2.44.0"
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
As a temporary workaround, avoid exposing the local web-fetch tool to untrusted inputs. Implement strict input validation and limit the size of responses that can be processed by the tool.
Conclusion
The CVE-2026-107290 vulnerability in Pydantic AI poses a significant risk to applications that utilize the local web-fetch tool with untrusted inputs. By upgrading to the patched versions and implementing proper input validation, developers can mitigate the risks associated with this vulnerability.
See every vulnerability recorded for pydantic-ai →
FAQ
The vulnerability is an availability issue caused by quadratic processing time in the web-fetch tool, which can be exploited by sending large server-controlled responses.
If your application uses the local web-fetch tool or the WebFetch capability's local fallback and processes untrusted inputs, it may be affected by this vulnerability.
Exploiting this vulnerability can lead to significant delays in processing requests, affecting the overall performance and availability of your application.
Yes, you can use Vulert to monitor and alert in real-time for open-source vulnerabilities in your software. It requires only the Pipfile.lock to function.
Yes, you can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.
References
Related vulnerabilities
Recent vulnerabilities recorded for pydantic-ai.