Skip to content
DoS Write-up Intermediate

The MarkdownTime Vulnerability: How to Avoid This DoS Attack on Business Critical Services

A vulnerability in the commonmarker markdown library, used by GitHub and GitLab, allowed an unauthenticated attacker to cause high CPU usage and denial of service by sending a crafted markdown request. The attack could take down GitHub servers and disrupt production pipelines.

Tor Beer Follow

Published on legitsecurity.com

Everybody is familiar with downtimes in major services. It can be very frustrating when a platform your organization depends upon becomes unavailable.

Tor Beer (@tor19951), on legitsecurity.com

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 write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The markdown parser's autolink extension had a polynomial-time complexity bug when processing repeated image bracket sequences, causing excessive CPU usage.

Impact

An unauthenticated attacker could cause a denial of service, taking down GitHub servers and disrupting production pipelines; rate limiting did not prevent the attack.

What the attacker needed

Markdown API accessible without authentication; Ability to send HTTP requests

How it was found

  1. Send an HTTP POST request to the /markdown endpoint.
  2. Set the text field to a string containing many repeated image bracket sequences.
  3. Set the gfm field to either true or false.
  4. Observe high CPU usage for 60 seconds until the request times out.

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 write-up has not been written yet. The Original tab links to the source.

Markdown is a way to format text, and many websites use a library to convert it to HTML. This bug meant that a specially crafted markdown input could make the conversion process use a huge amount of CPU, effectively freezing the server. An attacker could send such input to a public API and take the service offline.

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.

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.