v8n vulnerable to Inefficient Regular Expression Complexity
The lowercase() and uppercase() validation rules in v8n use regular expressions with inefficient complexity, allowing a short crafted string to cause excessive backtracking. An attacker could supply such a string to cause a denial of service by making the validation take tens of seconds.
imbrn/v8n
Originally disclosed on huntr
Impact
Inefficient regular expression complexity of lowercase() and uppercase() regex could lead to a denial of service attack. With a formed payload 'a' + 'a'.repeat(i) + 'A', only 32 characters payload could take 29443 ms time execution when testing lowercase(). The same issue happens with uppercase().
Patches
v1.5.1
References
huntr.dev report Regular Expression Denial of Service (ReDoS) and Catastrophic Backtracking
For more information
If you have any questions or comments about this advisory:
- Open an issue in v8n issues list
- Email us at [email protected]
From the GitHub Advisory Database (GHSA-xrx9-gj26-5wx9, CC BY 4.0).
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
Impact
An attacker could cause a denial of service by submitting a short crafted string that makes the validation take tens of seconds, potentially exhausting server resources.
What the attacker needed
Ability to submit input to a v8n validation rule
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.
Some text-checking patterns (regular expressions) can get stuck trying many combinations when given a specially crafted input, like a long run of the same letter followed by a different one. This makes the program take a very long time to finish, which can stop it from serving other users. Here, a short string of only 32 characters could make a check take almost 30 seconds.
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.