Unauthorized user can manipulate status of issues in public projects
The ProcessCommitWorker automatically closes issues mentioned in commit messages, using the commit author to determine who is closing the issue. Since commit authors can be spoofed, an attacker can forge a commit with the victim's email to close issues in public projects without authorization.
GitLab
Originally disclosed on GitLab
- Fixed in 29 days
- Disclosed after 29 days
⚠️ 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 #2877710 by pwnie on 2024-12-04, assigned to @ottilia_westerlund:
Report | How To Reproduce
Report
Summary
The ProcessCommitWorker function automatically closes issues mentioned in commit messages. This behavior is vulnerable because it uses the commit author to determine the user closing the issue, and commit authors can be spoofed. By forging a commit with the victim's email, attackers can close issues in public projects without authorization.
Steps to Reproduce
-
Create a Target Issue:
- Log in as a victim user and create an issue in a public project.
-
Prepare the Attack:
- Log in as an attacker.
- Clone a repository you own:
Bash git clone YOUR_REPO_URL cd YOUR_REPO
-
Forge a Commit:
- Add any file to the repository:
Bash touch foobar git add foobar - Commit with the victim’s email and a message referencing the target issue:
Bash git commit --author="Victim <VICTIM_EMAIL_HERE>" -m "Close https://gitlab.com/VICTIM/PROJECT/-/issues/ID" - Replace:
VICTIM_EMAIL_HEREwith the victim's email address.https://gitlab.com/VICTIM/PROJECT/-/issues/IDwith the link to the target issue.
- Add any file to the repository:
-
Push the Malicious Commit:
- Push the changes to your repository:
Bash git push origin main
- Push the changes to your repository:
-
Observe that the issue in the victim's project is automatically closed.
Impact
This vulnerability allows an attacker to arbitrarily close issues in public projects without authorization. Since ProcessCommitWorker relies solely on the commit author field, which is easily spoofed, attackers can impersonate any user to exploit this behavior. This could lead to confusion, disruption of project workflows, and abuse of public repositories.
Impact
Close arbitrary issues.
How To Reproduce
Please add reproducibility information to this section:
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 system trusts the commit author email without verifying that the person pushing the commit actually controls that email address.
Impact
An attacker could close arbitrary issues in public projects without authorization, potentially causing confusion and disrupting project workflows.
What the attacker needed
A GitLab account; victim's email address; target issue in a public project
How it was found
- Log in as a victim user and create an issue in a public project.
- Log in as an attacker and clone a repository you own.
- Add a file and commit with the victim's email and a message referencing the target issue.
- Push the malicious commit to your repository.
- Observe that the issue in the victim's project is automatically closed.
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.
When you push code to a Git repository, each commit records an author name and email. GitLab has a feature that automatically closes issues if a commit message mentions them, and it trusts the commit author to decide who closed the issue. Because anyone can set any author email on a commit, an attacker can pretend to be someone else and close their issues.
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.