check_backtracking
Detect catastrophic regex backtracking (ReDoS) by static analysis and timing adversarial input in a killed child process, reporting exponential patterns with a slow example input.
Instructions
Check a regex for catastrophic backtracking (ReDoS) by analysing AND timing it.
Two stages. Static: finds nested quantifiers like (a+)+, alternation with overlapping branches inside a loop, adjacent overlapping repeats like .., and unanchored leading repeats. Empirical: builds adversarial input for the worst suspects and times it in the real engine in a child process that is KILLED at the time limit. A pattern that hits the limit is reported as exponential, with an example slow input. Static suspicions the probe cannot reproduce are reported as unconfirmed; "no finding" is evidence, not proof.
engine: "python" (default), "javascript", "regex", or "all" for every available engine (V8 and Python's re have different optimisations, so results can differ). timeout_s: time budget per probe run, 0.2-30 (default 3).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flags | No | ||
| engine | No | python | |
| pattern | Yes | ||
| timeout_s | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |