Validation Is The Cost
A defensive input validator whose worst-case complexity is unbounded with respect to attacker-controlled input, called synchronously on the hot path. The acceptance branch is cheap; the rejection branch requires the matcher to exhaust every possible match attempt before reporting failure. An attacker who can force rejection forces the cost. The validator's defensive purpose and the validator's denial-of-service primitive are the same artifact; the fix usually repairs the matcher's worst case without changing the accepted language.