GHSL-2023-117_GHSL-2023-119: Denial of Service (DoS) in cmark-gfm - CVE-2023-37463
Three crafted markdown documents can trigger quadratic-time algorithms in cmark-gfm, causing excessive CPU use. An attacker could use this for denial-of-service against sites that render untrusted markdown.
Originally disclosed on GitHub Security Lab
A crafted markdown document can trigger a quadratic complexity algorithm in cmark-gfm.
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 and renderer contain loops that repeatedly scan linked lists or expand table rows, so work grows quadratically with input size.
Impact
This issue could be used in a denial-of-service attack on websites that use cmark-gfm to render markdown documents.
What the attacker needed
Ability to submit markdown to a service using cmark-gfm
The fix
The issues were fixed in version 0.29.0.gfm.12.
How it was found
- Create a markdown table with a very large number of columns.
- Render it with cmark-gfm using the table extension.
- Observe that running time increases quadratically as the column count grows.
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.
cmark-gfm is a tool that turns markdown text into HTML. Some inputs make it do work that grows much faster than the input size, so a small file can keep a server busy for a long time. That can stop the site from serving other users.
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.