RegexScalpel: Regular Expression Denial of Service (ReDoS) Defense by Localize-and-Fix
Yeting Li, Yecheng Sun, Zhiwu Xu, Jialun Cao, Yuekang Li, Rongchen Li, Haiming Chen, Shing-Chi Cheung, Yang Liu, Yang Xiao
摘要
The Regular expression Denial of Service (ReDoS) is a class of denial of service attacks that exploit vulnerable regular expressions (regexes) whose execution time can be superlinearly related to input sizes. A common approach of defending ReDoS attacks is to repair the vulnerable regexes. Techniques have been recently proposed to synthesize repaired regexes using program-by-example (PBE) techniques. However, these existing techniques may generate regexes, which are not semantically equivalent or similar to the original ones, or are still vulnerable to ReDoS attacks. To address the challenges, we propose RegexScalpel, an automatic regex repair framework that adopts a localize-andfix strategy. RegexScalpel first localizes the vulnerabilities by leveraging fine-grained vulnerability patterns proposed by us to analyze their vulnerable patterns, the source (i.e., the pathological sub-regexes), and the root causes (e.g., the overlapping sub-regexes). Then, RegexScalpel targets to fix the pathological sub-regexes according to our predefined repair patterns and the localized vulnerability information. Furthermore, our repair patterns ensure that the repair regexes are semantically either equivalent to or similar to the original ones. Our iterative repair method also keeps out vulnerabilities of the repaired regexes. With an experiment on a total number of 448 vulnerable regexes, we demonstrate that RegexScalpel can outperform all existing automatic regexes fixing techniques by fixing 348 more regexes than the best existing work. Also, we adopted RegexScalpel to detect ten popular projects including Python and NLTK, and revealed 16 vulnerable regexes. We then applied RegexScalpel to successfully repair all of them, and these repairs were merged into the later release by the maintainers, resulting in 8 confirmed CVEs.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 7 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- 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 引用了 ReDoSHunter: A Combined Static and Dynamic Approach for Regular Expression DoS Detection
- 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
- Test Suites Guided Vulnerability Validation for Node.js Applications 引用了 Revealer: Detecting and Exploiting Regular Expression Denial-of-Service Vulnerabilities
- Test Suites Guided Vulnerability Validation for Node.js Applications 引用了 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 引用了 Using Selective Memoization to Defeat Regular Expression Denial of Service (ReDoS)
- ReDoSHunter: A Combined Static and Dynamic Approach for Regular Expression DoS Detection 引用了 Regex matching with counting-set automata
- 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
引用它的顶会 Paper7
- PufferDoS: Efficient and Effective Attack String Generation for Regular Expression Denial of Service VulnerabilitiesShangzhi Xu, Ziqi Ding, Xiao Cheng, Yuekang Li 等S&P 2026
- SoK: Automated Vulnerability Repair: Methods, Tools, and AssessmentsYiwei Hu, Zhen Li, Kedie Shu, Shenghua Guan 等USENIX Security 2025
- Test Suites Guided Vulnerability Validation for Node.js ApplicationsChanghua Luo, Penghui Li, Wei Meng, Chao ZhangCCS 2024
- SoK: Towards Effective Automated Vulnerability RepairYing Li, Faysal Hossain Shezan, Bomin Wei, Gang Wang 等USENIX Security 2025
- Enhance Stealthiness and Transferability of Adversarial Attacks with Class Activation Mapping Ensemble AttackHui Xia, Rui Zhang, Zi Kang, Shuliang Jiang 等NDSS 2024
它引用的 Paper9
- 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 次引用
- Regex matching with counting-set automataLenka Turonová, Lukás Holík, Ondrej Lengál, Olli Saarikivi 等OOPSLA 2020 · 22 次引用
- ReDoSHunter: A Combined Static and Dynamic Approach for Regular Expression DoS DetectionYeting Li, Zixuan Chen, Jialun Cao, Zhiwu Xu 等USENIX Security 2021 · 20 次引用
相关 Paper
- FlashRegex: Deducing Anti-ReDoS Regexes from ExamplesYeting Li, Zhiwu Xu, Jialun Cao, Haiming Chen 等ASE 2020 · 17 次引用
- Repairing DoS Vulnerability of Real-World RegexesNariyoshi Chida, Tachio TerauchiS&P 2022 · 15 次引用
- 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
- Effective ReDoS Detection by Principled Vulnerability Modeling and Exploit GenerationXinyi Wang, Cen Zhang, Yeting Li, Zhiwu Xu 等S&P 2023
- Runtime Recovery of Web Applications under Zero-Day ReDoS AttacksZhihao Bai, Ke Wang, Hang Zhu, Yinzhi Cao 等S&P 2021 · 19 次引用
