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

L Turoňová, L Holík, I Homoliak, O Lengál… - 31st USENIX Security …, 2022 - usenix.org
31st USENIX Security Symposium (USENIX Security 22), 2022usenix.org
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 (eg,'(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 …
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 (eg,'(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.
usenix.org
Показан е най-добрият резултат за това търсене. Показване на всички резултати