Skip to content
MediumVulnerability

GHSA-fpf4-vwcp-v4hp: Pydantic AI: Event loop blocked by quadratic title extraction in `web_fetch`

Published
Record updated
View JSON
Affected
  • pydantic-ai-slim >= 2.0.0b1, < 2.44.0, fixed in 2.44.0, released September 17, 2026, 21 days before disclosure
  • pydantic-ai-slim >= 1.77.0, < 1.107.6, fixed in 1.107.6, released September 17, 2026, 21 days before disclosure
  • pydantic-ai >= 2.0.0b1, < 2.44.0, fixed in 2.44.0, released September 17, 2026, 21 days before disclosure
  • and 1 more
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.5%

Summary

Pydantic AI's local web-fetch tool (`web_fetch_tool`, also the local fallback for the `WebFetch` capability) runs response decoding, title extraction and HTML-to-markdown conversion on the event loop, where several steps take time that grows quadratically with server-controlled input. An attacker who can steer the agent through untrusted prompts can make it fetch a page of one to two megabytes that blocks the event loop for minutes, stalling other agent runs and requests in the process. The fix is in the upgrade listed below.

Mitigation

Upgrade to a patched version. The title is now found with a single linear scan, the conversion steps run in linear time, and decoding, title extraction and conversion all run in a worker thread. A charset naming a codec that isn't a text encoding, and a page too deeply nested to convert, are reported back to the model as a failed fetch instead of aborting the run; a JSON body too deeply nested to parse is returned as plain text.