Skip to content
DoS Disclosed report Beginner

DoS on the Issue page by exploiting Mermaid.

A user who can comment on an issue could paste a crafted Mermaid diagram into a comment, and the issue page would then freeze for anyone who opened it. This prevented users from viewing the issue details or taking further actions on it.

8ayac Follow

Originally disclosed on HackerOne

Bounty$3,000 Medium 4.3 View original
  • Triaged in 43 hours
  • Fixed in 3 months
  • Paid in 3 months
  • Disclosed after 5 months

Summary: An attacker could exploit Mermaid available in Markdown and cause DoS.

Description: Markdown supported by GitLab can generate diagrams and flowcharts from text using Mermaid. An Attacker can exploit this function to prevent users from successfully accessing some functions. For example, you can use Markdown in Issue's comment. Therefore, DoS can be caused by all users who can comment on that Issue.

Steps To Reproduce:

[Preparation]

  1. Create a new public Project.
  2. Create an Issue in the Project created in step 1.
  3. Add some comments to the Project created in step 2.

[Attack Flow]

  1. Go to the Issue page created in preparation step 2.
  2. Copy the payload. (payload is attached file.)
  3. Paste the payload on the comment input form.
  4. Submit the comment.

Result: Since the screen freezes, the user can not access details of the Issue. In addition, the user can not take any additional action on that Issue.

NOTE: Similar attacks are effective for all functions that can use Markdown.

Supporting Material/References:

  • payload.txt
  • poc.mp4

Impact

  • All users will not be able to access Issue details.
  • All users can not take additional actions for the Issue.

Attachments

poc.mp4 From the original on HackerOne

The original report as published on HackerOne, by 8ayac. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 3 min read.

Context

GitLab renders Markdown in many places across the product, and one of the supported extensions is Mermaid, which generates diagrams and flowcharts from text. The report targets gitlab.com and the Issue page in particular, but the author is explicit that the same technique applies to every function that accepts Markdown. The weakness class recorded for the report is uncontrolled resource consumption, rated medium with a CVSS score of 4.3, and the bounty paid was 3000.00 USD.

The claim is not that data is exposed or modified. It is that a comment containing a crafted Mermaid payload makes the page unusable: the screen freezes and the user cannot reach the details of the Issue or perform any further action on it.

Setup

The report describes no special tooling, account type or version. The only precondition it states is that the attacker can comment on an Issue, and it notes that this means any user who is able to comment on that Issue can mount the attack. The preparation steps use a public project, so the Issue page is reachable by other users as well.

Finding it

The researcher started from the fact that GitLab renders Mermaid diagrams inside Markdown, and that Markdown is accepted in Issue comments. A comment is therefore a place where attacker-controlled text is turned into a diagram by the browser. The suspicion was that a diagram definition expensive enough to render would consume the client's resources and block the page, which is what the proof of concept demonstrates.

Exploitation

Step 1: Prepare a project and an Issue

  1. Create a new public Project.
  2. Create an Issue in that Project.
  3. Add some comments to the Issue.

The preparation steps add some comments to the Issue before the attack.

Step 2: Open the Issue page

Go to the Issue page created above. This is the page that will be rendered for every visitor, including users other than the attacker.

Step 3: Copy the payload

The payload is provided as an attached file, payload.txt. The report does not reproduce its contents in the text, so the exact Mermaid definition is not available here; the file is listed under Supporting Material/References alongside the video.

Step 4: Paste it into the comment form

The payload is pasted into the comment input form on the Issue page.

Step 5: Submit the comment

Submitting the comment makes the screen freeze, and the user cannot access the Issue details or take further action.

Result: the screen freezes, the user cannot access the details of the Issue, and the user cannot take any additional action on that Issue. The report attaches a recording, poc.mp4.

poc.mp4 From the original on HackerOne

Root cause

The report does not analyse the rendering code. What it shows is that a crafted Mermaid definition in Markdown makes the page freeze. The payload is placed in a comment, and the report says all users cannot access the Issue details. The report does not say whether any server-side rendering or timeout is involved, so the exact mechanism behind the freeze is not documented.

Impact

  • All users will not be able to access Issue details.
  • All users cannot take additional actions for the Issue.

The author states that similar attacks are effective for all functions that can use Markdown, so the Issue page is one instance of a broader surface rather than the only one. The impact described is availability of the affected pages for their visitors, not disclosure or modification of data.

Fix

The report does not describe a fix or a change made in response.

Variants to test

  • Post the same style of Mermaid payload as a comment on other Markdown-rendering surfaces the product exposes, such as merge requests or wiki pages, and check whether the page freezes there too. A positive result is a page that becomes unresponsive on load for a second user.
  • Place the payload in the Issue description rather than a comment, to see whether the initial render path behaves the same way.
  • Try payloads of increasing size or complexity to find where rendering stops being tolerable, which helps show that the problem is unbounded consumption rather than one malformed diagram.

