CVE-2017-16021 Regular Expression Denial Of Service in uri-js
Attackers can cause a denial of service by supplying malicious URLs to the uri-js library, leading to excessive CPU usage and application hangs.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2017-16021?
CVE-2017-16021 is a medium-severity denial of service vulnerability in HackerOne uri-js node module, published on 4 Jun 2018. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
uri-js is a module that tries to fully implement RFC 3986. One of these features is validating whether or not a supplied URL is valid or not. To do this, uri-js uses a regular expression, This regular expression is vulnerable to redos. This causes the program to hang and the CPU to idle at 100% usage while uri-js is trying to validate if the supplied URL is valid or not. To check if you're vulnerable, look for a call to `require("uri-js").parse()` where a user is able to send their own input. This affects uri-js 2.1.1 and earlier.
Which versions are affected by CVE-2017-16021?
2 open source packages ship an affected version, including uri-js. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
uri-js npm | All versions | 3.0.0 |
uri-js npm | All versions | 3.0.0 |
Products include Garycourt Uri-Js.
How do I fix CVE-2017-16021?
Upgrade uri-js to 3.0.0 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2017-16021 being exploited?
There is no known exploitation of CVE-2017-16021 in the wild and no public exploit code.
Sources
Also known as GHSA-333w-rxj3-f55r.