Skip to content
Access control Disclosed report Beginner

User Can Post Comment to Commit in Archived Project via API

An archived project is meant to be read-only, but the API still allowed a user to post a comment on a commit. An attacker could add comments to commits in an archived project despite the UI blocking this.

GitLab

Originally disclosed on GitLab

  • Fixed in 12 months
  • Disclosed after 12 months

HackerOne report #748209 by rafiem on 2019-11-29, assigned to @jeremymatos:

Hi Team,

i have found improper access control on archived projects. When a project is archived, the project become read-only, this mean that user cannot write data to the project (example : comment). There is no option and not able to comment a commit via UI. But, in this case, user still able to comment to commit via API endpoint

Proof of Concept

1.) User A have project, in this case i use the project : https://gitlab.com/bambangyera/huban
2.) User A make some commit to the project
3.) User A then archived the project
4.) User B then try to GET a commit sha of project via endpoint API : https://gitlab.com/api/v4/projects/15590107/repository/commits/
5.) After getting the sha of commit, User B then able to comment the commit via POST request with parameter note to API endpoint : https://gitlab.com/api/v4/projects/15590107/repository/commits/3edb58d71c6fd95f9fb834be1364d7cf901a02c1/comments

<>PoC video attached :

PoC.webm From the original on GitLab

Impact

Unauthorized user able to comment a commit in archived project

Best Regards,
[@]rafiem

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 API endpoint for posting commit comments did not check whether the project was archived, while the web interface did.

Impact

An unauthorised user could add comments to commits in an archived project, violating the read-only expectation.

What the attacker needed

A GitLab account; access to an archived project; ability to make API requests

How it was found

  1. User A creates a project and makes a commit.
  2. User A archives the project.
  3. User B retrieves a commit SHA via the API.
  4. User B sends a POST request with a note parameter to the commit comments API endpoint.

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 a project is archived, it is supposed to be frozen so nobody can change anything. The website correctly stopped people from commenting, but the API (the interface used by programs) still let them. This meant someone could still add comments even though the project was supposed to be locked.

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.