Skip to content
DoS Advisory Intermediate CVE-2023-22483

GHSL-2022-088, GHSL-2022-089, GHSL-2022-090, GHSL-2022-091, GHSL-2022-099, GHSL-2022-109, GHSL-2022-110, GHSL-2022-111, GHSL-2022-120, GHSL-2022-126: Quadratic complexity algorithms in cmark-gfm - CVE-2023-22483

A crafted markdown document can trigger quadratic complexity algorithms in cmark-gfm, causing excessive CPU or memory usage. Since cmark-gfm renders markdown on GitHub, this could be used for denial-of-service attacks.

kevinbackhouse Follow

Originally disclosed on GitHub Security Lab

A crafted markdown document can trigger a quadratic complexity algorithm in cmark-gfm. Since cmark-gfm is used for rendering markdown on https://github.com/, this vulnerability could be used in a denial-of-service attack on GitHub.

kevinbackhouse, on GitHub Security Lab

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, several parsing functions use algorithms whose running time grows quadratically with input size, due to repeated scanning or list operations without efficient bounds.

Impact

This issue could be used in a denial-of-service attack on GitHub.

What the attacker needed

Ability to submit markdown to a service using cmark-gfm

The fix

The issues were fixed by commits referenced in the disclosure timeline.

How it was found

  1. Create a markdown document with many repetitions of a specific character sequence.
  2. Run cmark-gfm on the document.
  3. Observe that running time increases quadratically as the repetition 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.

Some programs slow down dramatically when given certain inputs, taking much longer than expected. Here, specially crafted markdown text makes the parser take quadratic time, meaning doubling the input size quadruples the work. This can be abused to overwhelm a service like GitHub.

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.

More by kevinbackhouse

View all

47 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.