Skip to content
Access control Disclosed report Beginner

Commite Access to Project due to bypass of recommended email regex!

The recommended email regex for committer author's email in GitLab project settings did not escape dots, so a subdomain like 'sub.company.com' could be bypassed by an email like '[redacted]'. An attacker could use an unauthorised email address to commit to the project, potentially changing source code.

GitLab

Originally disclosed on GitLab

  • Fixed in 3 months
  • Disclosed after 3 months

HackerOne report #631879 by ngalog on 2019-06-29, assigned to gitlab_cmaxim:

Summary

The recommended regex of commiter author's email is like this Example: @my-company.com$
It forgot to escape the dot. In normal situation this is fine, however if the user used subdomain of the email address, then this could be bypassed as below.

Commiter Authori's email regex: @sub.company.com$

[email protected] -> pass  
[email protected] -> also pass the regex  

Steps to reproduce:

Visit https://gitlab.com/:project/-/settings/repository and you should see the recommended regex of email could be bypassed.

Impact

This allow user to use other email address to bypass the commitor's email address. Unauthoirzed change to project source code.

What is the current bug behavior?

recommended regex is @sub.company.com$

What is the expected correct behavior?

should be @sub\.company\.com$

Relevant logs and/or screenshots

Screen_Shot_2019-06-29_at_4.40.46_PM.png
Screen_Shot_2019-06-29_at_4.40.46_PM.png From the original on GitLab

Output of checks

GitLab.com and EE and CE of 12.0

Impact

.

Attachments

Warning: Attachments received through HackerOne, please exercise caution!

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 recommended regex did not escape the dot characters, so they matched any character instead of a literal dot.

Impact

This could allow a user to use another email address to bypass the committer's email restriction, leading to unauthorised changes to project source code.

What the attacker needed

Access to project settings; ability to commit to the project

The fix

The regex should escape the dots, e.g. '@sub\.company\.com$'.

How it was found

  1. Visit the project's repository settings page.
  2. Observe the recommended regex for committer email.
  3. Note that an email like [redacted] also passes the regex.

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 regular expression (regex) is a pattern used to check text, like an email address. The recommended pattern for allowed committer emails was meant to match only addresses ending in '@sub.company.com', but because the dots were not escaped, the pattern also matched '@subacompany.com'. This let someone use a different email to commit to the project.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More from GitLab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.