Regular Expression Denial of Service (DoS)

Affecting hawk package, versions <=3.1.2 || >= 4.0.0 <4.1.1

low severity

Overview

hawk Hawk is an HTTP authentication scheme using a message authentication code (MAC) algorithm to provide partial HTTP request cryptographic verification. Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) attacks.

The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Many Regular Expression implementations may reach edge cases that causes them to work very slowly (exponentially related to input size), allowing an attacker to exploit this and can cause the program to enter these extreme situations by using a Regex string and cause the service to hang for a large periods of time.

An attacker can provide a long url, which nearly matches the pattern being matched. This will cause the regular expression matching to take a long time, all the while occupying the event loop and preventing it from processing other requests and making the server unavailable (a Denial of Service attack).

You can read more about Regular Expression Denial of Service (ReDoS) on our blog.

References

Snyk patch available for versions:

Credit
Adam Baldwin
CWE
CWE-400
Snyk ID
npm:hawk:20160119
Disclosed
19 Jan, 2016
Published
19 Jan, 2016

Do your applications use this vulnerable package?