Skip to content
DoS Disclosed report Intermediate

Regular Expression Denial of Service (ReDoS)

The is-my-json-valid package used a regular expression to validate email addresses that could take a very long time to match certain long inputs. An attacker could supply a crafted email string to block the event loop and cause a denial of service.

danny_grander Follow

Originally disclosed on HackerOne

Medium 5.3 View original
  • Triaged in 10 days
  • Fixed in 12 months
  • Disclosed after 13 months

The issue was already fixed.

Module: is-my-json-valid

Summary: Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) attacks. It used a regular expression (/^\S+@\S+$/) in order to validate emails. This can cause an impact of about 10 seconds matching time for data 90K characters long.

Description: Regex: formats.js exports[‘email’] = /^\S+@\S+$/ (introduced in 2014, 34a1a706)

Supporting Material/References:

Impact

Denial of service through blocking the event loop.

The original report as published on HackerOne, by danny_grander. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 was not designed to handle long, repetitive inputs efficiently, leading to excessive backtracking.

Impact

An attacker could cause a denial of service by blocking the event loop with a crafted long email string.

What the attacker needed

Ability to supply input validated as email

The fix

The issue was fixed.

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 specially crafted long input, which ties up the program and stops it from doing other work. Here, an email-checking pattern could be made to run for many seconds, effectively freezing the service.

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 danny_grander

View all

2 more disclosed reports, best first.

More from Node.js third-party modules

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.