Regulator: Dynamic Analysis to Detect ReDoS
Robert McLaughlin, Fabio Pagani, Noah Spahn, Christopher Kruegel, Giovanni Vigna
摘要
Regular expressions (regexps) are a convenient way for programmers to express complex string searching logic. Several popular programming languages expose an interface to a regexp matching subsystem, either by language-level primitives or through standard libraries. The implementations behind these matching systems vary greatly in their capabilities and running-time characteristics. In particular, backtracking matchers may exhibit worst-case running-time that is either linear, polynomial, or exponential in the length of the string being searched. Such super-linear worst-case regexps expose applications to Regular Expression Denial-of-Service (Re-DoS) when inputs can be controlled by an adversarial attacker. In this work, we investigate the impact of ReDoS in backtracking engines, a popular type of engine used by most programming languages. We evaluate several existing tools against a dataset of broadly collected regexps, and find that despite extensive theoretical work in this field, none are able to achieve both high precision and high recall. To address this gap in existing work, we develop REGULATOR, a novel dynamic, fuzzer-based analysis system for identifying regexps vulnerable to ReDoS. We implement this system by directly instrumenting a popular backtracking regexp engine, which increases the scope of supported regexp syntax and features over prior work. Finally, we evaluate this system against three common regexp datasets, and demonstrate a seven-fold increase in true positives discovered when comparing against existing tools.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 10 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Towards Efficient Matching of Regexes with Backreferences using Register Set Automata 引用了 Towards an Effective Method of ReDoS Detection for Non-backtracking Engines
- Towards Efficient Matching of Regexes with Backreferences using Register Set Automata 引用了 Improving Developers' Understanding of Regex Denial of Service Tools through Anti-Patterns and Fix Strategies
- Towards Efficient Matching of Regexes with Backreferences using Register Set Automata 引用了 Revealer: Detecting and Exploiting Regular Expression Denial-of-Service Vulnerabilities
- CollAFL: Path Sensitive Fuzzing 引用了 SlowFuzz: Automated Domain-Independent Detection of Algorithmic Complexity Vulnerabilities
- Remote Code Execution from SSTI in the Sandbox: Automatically Detecting and Exploiting Template Escape Bugs 引用了 Revealer: Detecting and Exploiting Regular Expression Denial-of-Service Vulnerabilities
- Remote Code Execution from SSTI in the Sandbox: Automatically Detecting and Exploiting Template Escape Bugs 引用了 Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web Servers
- Towards an Effective Method of ReDoS Detection for Non-backtracking Engines 引用了 Improving Developers' Understanding of Regex Denial of Service Tools through Anti-Patterns and Fix Strategies
- Towards an Effective Method of ReDoS Detection for Non-backtracking Engines 引用了 Revealer: Detecting and Exploiting Regular Expression Denial-of-Service Vulnerabilities
- Towards an Effective Method of ReDoS Detection for Non-backtracking Engines 引用了 Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web Servers
- PufferDoS: Efficient and Effective Attack String Generation for Regular Expression Denial of Service Vulnerabilities 引用了 Towards an Effective Method of ReDoS Detection for Non-backtracking Engines
- PufferDoS: Efficient and Effective Attack String Generation for Regular Expression Denial of Service Vulnerabilities 引用了 Revealer: Detecting and Exploiting Regular Expression Denial-of-Service Vulnerabilities
- PufferDoS: Efficient and Effective Attack String Generation for Regular Expression Denial of Service Vulnerabilities 引用了 SlowFuzz: Automated Domain-Independent Detection of Algorithmic Complexity Vulnerabilities
- Improving Developers' Understanding of Regex Denial of Service Tools through Anti-Patterns and Fix Strategies 引用了 Revealer: Detecting and Exploiting Regular Expression Denial-of-Service Vulnerabilities
- Improving Developers' Understanding of Regex Denial of Service Tools through Anti-Patterns and Fix Strategies 引用了 A Sense of Time for JavaScript and Node.js: First-Class Timeouts as a Cure for Event Handler Poisoning
- Improving Developers' Understanding of Regex Denial of Service Tools through Anti-Patterns and Fix Strategies 引用了 Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web Servers
- Improving Developers' Understanding of Regex Denial of Service Tools through Anti-Patterns and Fix Strategies 引用了 SlowFuzz: Automated Domain-Independent Detection of Algorithmic Complexity Vulnerabilities
- Revealer: Detecting and Exploiting Regular Expression Denial-of-Service Vulnerabilities 引用了 A Sense of Time for JavaScript and Node.js: First-Class Timeouts as a Cure for Event Handler Poisoning
- 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
- A Sense of Time for JavaScript and Node.js: First-Class Timeouts as a Cure for Event Handler Poisoning 引用了 Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web Servers
- Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web Servers 引用了 SlowFuzz: Automated Domain-Independent Detection of Algorithmic Complexity Vulnerabilities
引用它的顶会 Paper10
- Towards an Effective Method of ReDoS Detection for Non-backtracking EnginesWeihao Su, Hong Huang, Rongchen Li, Haiming Chen 等USENIX Security 2024 · 4 次引用
- Towards Efficient Matching of Regexes with Backreferences using Register Set AutomataVojtech Havlena, Lukás Holík, Ondrej Lengál, Jan Vasák 等PLDI 2026
- Remote Code Execution from SSTI in the Sandbox: Automatically Detecting and Exploiting Template Escape BugsYudi Zhao, Yuan Zhang, Min YangUSENIX Security 2023
- PufferDoS: Efficient and Effective Attack String Generation for Regular Expression Denial of Service VulnerabilitiesShangzhi Xu, Ziqi Ding, Xiao Cheng, Yuekang Li 等S&P 2026
- Improving Developers' Understanding of Regex Denial of Service Tools through Anti-Patterns and Fix StrategiesSk Adnan Hassan, Zainab Aamir, Dongyoon Lee, James C. Davis 等S&P 2023
它引用的 Paper7
- CollAFL: Path Sensitive FuzzingShuitao Gan, Chao Zhang, Xiaojun Qin, Xuwen Tu 等S&P 2018 · 426 次引用
- 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 次引用
- A Sense of Time for JavaScript and Node.js: First-Class Timeouts as a Cure for Event Handler PoisoningJames C. Davis, Eric R. Williamson, Dongyoon LeeUSENIX Security 2018 · 54 次引用
- Revealer: Detecting and Exploiting Regular Expression Denial-of-Service VulnerabilitiesYinxi Liu, Mingxue Zhang, Wei MengS&P 2021 · 28 次引用
相关 Paper
- ReDoSHunter: A Combined Static and Dynamic Approach for Regular Expression DoS DetectionYeting Li, Zixuan Chen, Jialun Cao, Zhiwu Xu 等USENIX Security 2021 · 20 次引用
- Effective ReDoS Detection by Principled Vulnerability Modeling and Exploit GenerationXinyi Wang, Cen Zhang, Yeting Li, Zhiwu Xu 等S&P 2023
- Counting in Regexes Considered Harmful: Exposing ReDoS Vulnerability of Nonbacktracking MatchersLenka Turonová, Lukás Holík, Ivan Homoliak, Ondrej Lengál 等USENIX Security 2022
- FlashRegex: Deducing Anti-ReDoS Regexes from ExamplesYeting Li, Zhiwu Xu, Jialun Cao, Haiming Chen 等ASE 2020 · 17 次引用
- Using Selective Memoization to Defeat Regular Expression Denial of Service (ReDoS)James C. Davis, Francisco Servant, Dongyoon LeeS&P 2021 · 43 次引用
