Skip to content
DoS Disclosed report Beginner

Cookie bomb

A GitLab Pages site can set many large cookies for the shared parent domain, causing the server to reject subsequent requests with oversized headers. This makes all subdomains of that shared domain inaccessible to the affected user until cookies are cleared.

moritz30 Follow

Originally disclosed on HackerOne

  • Triaged in 3 days
  • Fixed in 10 months
  • Disclosed after 10 months

It is possible to create a that called cookie bomb in Gitlab Pages. This is especially a problem if the site creating the cookie bomb uses a shared pages domain. In that case no (sub)domain of that domain would be accessible for that user anymore until they clear their cookies. That does not only include GitLab (Pages) (sub)domains. The code of my sample page is

`<html>

<head> </head> <body> <script> var base_domain = document.domain.substr(document.domain.indexOf('.')); var pollution = Array(4000).join('a'); for(var i=1;i<99;i++){ document.cookie='bomb'+i+'='+pollution+';Domain='+base_domain; } </script> <h1>Cookie Bomb executed! To remove it clear your cookies.</h1> </body> </html>`

The cookie bomb works by using JavaScript to set cookies that are way too big making the server decline any request send with them for having a too long request header.

It should also work on Gitlab.com.

More information about cookie bombs can be found at http://homakov.blogspot.de/2014/01/cookie-bomb-or-lets-break-internet.html .

A solution would be to inject JS into every page served using Gitlab pages that uses the cookies.change event and checks if there are a lot of cookies being set and then removing them. An other solution would be to check the HTML of Gitlab pages before deploying them.

Test sites: Just a demo page that does nothing special (to see that it works before but not after executing the cookie bomb): http://test1.thedragonteam.info A page that executes a cookie bomb: http://test2.thedragonteam.info Both are served using Gitlab pages.

The original report as published on HackerOne, by moritz30. 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

Impact

A user who visits a malicious GitLab Pages site on a shared domain could lose access to all subdomains of that domain until they clear their cookies; the report claims this should also work on GitLab.com.

What the attacker needed

Victim visits a malicious GitLab Pages site; site uses a shared Pages domain

The fix

GitLab should either inject JavaScript into every Pages page to detect and remove excessive cookies, or check the HTML of Pages sites before deployment.

How it was found

  1. Create a GitLab Pages site that runs JavaScript to set many large cookies for the shared parent domain.
  2. Visit the malicious page so the browser stores the oversized cookies.
  3. Try to access any subdomain of the shared domain; the server rejects requests due to the oversized cookie header.

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.

Cookies are small pieces of data websites store in your browser. A cookie bomb is a script that creates so many large cookies that the browser sends a huge amount of data with every request, and the server refuses to accept it. Because cookies can be set for a whole shared domain, this can break access to every site under that domain for that user.

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 moritz30

View all

1 more disclosed report, 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.