Effective ReDoS Detection by Principled Vulnerability Modeling and Exploit Generation
Authors:
- 1 May 2023
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 2427-2443
Abstract
Regular expression Denial-of-Service (ReDoS) is one kind of algorithmic complexity attack. For a vulnerable regex, attackers can craft certain strings to trigger the super-linear worst-case matching time, which causes denial-of-service to regex engines. Various ReDoS detection approaches have been proposed recently. Among them, hybrid approaches which absorb the advantages of both static and dynamic approaches have shown their performance superiority. However, two key challenges still hinder the effectiveness of the detection: 1) Existing modelings summarize localized vulnerability patterns based on partial features of the vulnerable regex; 2) Existing attack string generation strategies are ineffective since they neglected the fact that non-vulnerable parts of the regex may unexpectedly invalidate the attack string (we name this kind of invalidation as disturbance.)Rengar is our hybrid ReDoS detector with new vulnerability modeling and disturbance free attack string generator. It has the following key features: 1) Benefited by summarizing patterns from full features of the vulnerable regex, its modeling is a more precise interpretation of the root cause of ReDoS vulnerability. The modeling is more descriptive and precise than the union of existing modelings while keeping conciseness; 2) For each vulnerable regex, its generator automatically checks all potential disturbances and composes generation constraints to avoid possible disturbances.Compared with nine state-of-the-art tools, Rengar detects not only all vulnerable regexes they found but also 3 – 197 times more vulnerable regexes. Besides, it saves 57.41% – 99.83% average detection time compared with tools containing a dynamic validation process. Using Rengar, we have identified 69 zero-day vulnerabilities (21 CVEs) affecting popular projects which have more than dozens of millions weekly download count.Keywords
Funding Information
- NCR
This publication has 31 references indexed in Scilit:
- Using Selective Memoization to Defeat Regular Expression Denial of Service (ReDoS)2021
- Complexity vulnerability analysis using symbolic executionSoftware Testing, Verification and Reliability, 2020
- Exploring regular expression comprehension2017
- Symbolic Complexity Analysis Using Context-Preserving Histories2017
- From regexes to parsing expression grammarsScience of Computer Programming, 2014
- Inputs of Coma: Static Detection of Denial-of-Service Vulnerabilities2009
- Exploiting Unix File-System Races via Algorithmic Complexity Attacks2009
- WISE: Automated test generation for worst-case complexity2009
- Memory-Efficient Regular Expression Search Using State Merging2007
- Backtracking Algorithmic Complexity Attacks against a NIDS2006