Intel

AIKIDO-2026-51574

pydantic-ai-slim is vulnerable to Regular Expression Denial of Service (ReDoS)

Regular Expression Denial of Service (ReDoS)GHSA-fpf4-vwcp-v4hp Published 3 days ago

65

Medium Risk

This Affects:

PYTHONpydantic-ai-slim
1.77.0 - 1.107.5
Fixed in 1.107.6
2.0.0 - 2.43.0
Fixed in 2.44.0
Are you affected? Scan for Free

TL;DR

The local web_fetch_tool (also used as the WebFetch capability's fallback) decodes a fetched response, extracts its title with a backtracking regular expression, and converts it to markdown; several of those steps run in time proportional to the square of the input size. A server controlled response of a megabyte or two can block the event loop for minutes, stalling every other coroutine in the process for the duration. The fix bounds and restructures the title extraction and markdown conversion so their running time no longer grows quadratically with response size.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you expose the web_fetch_tool (or the WebFetch capability's local fallback) to fetch content from an untrusted host.

Background info

pydantic-ai-slim is vulnerable to Regular Expression Denial of Service (ReDoS) in versions 1.77.0 - 1.107.5 and 2.0.0 - 2.43.0.

How to fix this

Upgrade the pydantic-ai-slim and/or the pydantic-ai library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform