Regular Expression Denial of Service Induced by Backreferences
Yichen Liu, Berk Çakar, Aman Agrawal, Minseok Seo, James C. Davis, Dongyoon Lee
摘要
This paper presents the a systematic and theoretical study of denial-of-service vulnerabilities in Regular Expressions with Backreferences (REwB). We introduce the Two-Phase Memory Automaton (2PMFA), an automaton model that precisely captures REwB semantics. Using this model, we derive necessary conditions under which backreferences induce super-linear backtracking runtime, even when sink ambiguity is linear, a regime where existing detectors report no vulnerability. Based on these conditions, we identify three vulnerability patterns and validate them in practice. Using the Snort intrusion detection ruleset, our evaluation identifies 48 previously unknown REwB vulnerabilities with quadratic or worse runtime. We further demonstrate practical exploits against Snort, including slowing rule evaluation by 0.6-1.2 seconds and bypassing alerts by triggering PCRE's matching limit.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
脉络
- Using Selective Memoization to Defeat Regular Expression Denial of Service (ReDoS) 引用了 Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web Servers
- Revealer: Detecting and Exploiting Regular Expression Denial-of-Service Vulnerabilities 引用了 Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web Servers
- Revealer: Detecting and Exploiting Regular Expression Denial-of-Service Vulnerabilities 引用了 SlowFuzz: Automated Domain-Independent Detection of Algorithmic Complexity Vulnerabilities
- Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web Servers 引用了 SlowFuzz: Automated Domain-Independent Detection of Algorithmic Complexity Vulnerabilities
- ReDoSHunter: A Combined Static and Dynamic Approach for Regular Expression DoS Detection 引用了 Using Selective Memoization to Defeat Regular Expression Denial of Service (ReDoS)
- ReDoSHunter: A Combined Static and Dynamic Approach for Regular Expression DoS Detection 引用了 Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web Servers
- ReDoSHunter: A Combined Static and Dynamic Approach for Regular Expression DoS Detection 引用了 SlowFuzz: Automated Domain-Independent Detection of Algorithmic Complexity Vulnerabilities
它引用的 Paper9
- SlowFuzz: Automated Domain-Independent Detection of Algorithmic Complexity VulnerabilitiesTheofilos Petsios, Jason Zhao, Angelos D. Keromytis, Suman JanaCCS 2017 · 214 次引用
- Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web ServersCristian-Alexandru Staicu, Michael PradelUSENIX Security 2018 · 125 次引用
- Using Selective Memoization to Defeat Regular Expression Denial of Service (ReDoS)James C. Davis, Francisco Servant, Dongyoon LeeS&P 2021 · 43 次引用
- Revealer: Detecting and Exploiting Regular Expression Denial-of-Service VulnerabilitiesYinxi Liu, Mingxue Zhang, Wei MengS&P 2021 · 28 次引用
- ReDoSHunter: A Combined Static and Dynamic Approach for Regular Expression DoS DetectionYeting Li, Zixuan Chen, Jialun Cao, Zhiwu Xu 等USENIX Security 2021 · 20 次引用
相关 Paper
- Counting in Regexes Considered Harmful: Exposing ReDoS Vulnerability of Nonbacktracking MatchersLenka Turonová, Lukás Holík, Ivan Homoliak, Ondrej Lengál 等USENIX Security 2022
- Repairing DoS Vulnerability of Real-World RegexesNariyoshi Chida, Tachio TerauchiS&P 2022 · 15 次引用
- Towards an Effective Method of ReDoS Detection for Non-backtracking EnginesWeihao Su, Hong Huang, Rongchen Li, Haiming Chen 等USENIX Security 2024 · 4 次引用
- Regulator: Dynamic Analysis to Detect ReDoSRobert McLaughlin, Fabio Pagani, Noah Spahn, Christopher Kruegel 等USENIX Security 2022
- Effective ReDoS Detection by Principled Vulnerability Modeling and Exploit GenerationXinyi Wang, Cen Zhang, Yeting Li, Zhiwu Xu 等S&P 2023
