Skip to content
DoS Advisory Intermediate CVE-2023-28626CVE-2023-28631

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.

philipturnbull Follow

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.

philipturnbull, 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 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.

More by philipturnbull

View all

4 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.