Non members can add spent time and reset spent time from issues created by themselves- API
Non-members of a public project could add or reset spent time on issues they created via the API, even though the UI restricts this to project members. An attacker could manipulate time tracking data on their own issues.
GitLab
Originally disclosed on GitLab
- Fixed in 5 months
- Disclosed after 5 months
HackerOne report #755188 by ashish_r_padelkar on 2019-12-10, assigned to @ankelly:
Summary
Hello,
As per this https://docs.gitlab.com/ee/user/project/time_tracking.html
Adding time entries (time spent or estimates) is limited to project members
However, if the issue is created by non members themselves in a public project, they can add spent time and reset the spent time using APIs
https://docs.gitlab.com/ee/api/issues.html#add-spent-time-for-an-issuehttps://docs.gitlab.com/ee/api/issues.html#reset-spent-time-for-an-issue
Steps to reproduce
- Create a issue as a non member in public project.
- If you try to use quick actions like
/Spend, it wont work - Now try below API
curl --request POST --header "PRIVATE-TOKEN: <Token>" https://gitlab.com/api/v4/projects/<ProjectID>/issues/<YourIssueID>/add_spent_time?duration=1h
This will add 1h to your own issue
- You can also RESET the time spent by project members using below API as a non member.
curl --request POST --header "PRIVATE-TOKEN: <Token>" https://gitlab.com/api/v4/projects/<ProjectID>/issues/<YourIssueID>/reset_spent_time
What is the current bug behavior?
Allows non members to add/remove spent time on issues created by them
What is the expected correct behavior?
These 2 actions shouldn't be allowed using API too for non members
Output of checks
This bug happens on GitLab.com and might be on omnibus installations too. This is tested on gitlab.com
Regards,
Ashish
Impact
Non members can add/remove spent time on issues created by themselves using API
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 endpoints for adding and resetting spent time did not check project membership, only issue ownership.
Impact
Non-members could add or remove spent time on issues they created, potentially corrupting time tracking data.
What the attacker needed
Public project; non-member account; create an issue
How it was found
- Create an issue as a non-member in a public project.
- Try using the quick action /Spend, which does not work.
- Use the API to add spent time to your own issue.
- Use the API to reset spent time on your own issue.
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, time tracking on issues is meant to be limited to project members. However, the API did not enforce this rule for issues created by non-members, so anyone who created an issue could change its time tracking data.
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.