Lune

S&P2022顶会

Repairing DoS Vulnerability of Real-World Regexes

Nariyoshi Chida, Tachio Terauchi

摘要

There has been much work on synthesizing and repairing regular expressions (regexes for short) from examples. These programming-by-example (PBE) methods help the users write regexes by letting them reflect their intention by examples. However, the existing methods may generate regexes whose matching may take super-linear time and are vulnerable to regex denial of service (ReDoS) attacks. This paper presents the first PBE repair method that is guaranteed to generate only invulnerable regexes. Importantly, our method can handle real-world regexes containing lookarounds and backreferences. Due to the extensions, the existing formal definitions of ReDoS vulnerabilities that only consider pure regexes are insufficient. Therefore, we first give a novel formal semantics and complexity of backtracking matching algorithms for real-world regexes, and with them, give the first formal definition of ReDoS vulnerability for real-world regexes. Next, we present a novel condition called real-world strong 1-unambiguity that is sufficient for guaranteeing the invulnerability of real-world regexes, and formalize the corresponding PBE repair problem. Finally, we present an algorithm that solves the repair problem. The algorithm builds on and extends the previous PBE methods to handle the realworld extensions and with constraints to enforce the real-world strong 1-unambiguity condition.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 8 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Linear Matching of JavaScript Regular Expressions 引用了 Using Selective Memoization to Defeat Regular Expression Denial of Service (ReDoS)
  • Linear Matching of JavaScript Regular Expressions 引用了 Revealer: Detecting and Exploiting Regular Expression Denial-of-Service Vulnerabilities
  • Linear Matching of JavaScript Regular Expressions 引用了 Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web Servers
  • Repairing Regex-Dependent String Functions 引用了 Multi-modal synthesis of regular expressions
  • Improving Developers' Understanding of Regex Denial of Service Tools through Anti-Patterns and Fix Strategies 引用了 Using Selective Memoization to Defeat Regular Expression Denial of Service (ReDoS)
  • Improving Developers' Understanding of Regex Denial of Service Tools through Anti-Patterns and Fix Strategies 引用了 FlashRegex: Deducing Anti-ReDoS Regexes from Examples
  • 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 引用了 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
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper8

  1. Linear Matching of JavaScript Regular ExpressionsAurèle Barrière, Clément Pit-ClaudelPLDI 2024 · 11 次引用
  2. Repairing Regex-Dependent String FunctionsNariyoshi Chida, Tachio TerauchiASE 2024 · 3 次引用
  3. 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
  4. SoK: Automated Vulnerability Repair: Methods, Tools, and AssessmentsYiwei Hu, Zhen Li, Kedie Shu, Shenghua Guan 等USENIX Security 2025
  5. LogicEval: A Systematic Framework for Evaluating Automated Repair Techniques for Logical Vulnerabilities in Real-World SoftwareSyed Md. Mukit Rashid, Abdullah Al Ishtiaq, Kai Tu, Yilu Dong 等ACL 2026

它引用的 Paper5

  1. Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web ServersCristian-Alexandru Staicu, Michael PradelUSENIX Security 2018 · 125 次引用
  2. Multi-modal synthesis of regular expressionsQiaochu Chen, Xinyu Wang, Xi Ye, Greg Durrett 等PLDI 2020 · 81 次引用
  3. Using Selective Memoization to Defeat Regular Expression Denial of Service (ReDoS)James C. Davis, Francisco Servant, Dongyoon LeeS&P 2021 · 43 次引用
  4. Revealer: Detecting and Exploiting Regular Expression Denial-of-Service VulnerabilitiesYinxi Liu, Mingxue Zhang, Wei MengS&P 2021 · 28 次引用
  5. FlashRegex: Deducing Anti-ReDoS Regexes from ExamplesYeting Li, Zhiwu Xu, Jialun Cao, Haiming Chen 等ASE 2020 · 17 次引用

相关 Paper

  1. RegexScalpel: Regular Expression Denial of Service (ReDoS) Defense by Localize-and-FixYeting Li, Yecheng Sun, Zhiwu Xu, Jialun Cao 等USENIX Security 2022
  2. Repairing Regular Expressions for ExtractionNariyoshi Chida, Tachio TerauchiPLDI 2023 · 9 次引用
  3. ReDoSHunter: A Combined Static and Dynamic Approach for Regular Expression DoS DetectionYeting Li, Zixuan Chen, Jialun Cao, Zhiwu Xu 等USENIX Security 2021 · 20 次引用
  4. Towards an Effective Method of ReDoS Detection for Non-backtracking EnginesWeihao Su, Hong Huang, Rongchen Li, Haiming Chen 等USENIX Security 2024 · 4 次引用
  5. Regulator: Dynamic Analysis to Detect ReDoSRobert McLaughlin, Fabio Pagani, Noah Spahn, Christopher Kruegel 等USENIX Security 2022
黄昏的海面,两侧是细线勾勒的悬崖