Skip to content
DoS Advisory Intermediate

GHSL-2020-350: ReDoS (Regular Expression Denial of Service) in ng2-validation

The ng2-validation library contains a regular expression vulnerable to ReDoS, allowing an attacker to cause exponential backtracking with a crafted input string. This can lead to a denial of service when the library is used to validate untrusted user input.

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

Likely, the regular expression contains overlapping or ambiguous clauses that cause exponential backtracking when given a crafted input.

Impact

This issue may lead to a denial of service.

What the attacker needed

Victim uses ng2-validation to validate input; attacker can control the input string

How it was found

  1. Go to the demo page for ng2-validation.
  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 be tricked into taking a very long time to process certain inputs, which can freeze a program. This report shows that a validation library has such a pattern, so an attacker could send a special string to make the application hang.

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.