Pydantic AI fixes two high-severity vulnerabilities in Harness
Start here
Pydantic AI released pydantic-ai-harness 0.70.0, fixing two high-severity vulnerabilities. First, when strip_ansi=True is enabled, the time for ToolOutputLimits to remove ANSI escape sequences grows quadratically with line length; when tool output that an attacker can influence contains hundreds of KB of unterminated escape sequences, it can occupy the event loop for tens of seconds to several minutes. Affected versions are 0.4.0 to 0.69.0. Second, the backtracking time of the jwt mode of secret redaction grows quadratically with text length; processing text that an attacker can influence with this mode of redact_secrets or secret_data() is affected. Affected versions are 0.16.0 to 0.69.0. 0.70.0 also includes new features such as StreamGuardrail streaming segment-by-segment screening and multiple fixes.
Generated by AI from reports · Updated 11 days ago
Attention and developments
Attention, hourly
Now 36, 0% in 24 hours·Peak 36 (Nov 22 22:00)
Latest developments
Progress timeline
- Pydantic AISelectedPydantic AI Harness ANSI stripping vulnerability fix
Pydantic AI's Harness performs ANSI stripping on tool output when strip_ansi=True; the matching pattern used takes time that grows quadratically with line length, so a crafted tool result of a few hundred KB containing many unterminated escape sequences can occupy the event loop for tens of seconds to several minutes, slowing other requests and agent runs in the process. Affected versions are pydantic-ai-harness 0.4.0 to 0.69.0, fixed in 0.70.0. The trigger condition is that strip_ansi is enabled on ToolOutputLimits and the tool output can be influenced by an attacker, such as shell commands, file reads, fetched pages or MCP servers; stripping runs on the event loop before output reduction, so its own size limits cannot constrain it.
- Pydantic AISelectedPydantic AI fixes DoS vulnerability in JWT redaction regex
In a security advisory, Pydantic AI disclosed that the backtracking time of Harness's JWT redaction regex grows quadratically with the length of the scanned text, and that a few hundred KB of crafted text can block the event loop for tens of seconds to several minutes, delaying other requests and agent runs in the same process. Affected versions are pydantic-ai-harness 0.16.0 through 0.69.0, fixed in 0.70.0. It is triggered when an application uses redact_secrets or secret_data() with the jwt pattern, which is included by default, and checks text that an attacker can influence, including user prompts checked by InputGuardrail, tool results checked by ToolGuardrail, and model outputs checked by OutputGuardrail; synchronous guardrails run on the event loop. The mitigation is to upgrade to 0.70.0 or later; until then, secret_data(only=[...]) can be used to explicitly specify the required patterns and exclude the jwt pattern.
- Date not givenPydantic AIPydantic AI v2.70.0 fixes two high-severity vulnerabilities in Harness; malicious input can block the event loop for up to several minutes
Pydantic AI v2.70.0 fixes two high-severity vulnerabilities in Pydantic AI Harness; the fixed version is pydantic-ai-harness 0.70.0. GHSA-m4cr-m4qc-9hh3: when strip_ansi=True, the pattern in ToolOutputLimits that removes ANSI escape sequences has time cost that grows quadratically with line length; tool output that an attacker can influence can contain hundreds of KB of unterminated escape sequences, which can occupy the event loop for tens of seconds to several minutes. GHSA-5m5q-5qj4-gx9h: backtracking in the jwt mode of secret redaction has time cost that grows quadratically with text length; processing attacker-influenceable text with this mode of redact_secrets or secret_data() (included by default) is affected; after the fix, JWTs whose header segment contains -eyJ are no longer matched. The version also includes new features such as StreamGuardrail streaming segment-by-segment screening and multiple fixes.
Related discussion
Attention trend
New sources per day
- Nov 18: 1 new sources (1 outlets, 0 accounts)
- Nov 19: 0 new sources (0 outlets, 0 accounts)
- Nov 20: 0 new sources (0 outlets, 0 accounts)
- Nov 21: 0 new sources (0 outlets, 0 accounts)
- Nov 22: 0 new sources (0 outlets, 0 accounts)
- Nov 23: 0 new sources (0 outlets, 0 accounts)
- Nov 24: 0 new sources (0 outlets, 0 accounts)
- Nov 25: 0 new sources (0 outlets, 0 accounts)
- Nov 26: 0 new sources (0 outlets, 0 accounts)
- Nov 27: 0 new sources (0 outlets, 0 accounts)
- Nov 28: 0 new sources (0 outlets, 0 accounts)
- Nov 29: 0 new sources (0 outlets, 0 accounts)