Publication Details

Counting in Regexes Considered Harmful: Exposing ReDoS Vulnerability of Nonbacktracking Matchers

HOLÍKOVÁ Lenka, HOLÍK Lukáš, HOMOLIAK Ivan, LENGÁL Ondřej, VEANES Margus and VOJNAR Tomáš. Counting in Regexes Considered Harmful: Exposing ReDoS Vulnerability of Nonbacktracking Matchers. In: Proceedings of the 31st USENIX Security Symposium. Boston, MA: USENIX, 2022, pp. 4165-4182. ISBN 978-1-939133-31-1. Available from: https://www.usenix.org/conference/usenixsecurity22/presentation/turonova
Czech title
Čítání v regexech považováno za nebezpečné: Odhalení náchylnosti backtrackovacích regex matcherů na ReDoS útok
Type
conference paper
Language
english
Authors
Holíková Lenka, Ing. (DITS FIT BUT)
Holík Lukáš, doc. Mgr., Ph.D. (DITS FIT BUT)
Homoliak Ivan, Ing., Ph.D. (DITS FIT BUT)
Lengál Ondřej, Ing., Ph.D. (DITS FIT BUT)
Veanes Margus (MSR)
Vojnar Tomáš, prof. Ing., Ph.D. (DITS FIT BUT)
URL
Keywords

redos, counting automata, DFA, regex, denial of service, pattern matching

Abstract

In this paper, we study the performance characteristics of nonbacktracking regex matchers and their vulnerability against ReDoS (regular expression denial of service) attacks. We focus on their known Achilles heel, which are extended regexes that use bounded quantifiers (e.g., (ab){100}). We propose a method for generating input texts that can cause ReDoS attacks on these matchers. The method exploits the bounded repetition and uses it to force expensive simulations of the deterministic automaton for the regex. We perform an extensive experimental evaluation of our and other state-of-the-art ReDoS generators on a large set of practical regexes with a comprehensive set of backtracking and nonbacktracking matchers, as well as experiments where we demonstrate ReDoS attacks on state-of-the-art real-world security applications containing SNORT with Hyperscan and the HW-accelerated regex matching engine on the NVIDIA BlueField-2 card. Our experiments show that bounded repetition is indeed a notable weakness of nonbacktracking matchers, with our generator being the only one capable of significantly increasing their running time.

Published
2022
Pages
4165-4182
Proceedings
Proceedings of the 31st USENIX Security Symposium
Conference
31st USENIX Security Symposium --- USENIX-Security'22, Boston, US
ISBN
978-1-939133-31-1
Publisher
USENIX
Place
Boston, MA, US
UT WoS
000855237506015
EID Scopus
BibTeX
@INPROCEEDINGS{FITPUB12708,
   author = "Lenka Hol\'{i}kov\'{a} and Luk\'{a}\v{s} Hol\'{i}k and Ivan Homoliak and Ond\v{r}ej Leng\'{a}l and Margus Veanes and Tom\'{a}\v{s} Vojnar",
   title = "Counting in Regexes Considered Harmful: Exposing ReDoS Vulnerability of Nonbacktracking Matchers",
   pages = "4165--4182",
   booktitle = "Proceedings of the 31st USENIX Security Symposium",
   year = 2022,
   location = "Boston, MA, US",
   publisher = "USENIX",
   ISBN = "978-1-939133-31-1",
   language = "english",
   url = "https://www.fit.vut.cz/research/publication/12708"
}
Back to top