Lune

ASE2020Top-tier venue

FlashRegex: Deducing Anti-ReDoS Regexes from Examples

Yeting Li, Zhiwu Xu, Jialun Cao, Haiming Chen, Tingjian Ge, Shing-Chi Cheung, Haoren Zhao

Abstract

Regular expressions (regexes) are widely used in different fields of computer science such as programming languages, string processing and databases. However, existing tools for synthesizing or repairing regexes were not designed to be resilient to Regex Denial of Service (ReDoS) attacks. Specifically, if a regex has super-linear (SL) worst-case complexity, an attacker could provide carefully-crafted inputs to launch ReDoS attacks. Therefore, in this paper, we propose a programming-by-example framework, FlashRegex, for generating anti-ReDoS regexes by either synthesizing or repairing from given examples. It is the first framework that integrates regex synthesis and repair with the awareness of ReDoS-vulnerabilities. We present novel algorithms to deduce anti-ReDoS regexes by reducing the ambiguity of these regexes and by using Boolean Satisfiability (SAT) or Neighborhood Search (NS) techniques. We evaluate FlashRegex with five related state-of-the-art tools. The evaluation results show that our work can effectively and efficiently generate anti-ReDoS regexes from given examples, and also reveal that existing synthesis and repair tools have neglected ReDoS-vulnerabilities of regexes. Specifically, the existing synthesis and repair tools generated up to 394 ReDoS-vulnerable regex within few seconds to more than one hour, while FlashRegex generated no SL regex within around five seconds. Furthermore, the evaluation results on ReDoS-vulnerable regex repair also show that FlashRegex has better capability than existing repair tools and even human experts, achieving 4 more ReDoS-invulnerable regex after repair without trimming and resorting, highlighting the usefulness of FlashRegex in terms of the generality, automation and user-friendliness.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

12 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Exploiting Input Sanitization for Regex Denial of Service cites TRANSREGEX: Multi-modal Regular Expression Synthesis by Generate-and-Repair
  • Exploiting Input Sanitization for Regex Denial of Service cites SlowFuzz: Automated Domain-Independent Detection of Algorithmic Complexity Vulnerabilities
  • Search-Based Regular Expression Inference on a GPU cites TRANSREGEX: Multi-modal Regular Expression Synthesis by Generate-and-Repair
  • ReDoSHunter: A Combined Static and Dynamic Approach for Regular Expression DoS Detection cites SlowFuzz: Automated Domain-Independent Detection of Algorithmic Complexity Vulnerabilities
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers12

  1. ReDoSHunter: A Combined Static and Dynamic Approach for Regular Expression DoS DetectionYeting Li, Zixuan Chen, Jialun Cao, Zhiwu Xu et al.USENIX Security 2021 · 20 citations
  2. Exploiting Input Sanitization for Regex Denial of ServiceEfe Barlas, Xin Du, James C. DavisICSE 2022 · 16 citations
  3. TRANSREGEX: Multi-modal Regular Expression Synthesis by Generate-and-RepairYeting Li, Shuaimin Li, Zhiwu Xu, Jialun Cao et al.ICSE 2021 · 16 citations
  4. Repairing DoS Vulnerability of Real-World RegexesNariyoshi Chida, Tachio TerauchiS&P 2022 · 15 citations
  5. Search-Based Regular Expression Inference on a GPUMojtaba Valizadeh, Martin BergerPLDI 2023 · 11 citations

Builds on1

  1. SlowFuzz: Automated Domain-Independent Detection of Algorithmic Complexity VulnerabilitiesTheofilos Petsios, Jason Zhao, Angelos D. Keromytis, Suman JanaCCS 2017 · 214 citations

Related papers

  1. Improving Developers' Understanding of Regex Denial of Service Tools through Anti-Patterns and Fix StrategiesSk Adnan Hassan, Zainab Aamir, Dongyoon Lee, James C. Davis et al.S&P 2023
  2. RegexScalpel: Regular Expression Denial of Service (ReDoS) Defense by Localize-and-FixYeting Li, Yecheng Sun, Zhiwu Xu, Jialun Cao et al.USENIX Security 2022
  3. Revealer: Detecting and Exploiting Regular Expression Denial-of-Service VulnerabilitiesYinxi Liu, Mingxue Zhang, Wei MengS&P 2021 · 28 citations
  4. Effective ReDoS Detection by Principled Vulnerability Modeling and Exploit GenerationXinyi Wang, Cen Zhang, Yeting Li, Zhiwu Xu et al.S&P 2023
  5. Using Selective Memoization to Defeat Regular Expression Denial of Service (ReDoS)James C. Davis, Francisco Servant, Dongyoon LeeS&P 2021 · 43 citations
Dusk over the sea between two cliffs drawn in fine vertical lines