CVE-2026-133161: Harness `ToolOutputLimits` ANSI stripping can take quadratic time, blocking the event loop

Published Nov 19, 2026
·
Updated

Summary ui

With stripansi=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 stripansi=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 stripansi 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 stripansi off.

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pydantic-ai-harness to a version that resolves this vulnerability.

    Fixed in 0.70.0
  2. Upgrade

    Upgrade Pydantic AI to a version that resolves this vulnerability.

    Fixed in 2
  3. Configuration

    Leave strip_ansi disabled (False) on ToolOutputLimits.

    Pydantic AI Harness ToolOutputLimits strip_ansi = False

Event History

Nov 19, 2026
CVE Published
via MITRE·02:16 PM
Data Sourced
via MITRE·02:16 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are realistically exposed?

Applications are affected when they enable strip_ansi=True on ToolOutputLimits and run tools whose output can be influenced by an attacker, including shell commands, file reads, fetched pages, or MCP servers. The default setting, strip_ansi=False, is not affected by this condition.

2

What does an attacker need to trigger the denial of service?

An attacker needs to be able to place crafted text into content returned by a tool. Output containing many unterminated ANSI escape sequences can cause ANSI stripping to consume quadratic time on the event loop.

3

Do ToolOutputLimits size limits prevent exploitation?

No. ANSI stripping occurs on the event loop before the capability reduces the output, so the capability's output-size limits do not bound the expensive processing.

4

What can be done if an upgrade is not immediately possible?

Leave strip_ansi disabled, which is its default value. For Pydantic AI v1, the harness cannot be upgraded beyond 0.4.0; move to Pydantic AI v2 with pydantic-ai-harness 0.70.0, or keep strip_ansi off.

5

What version contains the fix?

Upgrade pydantic-ai-harness to version 0.70.0 or later.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203