GHSL-2020-292: ReDoS (Regular Expression Denial of Service) in CKEditor 5 - CVE-2021-21254
CKEditor 5's markdown export feature used a regular expression for link detection that could be forced into exponential backtracking with a crafted input, causing the editor to hang. An attacker could paste such input to cause a denial of service.
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 for link detection had overlapping clauses that allowed exponential backtracking on crafted input.
Impact
This issue may lead to a denial of service.
What the attacker needed
Victim pastes crafted input into editor
The fix
The issue was fixed by removing ambiguity in the regular expression.
How it was found
- Open the CKEditor 5 markdown demo page.
- Paste a string starting with 'http://' followed by many single quotes into the editor.
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 find text. Some patterns can take a very long time to process certain inputs, like a string of many quotes after 'http://'. This can freeze the application, which is called 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.