Skip to content
HighVulnerability

CVE-2026-133161: Pydantic AI Harness ToolOutputLimits ANSI stripping slowed by quadratic regex

Identifier
CVE-2026-133161
Published
Record updated
View JSON
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.

Summary

Pydantic AI Harness's ToolOutputLimits capability, when strip_ansi=True is set (named OverflowingToolOutput before 0.13.0), strips ANSI escape sequences with a pattern whose run time grows quadratically with line length. A few-hundred-kilobyte tool result with many unterminated escape sequences can block the event loop for tens of seconds to minutes, delaying other requests and agent runs in the process. The attacker only needs to place text in content a tool returns, such as shell output, file reads, fetched pages or MCP server responses.

Mitigation

Upgrade pydantic-ai-harness to 0.70.0 or later. Until then, leave strip_ansi at its default, False. On Pydantic AI v1, the harness cannot be upgraded past 0.4.0, so upgrade to Pydantic AI v2 and pydantic-ai-harness 0.70.0, or leave strip_ansi off.