DoS via markdown API from unauthenticated user
A polynomial time complexity flaw in the autolink extension of cmark-gfm could cause unbounded resource exhaustion and denial of service when parsing crafted markdown.
Originally disclosed on HackerOne
- Triaged in 21 hours
- Fixed in 5 months
- Paid in 5 months
- Disclosed after 5 months
Summary by the program
cmark-gfm is GitHub's fork of cmark, a CommonMark parsing and rendering library and program in C. In versions prior to 0.29.0.gfm.6 a polynomial time complexity issue in cmark-gfm's autolink extension may lead to unbounded resource exhaustion and subsequent denial of service. Users may verify the patch by running python3 -c 'print("![l"* 100000 + "\n")' | ./cmark-gfm -e autolink, which will resource exhaust on unpatched cmark-gfm but render correctly on patched cmark-gfm. This vulnerability has been patched in 0.29.0.gfm.6. Users are advised to upgrade. Users unable to upgrade should disable the use of the autolink extension.
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 autolink extension's parsing algorithm had polynomial time complexity, so specially shaped input caused work to grow far faster than the input size.
Impact
Crafted markdown could cause unbounded resource exhaustion and denial of service; the text does not say whether any deployment-level defence limited it.
What the attacker needed
Ability to submit crafted markdown to a system using…
The fix
It was fixed in version 0.29.0.gfm.6, and users who cannot upgrade should disable the autolink extension.
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.
Markdown is the simple formatting language used in comments and readme files. The library that turns it into HTML had a weakness: certain input made it work much harder than it should, so the server ran out of resources and stopped responding to normal users. This is called a denial of service, because the goal is to make a service unavailable rather than to steal data.
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.