GHSL-2022-039: Exponential ReDoS (Regular Expression Denial of Service) in jquery-validation - CVE-2022-31147
The jquery-validation package contains a regular expression in its url2 method that can be made to run for an extremely long time by supplying a crafted input, causing a denial of service. An attacker who can control the input to this validation method could freeze the application.
Originally disclosed on GitHub Security Lab
The issue is the same as CVE-2021-43306: An exponential ReDoS (Regular Expression Denial of Service) can be triggered in the jquery-validation npm package, when an attacker is able to supply arbitrary input to the url2 method
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
The regular expression used in the url2 method has nested quantifiers that cause exponential backtracking on certain inputs.
Impact
This issue may lead to DoS.
What the attacker needed
Attacker can supply input to url2 method
The fix
The vulnerability was fixed by updating the regular expression to a newer version from the original gist.
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 take a very long time to check certain inputs, especially if the input is designed to make the pattern try many combinations. Here, a specially crafted web address makes the validation check hang, which can stop the application from responding.
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.