Lune

USENIX Security2022Top-tier venue

Regulator: Dynamic Analysis to Detect ReDoS

Robert McLaughlin, Fabio Pagani, Noah Spahn, Christopher Kruegel, Giovanni Vigna

Abstract

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.

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.

10 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

  • Towards Efficient Matching of Regexes with Backreferences using Register Set Automata cites Towards an Effective Method of ReDoS Detection for Non-backtracking Engines
  • Towards Efficient Matching of Regexes with Backreferences using Register Set Automata cites 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 cites Revealer: Detecting and Exploiting Regular Expression Denial-of-Service Vulnerabilities
  • CollAFL: Path Sensitive Fuzzing cites SlowFuzz: Automated Domain-Independent Detection of Algorithmic Complexity Vulnerabilities
  • Remote Code Execution from SSTI in the Sandbox: Automatically Detecting and Exploiting Template Escape Bugs cites 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 cites Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web Servers
  • Towards an Effective Method of ReDoS Detection for Non-backtracking Engines cites 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 cites Revealer: Detecting and Exploiting Regular Expression Denial-of-Service Vulnerabilities
  • Towards an Effective Method of ReDoS Detection for Non-backtracking Engines cites 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 cites 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 cites Revealer: Detecting and Exploiting Regular Expression Denial-of-Service Vulnerabilities
  • PufferDoS: Efficient and Effective Attack String Generation for Regular Expression Denial of Service Vulnerabilities cites SlowFuzz: Automated Domain-Independent Detection of Algorithmic Complexity Vulnerabilities
  • Improving Developers' Understanding of Regex Denial of Service Tools through Anti-Patterns and Fix Strategies cites 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 cites 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 cites 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 cites SlowFuzz: Automated Domain-Independent Detection of Algorithmic Complexity Vulnerabilities
  • Revealer: Detecting and Exploiting Regular Expression Denial-of-Service Vulnerabilities cites 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 cites Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web Servers
  • Revealer: Detecting and Exploiting Regular Expression Denial-of-Service Vulnerabilities cites 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 cites 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 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 papers10

  1. Towards an Effective Method of ReDoS Detection for Non-backtracking EnginesWeihao Su, Hong Huang, Rongchen Li, Haiming Chen et al.USENIX Security 2024 · 4 citations
  2. Towards Efficient Matching of Regexes with Backreferences using Register Set AutomataVojtech Havlena, Lukás Holík, Ondrej Lengál, Jan Vasák et al.PLDI 2026
  3. Remote Code Execution from SSTI in the Sandbox: Automatically Detecting and Exploiting Template Escape BugsYudi Zhao, Yuan Zhang, Min YangUSENIX Security 2023
  4. PufferDoS: Efficient and Effective Attack String Generation for Regular Expression Denial of Service VulnerabilitiesShangzhi Xu, Ziqi Ding, Xiao Cheng, Yuekang Li et al.S&P 2026
  5. 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

Builds on7

  1. CollAFL: Path Sensitive FuzzingShuitao Gan, Chao Zhang, Xiaojun Qin, Xuwen Tu et al.S&P 2018 · 426 citations
  2. SlowFuzz: Automated Domain-Independent Detection of Algorithmic Complexity VulnerabilitiesTheofilos Petsios, Jason Zhao, Angelos D. Keromytis, Suman JanaCCS 2017 · 214 citations
  3. Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web ServersCristian-Alexandru Staicu, Michael PradelUSENIX Security 2018 · 125 citations
  4. 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 citations
  5. Revealer: Detecting and Exploiting Regular Expression Denial-of-Service VulnerabilitiesYinxi Liu, Mingxue Zhang, Wei MengS&P 2021 · 28 citations

Related papers

  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. Effective ReDoS Detection by Principled Vulnerability Modeling and Exploit GenerationXinyi Wang, Cen Zhang, Yeting Li, Zhiwu Xu et al.S&P 2023
  3. Counting in Regexes Considered Harmful: Exposing ReDoS Vulnerability of Nonbacktracking MatchersLenka Turonová, Lukás Holík, Ivan Homoliak, Ondrej Lengál et al.USENIX Security 2022
  4. FlashRegex: Deducing Anti-ReDoS Regexes from ExamplesYeting Li, Zhiwu Xu, Jialun Cao, Haiming Chen et al.ASE 2020 · 17 citations
  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