Dark Mode

Settings

Capec-492 Detail

Regular Expression Exponential Blowup

Standard Software

Parents: 130

Threats: T61 T64 T74 T77 T269 T282 T289 T374 T401

Description

An adversary may execute an attack on a program that uses a poor Regular Expression(Regex) implementation by choosing input that results in an extreme situation for the Regex. A typical extreme situation operates at exponential time compared to the input size. This is due to most implementations using a Nondeterministic Finite Automaton(NFA) state machine to be built by the Regex algorithm since NFA allows backtracking and thus more complex regular expressions.

Extended Description

The algorithm builds a finite state machine and based on the input transitions through all the states until the end of the input is reached. NFA engines may evaluate each character in the input string multiple times during the backtracking. The algorithm tries each path through the NFA one by one until a match is found; the malicious input is crafted so every path is tried which results in a failure. Exploitation of the Regex results in programs hanging or taking a very long time to complete. These attacks may target various layers of the Internet due to regular expressions being used in validation.
External ID Source Link Description
CAPEC-492 capec https://capec.mitre.org/data/definitions/492.html
CWE-400 cwe http://cwe.mitre.org/data/definitions/400.html
CWE-1333 cwe http://cwe.mitre.org/data/definitions/1333.html
OWASP Attacks https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS Regular expression Denial of Service - ReDoS
REF-421 reference_from_CAPEC http://msdn.microsoft.com/en-au/magazine/ff646973.aspx Bryan Sullivan, Regular Expression Denial of Service Attacks and Defenses

Not present

  1. This type of an attack requires the ability to identify hosts running a poorly implemented Regex, and the ability to send crafted input to exploit the regular expression.

Not present

Not present

Not present

Not present