CVE Watchtower

CVE-2026-133161pydantic-ai-harness Inefficient Regular Expression Complexity

NVDCVSS scored by 7cec5f2f-3032-4006-8740-31f605ffab5f

Vulnerability Summary

### Summary ui

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.

### Details

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.

### 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. Upgrade to Pydantic AI v2 and `pydantic-ai-harness` 0.70.0, or leave `strip_ansi` off.
Severity Level
HIGH(7.5)
Published Date
Nov 19, 2026
Last Modified
Nov 23, 2026
Exploitation Status
No confirmed exploitation yet
EPSS Score (30-Day)
0.41%Probability
Root Weakness (CWE)
The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles.
CVSS v3.1 Base Metrics — Score 7.5 (HIGH)
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Attack VectorNetwork
Attack ComplexityLow
Privileges RequiredNone
User InteractionNone
ScopeUnchanged
ConfidentialityNone
IntegrityNone
AvailabilityHigh

Affected & Patched Versions

Affected Versions
  • pydantic-ai-harness >= 0.4.0 and <= 0.69.0
Patched Versions
  • pydantic-ai-harness 0.69.0

What to do

Plan remediation soon. No exploitation is confirmed yet, but the severity is high.

  1. Check whether you run pydantic-ai-harness and which version.
  2. Update to a patched version listed above, then confirm the new version.

Timeline

  • Nov 19, 2026Published
  • Nov 23, 2026Record last modified

Score, severity and exploitation changes are tracked from the day Watchtower started logging them.

Get notified about new pydantic-ai-harness CVEsYou are reading CVE-2026-133161. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alerts

Data last checked: Nov 24, 2026 07:07 UTC