Hunting notes

During recon, the signal is a product that advertises diagram support in its Markdown and stores that content so it is rendered for everyone who views the page. The researcher demonstrated the freeze on an Issue page and attached a recording.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 9 min read.

What happened, in plain words

GitLab is a website where teams keep their code and talk about their work. One of the things you can do there is write comments in a simple formatting language called Markdown, and GitLab can turn certain Markdown text into pictures called diagrams and flowcharts. The tool that draws those pictures is called Mermaid.

A security researcher found that if someone writes a specially crafted Mermaid diagram in a comment, the page that shows the comment stops responding. The screen freezes, and the user cannot access the details of the Issue or take any further action on it. The researcher reported this to GitLab through a bug bounty programme, a scheme where companies pay people for finding security problems. The report was rated medium severity with a CVSS score of 4.3, and the bounty paid was 3000.00 USD.

Nothing secret is stolen and nothing is changed. The problem is that the page becomes unusable for everyone who opens it. This kind of problem is called a denial of service, or DoS: the service is still there, but you cannot use it.

Some words you will meet

Before the steps, a few ideas explained from zero.

  • Markdown is a way of writing text with simple symbols that later turn into formatting. For example, you type some characters and the site shows a heading or a list. It is like a recipe written in shorthand that the website knows how to cook.
  • Mermaid is a feature that reads a piece of text and draws a diagram from it. Think of it as a machine that takes a written description of boxes and arrows and produces a picture.
  • Issue is GitLab's word for a task, bug or discussion thread. Each Issue has its own page, with a description and a list of comments underneath, like a forum thread.
  • Comment is a message a user adds to an Issue. Anyone allowed to comment can add one, and everyone who opens the Issue sees it.
  • Client means your own computer and browser, as opposed to the server, the company's machine that stores the data. When we say something is processed in the client, we mean your browser does the work.
  • Payload is the piece of text an attacker sends to trigger the problem. It is not a program you install; here it is just text placed in a comment.
  • Uncontrolled resource consumption is the official name of this weakness. A computer has limited resources, mainly processor time and memory. If one task asks for far more than the machine can give, everything else has to wait. It is like one person at a counter asking a question that takes hours to answer while the queue behind them stands still.
  • CVSS is a standard scoring system for the seriousness of a security problem. Higher numbers mean worse. 4.3 is in the medium range.

Context

GitLab shows Markdown in many places across the product, and one of the supported extras is Mermaid, which generates diagrams and flowcharts from text. The report targets gitlab.com and the Issue page in particular, but the author is explicit that the same technique applies to every function that accepts Markdown. The weakness class recorded for the report is uncontrolled resource consumption, rated medium with a CVSS score of 4.3, and the bounty paid was 3000.00 USD.

The claim is not that data is exposed or modified. It is that a comment containing a crafted Mermaid payload makes the page unusable: the screen freezes and the user cannot reach the details of the Issue or perform any further action on it.

Setup

The report describes no special tooling, account type or version. The only precondition it states is that the attacker can comment on an Issue, and it notes that this means any user who is able to comment on that Issue can mount the attack. The preparation steps use a public project, so the Issue page is reachable by other users as well.

A public project is one that anyone can see, not just the team that created it. That matters here: the point is that other people will open the page and be affected, not only the person who wrote the comment.

Finding it

The researcher started from the fact that GitLab renders Mermaid diagrams inside Markdown, and that Markdown is accepted in Issue comments. A comment is therefore a place where attacker-controlled text is turned into a diagram by the browser. The suspicion was that a diagram definition expensive enough to render would consume the client's resources and block the page, which is what the proof of concept demonstrates.

In everyday terms: the researcher noticed that a website feature takes text from strangers and makes your own browser do work with it. If the work can be made enormous, your browser has no time left for anything else, and the page appears frozen.

Exploitation

Step 1: Prepare a project and an Issue

  1. Create a new public Project.
  2. Create an Issue in that Project.
  3. Add some comments to the Issue.

The preparation steps add some comments to the Issue. A project is a container for a team's work, and an Issue inside it is one discussion.

Step 2: Open the Issue page

Go to the Issue page created above. This is the page that will be rendered for every visitor, including users other than the attacker. Go to the Issue page created above.

Step 3: Copy the payload

The payload is provided as an attached file, payload.txt. The report does not reproduce its contents in the text, so the exact Mermaid definition is not available here; the file is listed under Supporting Material/References alongside the video.

This is worth being clear about: the report tells us a file exists and that it contains the text to paste, but it does not show that text. So there is no code block to copy in this section, because the report itself does not include one.

Step 4: Paste it into the comment form

The payload is pasted into the comment input form on the Issue page. The comment form is the box where you normally type a reply. Pasting the text there is the same action as writing any ordinary comment.

