Skip to content
DoS Disclosed report Intermediate

Zero Complexity Multiplier Bypasses Complexity Limit, Allowing Unauthenticated DoS

The GraphQL complexity multiplier always returns zero when an iid or iids argument is present, so queries with many IDs bypass the maximum complexity limit. An unauthenticated attacker can send such queries to saturate CPU and make the GitLab instance unresponsive.

GitLab

Originally disclosed on GitLab

  • Fixed in 2 months
  • Disclosed after 2 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 #3228134 by foxribeye on 2025-06-28, assigned to @katwu:

Report | Attachments | How To Reproduce

Report

The bug is that the condition [args[:iid], args[:iids]].any? is always true (especially when you pass IDs), so complexity_multiplier always returns 0.

This means as soon as you pass an iid, complexity_multiplier returns 0, so the query is treated as having zero cost, completely bypassing the complexly limit. So, an unauthenticated attacker can use many ids, this bypasses the max complexity limit of 200, allows for DoS.

The bug is located here:
app/graphql/resolvers/base_resolver.rb

def self.complexity_multiplier(args)  
  [args[:iid], args[:iids]].any? ? 0 : 0.01  
end  
Steps to reproduce

(self-hosted test)

  1. Save this script:
  2. Then run script in shell like this:

for i in {1..12}; do python dos.py -u http://localhost:8080 -n 250000 -c 4 & sleep 5 done

(This sends 4 parallel requests every 5 seconds, repeated 12 times, peaking at only 4 rps. Each request uses 250000 ids)

  1. On your shell where instance is, run htop and you’ll see the puma workers saturating cpu. Navigate to instance on browser notice gitlab instance becomes unresponsive.

Poc:

dos.mp4 From the original on GitLab

Impact

Requests from unauthenticated users can saturate cpu resources and render the instance unresponsive.

Attachments

Warning: Attachments received through HackerOne, please exercise caution!

How To Reproduce

Please add reproducibility information to this section:

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

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

The complexity_multiplier method uses a condition that is always true when iid or iids is present, so it returns 0 instead of a positive multiplier.

Impact

Unauthenticated requests can saturate CPU resources and render the instance unresponsive.

What the attacker needed

Unauthenticated access; self-hosted GitLab instance

How it was found

  1. Save the provided script.
  2. Run the script in a shell loop that sends parallel requests with many IDs.
  3. Observe CPU saturation in htop and the instance becoming unresponsive in the browser.

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 complexity limit is a cap on how much work a single query can ask the server to do, meant to stop abuse. Here a helper that estimates query cost always returned zero whenever an ID was supplied, so the cap never applied. An attacker could then send queries with huge numbers of IDs and tie up the server's processing power.

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