← All advisories
CVE-2026-133161highDenial of service2026-11-19

CVE-2026-133161: Pydantic AI Harness's ToolOutputLimits(strip_ansi=True) can be stalled for minutes by crafted tool output, blocking every agent run in the process (fixed 0.70.0)

With strip_ansi=True, the ToolOutputLimits capability in pydantic-ai-harness strips ANSI escape sequences from tool output with a pattern that takes time quadratic in the line length. A tool result of a few hundred kilobytes with many unterminated escape sequences can hold the event loop for tens of seconds to minutes, delaying every other request and agent run in the process. The attacker only needs to put text into something a tool returns: shell output, a file, a fetched page or an MCP server response. Affects 0.4.0 to 0.69.0; fixed in 0.70.0.

01.

What it is

Stripping runs on the event loop before the capability shortens the output, so its own size limits don't bound the work.

Only applications that set strip_ansi=True on ToolOutputLimits (called OverflowingToolOutput before 0.13.0) are affected; the default is False.

Affected: pydantic-ai-harness >= 0.4.0, <= 0.69.0. Fixed in 0.70.0. On Pydantic AI v1 the harness can't be upgraded past 0.4.0, so v1 users need to move to Pydantic AI v2 or keep strip_ansi off. GitHub published the advisory on 18 November 2026 and the CVE followed on 19 November.

02.

How to check

  1. Run pip show pydantic-ai-harness and check the version.
  2. Search your code for strip_ansi=True on ToolOutputLimits or OverflowingToolOutput.
03.

How to fix

  1. Upgrade to pydantic-ai-harness 0.70.0 or later (needs Pydantic AI v2).
  2. Until then, leave strip_ansi at its default, False.
  3. Run long or untrusted tool calls with timeouts and off the main event loop.
pip show pydantic-ai-harness | grep -i '^version'
grep -rnE 'strip_ansi\s*=\s*True' --include='*.py' .
04.

Sources

More advisories for this tool
The weekly email

One email a week. Only what changed.

Every new security hole in AI coding tools, MCP servers, app builders and the stacks they generate (Next.js, Supabase, Node, PHP), each with how to check your app and the fix. No roundups of things you already read.

Free, one email a week. Read the latest issue first if you like. One-click unsubscribe in every email. We never sell or share addresses.