Skip to content
DoS Disclosed report Intermediate

DOS via issue preview

Previewing an issue with a specially crafted description causes high CPU usage for 60 seconds, leading to a request timeout. Multiple parallel requests can exhaust multiple CPUs and potentially make the entire server unavailable.

legit-security Follow

Originally disclosed on HackerOne

Bounty$7,640 High 7.5 View original
  • Triaged in 22 days
  • Fixed in 4 months
  • Paid in 22 days
  • Disclosed after 7 months

Summary by the researcher

We are Legit Security, a company building a solution that protects development environments and pipelines from security risks such as software supply-chain attacks and sensitive data exposure. You can read a bit about us at http://www.legitsecurity.com.

The report

Summary

Previewing an issue with a specially-crafted description results in high CPU usage for 60 seconds (request timeout). Multiple requests can be issued in parallel to create a larger impact.

Steps to reproduce

  1. Given an authorized user (on GitLab.com - anyone can self-register. On EE - depends on instance configuration).
  2. Create an issue with the following description (provided a one-line python script to avoid bloating):
  3. Hit the preview button.

Steps 2&3 can be accomplished via the preview_markdown API endpoint.

The script:

python -c "print('![l' * int(1048576 / 3 - 1) + '\n')" Note: this is essentially the maximal description size, but a smaller number of repetitions works too.

Impact

After 60 seconds (timeout) - the request fails. Meanwhile, on the server end, (a single) CPU is burnt out (verified against a local EE instance). Issuing multiple requests in parallel results in multiple CPUs burn out. Using the DockerHub image, the entire server is completely unavailable by repeatedly sending a small number of requests repeatedly.

Examples

The bug is instance-independent, works on latest versions. Since GitLab.com is open-core - it would work on GitLab too.

What is the current bug behavior?

The HTTP request fails for timeout while the server is burning CPU.

On the code side: texts_and_contexts is being initialized here:


def analyze(text, context = {})
      @texts_and_contexts << { text: text, context: context }
    end

It is then used at banzai/reference_extractor.rb:


def html_documents
      ...
      @html_documents ||= Renderer.cache_collection_render(@texts_and_contexts)
      ...

The CPU utilization is found in the execution of cache_collection_render.

What is the expected correct behavior?

Fix the implementation of cache_collection_render.

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Impact

A complete denial of service of a GitLab EE instance. As this vulnerability impacts GitLab.com, we assume that this vulnerability opens the door for a DDOS attack.

The original report as published on HackerOne, by legit-security. 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 markdown rendering function cache_collection_render is inefficient when processing a large number of image references, causing excessive CPU usage.

Impact

A complete denial of service of a GitLab EE instance could occur, and since it impacts GitLab.com, it may open the door for a DDoS attack.

What the attacker needed

An authorized user account; ability to create an issue; ability to preview markdown

The fix

The implementation of cache_collection_render should be fixed to avoid excessive CPU usage.

How it was found

  1. Obtain an authorized user account (anyone can self-register on GitLab.com).
  2. Create an issue with a specially crafted description containing many repeated image reference patterns.
  3. Trigger the preview function, either via the preview button or the preview_markdown API endpoint.

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 tries to make a service unavailable by overwhelming it with work. Here, a user could craft a very long issue description that, when previewed, makes the server spend a lot of processing power, causing the request to time out and potentially taking down the whole server if repeated.

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 legit-security

View all

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