Performance Vulnerability in Pydantic AI Harness Affecting ToolOutputLimits
CVE-2026-133161
What is CVE-2026-133161?
The Pydantic AI Harness's ToolOutputLimits feature, when configured with 'strip_ansi=True', introduces a performance degradation issue. This occurs because the removal of ANSI escape sequences from tool outputs involves a time complexity that grows quadratically with the length of the output line. In scenarios with large outputs designed with multiple unterminated escape sequences, the processing can monopolize the event loop, causing severe delays ranging from seconds to several minutes, which hampers the performance of other requests and agent operations. Applications that allow the manipulation of output through tools, such as shell commands or fetched content, are particularly at risk. It is advised to upgrade to version 0.70.0 of Pydantic AI Harness or maintain the default setting of 'strip_ansi' to mitigate this vulnerability.
Affected Version(s)
pydantic-ai-harness 0.4.0 <= 0.69.0
