GHSL-2020-303: Regular Expression Denial of Service (ReDoS) in nope-validator - CVE-2020-26309
The email validation regular expression in nope-validator is vulnerable to ReDoS, allowing an attacker to cause excessive CPU usage by supplying a crafted email string. This can lead to a denial of service.
Originally disclosed on GitHub Security Lab
The project contains one or more regular expressions that are vulnerable to ReDoS (Regular Expression Denial of Service)
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the email validation regular expression contains ambiguous repetition that allows exponential backtracking on crafted input.
Impact
This issue may lead to a denial of service.
What the attacker needed
Attacker can control input to email validation
How it was found
- Install nope-validator using npm.
- Create a JavaScript file that requires nope-validator and calls the email validation with a crafted string.
- Run the file with Node.js to observe the slowdown.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A regular expression is a pattern used to check text. Some patterns can become very slow when given a specially crafted input, making the program freeze. Here, the email checker could be slowed down so much that the service becomes unavailable.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.