Step 5: Submit the comment

Submitting the comment makes the screen freeze, and the user cannot access the Issue details or take further action.

The payload is placed in a comment, and the report says all users cannot access the Issue details.

Result: the screen freezes, the user cannot access the details of the Issue, and the user cannot take any additional action on that Issue. The report attaches a recording, poc.mp4.

poc.mp4 From the original on HackerOne

The video is the proof of concept, poc.mp4.

Root cause

The report does not analyse the rendering code. What it shows is that a crafted Mermaid definition in Markdown makes the page freeze. The report does not say whether any server-side rendering or timeout is involved, so the exact mechanism behind the freeze is not documented.

A useful comparison is a form that asks you to fill in a number. If the form accepts any number at all, someone can type a number so large that the calculation never finishes. The fix in that case is not to ban numbers but to set a sensible upper limit. Here, the report shows that an expensive diagram makes the page freeze.

Impact

  • All users will not be able to access Issue details.
  • All users cannot take additional actions for the Issue.

The author states that similar attacks are effective for all functions that can use Markdown, so the Issue page is one instance of a broader surface rather than the only one. The impact described is availability of the affected pages for their visitors, not disclosure or modification of data.

Availability is one of the three classic things security protects, alongside confidentiality (keeping data secret) and integrity (keeping data correct). Here only availability is harmed: the page exists and the data is untouched, but people cannot get to it.

Fix

Variants to test

  • Post the same style of Mermaid payload as a comment on other Markdown-rendering surfaces the product exposes, such as merge requests or wiki pages, and check whether the page freezes there too. A positive result is a page that becomes unresponsive on load for a second user.
  • Place the payload in the Issue description rather than a comment, to see whether the initial render path behaves the same way.
  • Try payloads of increasing size or complexity to find where rendering stops being tolerable, which helps show that the problem is unbounded consumption rather than one malformed diagram.

A merge request is a proposal to combine changes into a project, and a wiki is a set of editable pages; both are places where people write text that others read. Testing them is a way of checking whether the problem is specific to comments or common to every place that draws diagrams. Testing the Issue description checks a different box on the same page. Trying payloads of growing size is a way of showing a trend: if each bigger payload makes the page worse, the issue is a missing limit, not one unlucky piece of text.

Hunting notes

During recon, the signal is a product that advertises diagram support in its Markdown and stores that content so it is rendered for everyone who views the page. The researcher demonstrated the freeze on an Issue page and attached a recording.

Recon here simply means looking around a product before testing it: reading its help pages, noticing which features it advertises, and asking where text you write ends up being shown to other people. If a feature both accepts your text and draws something from it for every visitor, it is worth a look.

Glossary

  • Markdown: a simple way of writing text with symbols that a website turns into formatting such as headings, lists and links.
  • Mermaid: a feature that reads a written description and draws a diagram or flowchart from it.
  • Issue: GitLab's name for a task or discussion thread, with a description and comments on its own page.
  • Comment: a message a user adds to an Issue, visible to everyone who opens it.
  • Project: a container in GitLab for a team's work, which can hold Issues and other content.
  • Public project: a project that anyone can view, not only its own team.
  • Merge request: a proposal to combine a set of changes into a project, which other people can read and discuss.
  • Wiki: a set of pages that a team can edit and read together.
  • Client: your own computer and browser, as opposed to the server that stores the data.
  • Server: the company's machine that stores content and sends it to visitors.
  • Browser: the program you use to open websites, which also does work such as drawing diagrams.
  • Payload: the piece of text an attacker submits in order to trigger a problem.
  • Proof of concept (PoC): a demonstration that a problem is real, often a recording or a small example.
  • Denial of service (DoS): a problem where a service or page cannot be used, even though it has not been broken into or changed.
  • Uncontrolled resource consumption: a weakness where a task can use an unlimited amount of a computer's processing time or memory, leaving nothing for everything else.
  • Availability: whether people can actually reach and use a service; one of the three classic security goals alongside confidentiality and integrity.
  • Confidentiality: keeping data secret from those who should not see it.
  • Integrity: keeping data correct and unaltered.
  • CVSS: a standard scoring system for the seriousness of a security problem, where higher numbers mean worse.
  • Severity: a label such as low, medium or high that summarises how serious a problem is.
  • Bounty: a payment a company makes to someone who reports a security problem to it.
  • Bug bounty programme: a scheme where a company invites people to report security problems and pays for valid ones.
  • Recon: the looking-around phase before testing, where you learn what a product does and where its features are.
  • Rendering: the process of turning stored text into what you actually see on screen, such as a diagram.
  • Timeout: a limit on how long a task is allowed to run before it is stopped.
  • Mitigation: a change that reduces or removes the effect of a problem.

More by 8ayac

View all

5 more disclosed reports, best first.

More from GitLab

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.