Skip to content
Pydantic AI·Indexed by this site · Originally published· Event →· Its place in the scan record →SelectedAttention37

Pydantic AI fixes DoS vulnerability in JWT redaction regex

Harness JWT redaction can take quadratic time, blocking the event loop

AI summary

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.

Why it was selected

The advisory lists the affected guardrail paths and fixed versions, so teams using Pydantic AI guardrails to check external text can use it to investigate blocking risks caused by regex backtracking.

Read originalgithub.com