GHSL-2023-047_GHSL-2023-049: Denial of Service (DoS) in comrak - CVE-2023-28626, CVE-2023-28631
The comrak markdown parser has multiple quadratic parsing issues that can cause excessive CPU or memory usage, and its AST formatting code does not validate attacker-controlled data, leading to panics or out-of-bounds reads. An attacker could trigger a denial of service by supplying crafted markdown or by controlling AST data in applications that build ASTs programmatically.
Originally disclosed on GitHub Security Lab
A number of quadratic parsing issues can allow an attacker to trigger a denial-of-service via excessive CPU usage or excessive memory usage.
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 parser has algorithms that scale quadratically with input size for certain patterns, and the AST formatting code assumes data is well-formed without validation.
Impact
An attacker could cause a denial of service by consuming excessive CPU or memory, or by triggering panics in applications that build ASTs programmatically.
What the attacker needed
Ability to supply markdown input; or control over AST data in programmatic use
The fix
The issues were fixed by the maintainer.
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.
This report is about a library that converts markdown text into HTML. Some specially crafted markdown makes the conversion take a very long time or use a huge amount of memory, which can stop a service from working. Also, if a program builds the internal representation directly, bad data can crash the program.
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.