GHSL-2020-349: ReDoS (Regular Expression Denial of Service) in date-and-time - CVE-2020-26289
The date-and-time 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 untrusted input is processed.
Originally disclosed on GitHub Security Lab
The project contains one or more regular expressions that are vulnerable to ReDoS (Regular Expression Denial of Service)
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 has ambiguity or overlapping clauses that cause exponential backtracking on certain inputs.
Impact
This issue may lead to a denial of service.
What the attacker needed
Attacker controls input to date.compile
The fix
The maintainer released a fixed version 0.14.2.
How it was found
- Install the date-and-time package using npm.
- Run a Node.js script that calls the compile function with a crafted string containing many 'Z' characters.
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 become extremely slow when given a specially crafted input, causing the program to hang. This is called a regular expression denial of service (ReDoS), and it can be used to crash or freeze a 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.