davisjam / vuln-regex-detector

Detect vulnerable regexes in your project. REDOS, catastrophic backtracking.
MIT License
320 stars 29 forks source link

validate: try multiple exploits for poly vulns #41

Closed davisjam closed 6 years ago

davisjam commented 6 years ago

Problem: The detectors are eager to exploit higher-order polynomially vulnerable regexes.

In doing so they may overstep and cause a match, so no backtracking is required.

Example: See discussion in Weideman: https://github.com/NicolaasWeideman/RegexStaticAnalysis/issues/11

Solution: In such a case the lesser polynomials may still be effective. validate-vuln.pl now iterates over the proposed list of pumpPairs and tries pumpPairs 1..$i. If any time out we have a winner.

Fixes: #40

Test:

Misc: