ReScue: crafting regular expression DoS attacks

Y Shen, Y Jiang, C Xu, P Yu, X Ma, J Lu - Proceedings of the 33rd ACM …, 2018 - dl.acm.org
Y Shen, Y Jiang, C Xu, P Yu, X Ma, J Lu
Proceedings of the 33rd ACM/IEEE International Conference on Automated …, 2018dl.acm.org
Regular expression (regex) with modern extensions is one of the most popular string
processing tools. However, poorly-designed regexes can yield exponentially many matching
steps, and lead to regex Denial-of-Service (ReDoS) attacks under well-conceived string
inputs. This paper presents Rescue, a three-phase gray-box analytical technique, to
automatically generate ReDoS strings to highlight vulnerabilities of given regexes. Rescue
systematically seeds (by a genetic search), incubates (by another genetic search), and …
Regular expression (regex) with modern extensions is one of the most popular string processing tools. However, poorly-designed regexes can yield exponentially many matching steps, and lead to regex Denial-of-Service (ReDoS) attacks under well-conceived string inputs. This paper presents Rescue, a three-phase gray-box analytical technique, to automatically generate ReDoS strings to highlight vulnerabilities of given regexes. Rescue systematically seeds (by a genetic search), incubates (by another genetic search), and finally pumps (by a regex-dedicated algorithm) for generating strings with maximized search time. We implemenmted the Rescue tool and evaluated it against 29,088 practical regexes in real-world projects. The evaluation results show that Rescue found 49% more attack strings compared with the best existing technique, and applying Rescue to popular GitHub projects discovered ten previously unknown ReDoS vulnerabilities.
ACM Digital Library