GHSL-2020-298: Regular Expression Denial of Service in Metro-UI-CSS
Metro-UI-CSS uses a regular expression for URL validation that is vulnerable to catastrophic backtracking. An attacker can supply a crafted URL string that causes the regex to run for an extremely long time, making the page unresponsive and spiking CPU usage.
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
The URL validation regular expression contains ambiguous overlapping clauses that allow exponential backtracking on crafted input.
Impact
This issue may lead to a denial of service.
What the attacker needed
Victim visits a page using the library; attacker can supply a crafted URL string
The fix
The fix was to update to the latest version of the gist the library is based on.
How it was found
- Open the demo page.
- Enter a fake email address.
- Paste the provided string into the Website field.
- Press Submit and observe the page becoming unresponsive with CPU usage spiking.
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 take a very long time to check certain inputs because the computer tries many possible ways to match. Here, a specially crafted web address makes the pattern check take so long that the page freezes, which is a denial of 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.