Apex › Security & web

ReDoS — catastrophic regex backtracking

How one regular expression can hang a server. A backtracking engine faced with nested quantifiers like (a+)+ and an almost-matching input tries every way to split the input before failing — exponential work in the input length. Pick a pattern, drag the length, and watch the step count explode for an evil pattern while a safe one stays flat.

More in Security & web