GHSL-2020-343: ReDoS (Regular Expression Denial of Service) in Vant
The Vant UI framework's email validation function uses a regular expression vulnerable to ReDoS, allowing an attacker to cause a denial of service by supplying a crafted email address. The report demonstrates that a long string of zeros and dots can trigger exponential backtracking.
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 overlapping or ambiguous clauses that allow exponential backtracking on certain inputs.
Impact
This issue may lead to a denial of service.
What the attacker needed
Attacker can control email input; application uses Vant's email validation
The fix
The vulnerability was fixed in version 3.0.7 by removing ambiguity in the regular expression.
How it was found
- Install the Vant package via npm.
- Import the isEmail function from the email validation module.
- Call isEmail with a crafted string consisting of 'a@' followed by many '0.' repetitions.
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 extremely slow when given a specially crafted input, making the program hang. This is called a regular expression denial of service (ReDoS). Here, the email checker in a UI library could be tricked into taking a very long time, potentially freezing the application.
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.