Skip to content
DoS Disclosed report Beginner

Clientside resource Exhausting by exploiting gitlab math rendering

GitLab's markdown math rendering with KaTeX did not limit nested sqrt functions, so a crafted issue could cause the page to hang for anyone who opened it. The attacker could make the project owner unable to close the issue because the browser became unresponsive.

abdilahrf_ Follow

Originally disclosed on HackerOne

  • Triaged in 7 days
  • Fixed in 4 months
  • Paid in 4 months
  • Disclosed after 5 months

Summary

based on the documentation gitlab markdown is supporting math expresion rendering using KaTex and able to run subset syntax from LaTex this could be achieved by using 2 ways in the markdown for inline and for multiline.

KaTex.PNG
KaTex.PNG From the original on HackerOne

Steps to reproduce

Step-by-step guide to reproduce the issue, including:

  1. Pick any repositories that you want to attack
  2. Create new issue and use payload 1.md or 2.md
  3. Everyone trying to open the issue will get hang since this generate tons of resources

Or check out this video :

clientside-resource-exhausting.mp4 From the original on HackerOne

Impact

Project owner/everyone that trying to view the issue is got hang by the KaTex trying to render nested sqrt function without any limitation and making the owner unable to close the issue.

What is the current bug behavior?

I was able to using nested sqrt and rules function without any limitation and making the website unresponsive

What is the expected correct behavior?

The nested function should be limited using fixed normal amount, and should use maxSize to limit the visual width/height

Output of checks

https://gitlab.com/abdilah.pb/testing-project/issues/2

Remediation

Use maxSize option for preventing large width/height visual affronts, use maxExpand for preventing infinite macro loop attacks, and use allowedProtocols for preventing certain protocols in \href. Please refer to Options for more details. https://katex.org/docs/security.html

Impact

Project owner/everyone that trying to view the issue is got hang by the KaTex trying to render nested sqrt function without any limitation and making the owner unable to close the issue.

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

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 KaTeX rendering options did not set limits on macro expansion or output size, allowing deeply nested expressions to consume excessive client-side resources.

Impact

Project owners and anyone viewing the issue could have their browser hang, and the owner may be unable to close the issue.

What the attacker needed

Ability to create an issue in a repository; victim opens the issue

The fix

The report recommends using KaTeX options such as maxSize, maxExpand, and allowedProtocols to limit rendering, but it does not state that a fix was applied.

How it was found

  1. Pick any repository to attack.
  2. Create a new issue and insert the provided markdown payload.
  3. Anyone who opens the issue experiences a hang because the page generates excessive resources.

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.

GitLab lets you write math in issues using a tool called KaTeX. The report says that if you write a very deeply nested math expression, the browser uses so much processing power that the page freezes. This means a normal user could accidentally or deliberately stop others from using the issue 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.

More by abdilahrf_

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.