Skip to content
Access control Disclosed report Beginner

Project Maintainer can update description of triggers created by other maintainers in project

The GitLab API allowed a project maintainer to update the description of a pipeline trigger created by another maintainer, even though the web interface restricted editing to the trigger's creator. An attacker with maintainer access could therefore modify another maintainer's trigger description via the API.

GitLab

Originally disclosed on GitLab

  • Fixed in 2 months
  • Disclosed after 2 months

HackerOne report #770043 by ashish_r_padelkar on 2020-01-08, assigned to @jbroullon:

Summary

Hello,

The triggers created here at https://gitlab.com/<Group>/<Project>/-/settings/ci_cd in Pipeline triggers are editable only by maintainers who created it.

For eg. Project Maintainer1 created trigger is only editable by Maintainer1 and Maintainer2 is not allowed to edit the description of this trigger.

However, using API, it is possible to EDIT the description of this trigger by Maintainer2

Steps to reproduce

  1. Create a trigger using Maintainer1 at https://gitlab.com/<Group>/<Project>/-/settings/ci_cd in Pipeline triggers
  2. Login as Maintainer2 and go to https://gitlab.com/<Group>/<Project>/-/settings/ci_cd in Pipeline triggers and you will see that you dont have EDIT option to edit the trigger.
  3. Now use below API to EDIT the trigger description
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --form description="my description" "https://gitlab.example.com/api/v4/projects/<ID>/triggers/<ID>"  

Ref:https://docs.gitlab.com/ee/api/pipeline_triggers.html#update-a-project-trigger

Trigger ID can be obtain easily from the page using hover on delete button.

  1. Using above API will successfully change the description of trigger which is created by Maintainer1

What is the current bug behavior?

The project maintainers can update triggers created by other maintainers in project

What is the expected correct behavior?

Update API should not work for other maintainers in project

Output of checks

This bug happens on GitLab.com and might be on omnibus installations too!

Regards,
Ashish

Impact

The project maintainers can update the triggers created by other maintainers in same project. Note that there can be many maintainers in same projects but i have just given example of two for easy understanding.

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 update endpoint for pipeline triggers did not verify that the requesting maintainer was the creator of the trigger, unlike the web interface.

Impact

A project maintainer could change the description of another maintainer's pipeline trigger via the API, though the web interface prevented this.

What the attacker needed

Maintainer role in the project; A trigger created by another maintainer; API access token for the attacker

How it was found

  1. Create a trigger as Maintainer1 in the project's CI/CD settings under Pipeline triggers.
  2. Log in as Maintainer2 and confirm the web interface shows no edit option for that trigger.
  3. Send an API request to update the trigger description using Maintainer2's access token.
  4. Observe that the description of Maintainer1's trigger is successfully changed.

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.

In GitLab, a pipeline trigger is a token-like object that starts a CI/CD pipeline. The web page only let the person who created a trigger edit its description, but the API did not check who created it, so any maintainer could change it. This is a missing permission check on the API side.

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.