All vulnerabilities

PyPI

CVE-2026-133161

Harness `ToolOutputLimits` ANSI stripping can take quadratic time, blocking the event loop

Severity
High 7.5
Published
19 Nov 2026
Last changed
19 Nov 2026
Added to UpHeron
23 Nov 2026
Exploit chance
0.4% in the next 30 daysHigher than 35% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Regular expression denial of service (ReDoS) (CWE-1333)
Attack
Over the network · No login needed · No user action needed
Attacker can
Take it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Sources
CVE Program

Description

With strip_ansi=True, Pydantic AI Harness's ToolOutputLimits capability removes ANSI escape sequences from tool output with a pattern that takes time quadratic in the length of a line. A tool result of a few hundred kilobytes, crafted with many unterminated escape sequences, can occupy the event loop for tens of seconds to minutes, delaying every other request and agent run in the process.

This affects applications that set strip_ansi=True on ToolOutputLimits (named OverflowingToolOutput before 0.13.0) and run tools whose output an attacker can influence, such as shell commands, file reads, fetched pages or MCP servers. Stripping runs on the event loop before the capability reduces the output, so its own size limits do not bound it.

The assumed attacker can place text in content a tool returns.

From the CVE Program.

Workarounds

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. Upgrade to Pydantic AI v2 and pydantic-ai-harness 0.70.0, or leave strip_ansi off.

Workarounds as given by the CVE Program.

Affected software

SoftwareAffected versions
pydantic-ai-harnessPyPI · osv:PyPI:pydantic-ai-harness
  • From 0.4.0 up to 0.69.0

About pydantic-ai-harness

Weekly downloads (PyPI)
1,394,450PyPI Stats, 23 Nov 2026

This is the only vulnerability in pydantic-ai-harness in our list.

References

  • CVE.org https://www.cve.org/CVERecord?id=CVE-2026-133161