Skip to content
DoS Advisory Intermediate CVE-2021-21252

GHSL-2020-294: ReDoS (Regular Expression Denial of Service) in jquery.validation - CVE-2021-21252

The jquery.validation library uses a regular expression for URL validation that is vulnerable to catastrophic backtracking. An attacker could supply a crafted URL string to cause excessive CPU usage, leading to a denial of service.

ghsecuritylab Follow

Originally disclosed on GitHub Security Lab

The project contains one or more regular expressions that are vulnerable to ReDoS (Regular Expression Denial of Service)

ghsecuritylab, on GitHub Security Lab

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 for URL validation contains overlapping clauses that allow exponential backtracking on crafted input.

Impact

This issue may lead to a denial of service.

What the attacker needed

Victim uses jquery.validation; attacker can supply input to URL validation

The fix

The regular expression should be fixed by removing ambiguity and overlap between its clauses.

How it was found

  1. Go to the demo site.
  2. Paste the provided text into the URL field.

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 certain inputs, making the program freeze. Here, a malicious URL could make the validation process hang, effectively denying service to legitimate users.

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.

More by ghsecuritylab

View all

132 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.