Glushkov Automata for Regular Expression Engine ReDoS Mitigation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing regular expression engines are vulnerable to regular expression denial of service (ReDoS) attacks due to excessive temporal and spatial resource usage when checking harmful patterns against character strings, leading to inefficient match determination and potential system crashes.

Innovation Solution

The proposed solution involves transforming regular expression patterns into Glushkov automata and selectively applying either the Spencer or classical matching algorithm based on the presence of extended grammar, minimizing resource usage and preventing ReDoS attacks by optimizing the matching process.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If traditional regular expression engines are used to check patterns against character strings, then pattern matching capability is provided, but temporal and spatial resources are excessively consumed leading to ReDoS attacks

Engineering Contradiction:
Improvesecurity against ReDoS attacksVSAvoidtemporal and spatial resource usage
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The patent transforms the regular expression into a Glushkov automaton, fundamentally changing the parameter representation from traditional regex syntax to a finite automaton state graph. This parameter transformation enables efficient pattern matching while preventing ReDoS attacks by limiting the search space to a finite number of states and transitions.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent replaces the traditional mechanical regex matching process with an automaton-based system. Instead of recursively traversing regex patterns (which consumes exponential resources), the system uses deterministic state transitions in a Glushkov automaton, substituting the matching mechanism with a more efficient computational model that inherently bounds resource usage.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Adaptability or versatility

If extended grammar features are added to regular expressions, then matching capability and flexibility are improved, but complexity of the matching process increases

Engineering Contradiction:
Improvematching capability with extended grammarVSAvoidcomplexity of matching process
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent segments the extended grammar features into distinct components within the Glushkov automaton structure. Capture groups, forward searches, and other extended features are represented as separate states or transition mechanisms, allowing the system to handle complex patterns by composing simpler automaton components rather than processing a monolithic complex regex.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS20230092467A1Automata processing method and apparatus for regular expression engines using glushkov automata generation and hybrid matching
Publication Date: 2023.03.23 UI (UNIVERSITY IND FOUNDATION) YONSEI UNIVERSITY
  • US20230092467A1 patent drawing
  • US20230092467A1 patent drawing
  • US20230092467A1 patent drawing

AI summary

Provided are an automata processing method and apparatus capable of transforming a regular expression pattern into a specific type of nondeterministic finite automata (NFA), selectively applying a matching algorithm to the nondeterministic finite automata according to whether to include an extended grammar to minimize the use of temporal and spatial resources, and preventing regular expression denial of service (ReDoS).