DOS via Gantt diagrams Mermaid
A denial-of-service vulnerability was found in GitLab's rendering of Mermaid Gantt diagrams when a comment contains dates spanning thousands of years. An attacker could make pages with such comments load very slowly, affecting any section that supports comments.
GitLab
Originally disclosed on GitLab
- Fixed in 3 months
- Disclosed after 3 months
⚠️ Please read the process on how to fix security issues before starting to work on the issue. Vulnerabilities must be fixed in a security mirror.
HackerOne report #2103067 by toukakirishima on 2023-08-09, assigned to @nmalcolm:
Report | Attachments | How To Reproduce
Report
Summary
Summary
I found a DOS vulnerability when add comment with Gantt diagrams Mermaid, as an attacker I can make DoS in any section with comments (Issues, Merge requests, Milestones, Snippets, Wiki pages, Markdown documents inside repositories, Epics). Due to the year timeline that must be loaded up to several thousand years in the future, attackers can create DOS with Gantt diagrams Mermaid.
Steps to reproduce
- Create comment with Gantt diagrams Mermaid (example on Issue)
Payload: (updated by nmalcolm)
```mermaid
gantt
title A Gantt Diagram
dateFormat YYYYY-MM-DD
section Section
A task :a1, 99999-12-31,30d
Another task :a2, 00000-01-01, 25d
Another one :a3, 10000-12-31, 20d
```

- Reload the page. And you will load the page very long.

POC
URL for Tested
https://gitlab.com/toukaattacker/aaa/-/issues/3
What is the current bug behavior?
Due to the year timeframe/timeline that must be loaded up to several thousand years in the future, attackers can create DOS with Gantt diagrams Mermaid.
What is the expected correct behavior?
Renders a maximum of 1-3 years of timeframe/timeline.
Output of checks
This bug happens on GitLab.com
Impact
Attacker can make DoS in any section with comments (Issues, Merge requests, Milestones, Snippets, Wiki pages, Markdown documents inside repositories, Epics).
Attachments
Warning: Attachments received through HackerOne, please exercise caution!
How To Reproduce
Please add reproducibility information to this section:
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
Impact
An attacker could cause a denial of service in any section with comments, making pages load very slowly.
What the attacker needed
Ability to post a comment with a Mermaid diagram
The fix
The Gantt diagram renderer should limit the displayed timeline to a maximum of 1-3 years.
How it was found
- Create a comment containing a Mermaid Gantt diagram with dates spanning thousands of years.
- Reload the page and observe that it takes a very long time to load.
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.
A denial-of-service (DoS) attack makes a website or service unavailable or very slow for legitimate users. Here, a specially crafted diagram in a comment forces the page to try to draw a timeline spanning thousands of years, which takes a long time to load. This means anyone viewing that comment experiences a very slow page.
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.