Skip to content
DoS Advisory Intermediate CVE-2021-29469

GHSL-2021-026: ReDoS in NodeRedis - CVE-2021-29469

A regular expression in NodeRedis's monitor mode is vulnerable to catastrophic backtracking, causing exponential runtime when processing a crafted string. An attacker who can control input to the monitor could cause a denial of service by making the process hang.

kevinbackhouse 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)

kevinbackhouse, 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 allow exponential backtracking when matching certain inputs.

Impact

This issue may lead to a denial of service.

What the attacker needed

NodeRedis monitor mode enabled; attacker can control input to monitor

The fix

The regular expression should be rewritten to remove ambiguity and overlap, as shown in the examples.

How it was found

  1. Download and build Redis from source.
  2. Start the Redis server.
  3. Install the NodeRedis package.
  4. Run a Node.js script that creates a Redis client, enables monitor mode, and sets a key to a long crafted string.
  5. Observe that the subsequent get call hangs and never completes.

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 match text. Some patterns can be written in a way that makes them very slow when given a specially crafted input, because the computer tries many possible ways to match. This is called a regular expression denial of service (ReDoS), and it can freeze a program so it stops 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.

More by kevinbackhouse

View all

47 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.