Skip to main content
QUICK REVIEW

[Paper Review] Static Analysis for Regular Expression Exponential Runtime via Substructural Logics

Asiri Rathnayake, Hayo Thielecke|arXiv (Cornell University)|May 27, 2014
Logic, programming, and type systemsComputer Science27 references26 citations
TL;DR

This paper presents a refined static analysis to detect regular expressions vulnerable to exponential runtime via backtracking, using substructural logic to model search tree branching as non-linearity. By composing transition relations through powers and products, it reduces the REDoS problem to reachability, enabling precise detection of exponential blowup with formal correctness guarantees.

ABSTRACT

Regular expression matching using backtracking can have exponential runtime, leading to an algorithmic complexity attack known as REDoS in the systems security literature. In this paper, we build on a recently published static analysis that detects whether a given regular expression can have exponential runtime for some inputs. We systematically construct a more accurate analysis by forming powers and products of transition relations and thereby reducing the REDoS problem to reachability. The correctness of the analysis is proved using a substructural calculus of search trees, where the branching of the tree causing exponential blowup is characterized as a form of non-linearity.

Motivation & Objective

  • To address the security threat of algorithmic complexity attacks via regular expression backtracking, known as REDoS.
  • To improve upon prior static analyses by increasing precision in detecting exponential-time regex patterns.
  • To formalize the source of exponential blowup as non-linear branching in search trees using substructural logic.
  • To reduce the REDoS detection problem to a reachability problem through algebraic composition of transition relations.
  • To provide a formally verified, accurate static analysis for identifying regex patterns that can cause exponential runtime.

Proposed method

  • Model regex matching as a transition system where states represent positions in the pattern and input string.
  • Represent branching behavior in the search tree as non-linear resource usage, formalized via substructural logic.
  • Construct powers and products of transition relations to simulate all possible matching paths and detect exponential growth.
  • Reduce the problem of detecting exponential runtime to a reachability query in the composed transition system.
  • Prove correctness of the analysis using a substructural calculus that captures resource consumption during backtracking.
  • Use the calculus to characterize when non-linear branching leads to exponential blowup in matching time.

Experimental results

Research questions

  • RQ1Can we precisely identify which regular expressions are vulnerable to exponential runtime due to backtracking?
  • RQ2How can we formally model the non-linear branching behavior that causes exponential blowup in regex matching?
  • RQ3Can we reduce the detection of exponential runtime to a reachability problem in a structured transition system?
  • RQ4What is the role of substructural logic in characterizing resource usage during regex matching?
  • RQ5How does composing transition relations via powers and products improve detection accuracy?

Key findings

  • The proposed analysis precisely identifies regular expressions that can cause exponential runtime by modeling non-linear branching in search trees.
  • The use of substructural logic enables formal characterization of resource consumption, directly linking non-linearity to exponential blowup.
  • Composing transition relations through powers and products allows accurate detection of exponential behavior without over-approximation.
  • The reduction of the REDoS problem to reachability enables scalable and formally verifiable analysis.
  • The method achieves higher precision than prior static analyses by capturing the true source of exponential behavior.
  • The correctness of the analysis is formally proven using a substructural calculus, ensuring reliability in security-critical applications.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.