Job information is leaked to unauthorized users via the Runner Jobs API endpoint
The Runner Jobs API endpoint lacked access control, allowing a user who had previously been a maintainer of a project to continue accessing job information for private projects after being removed. An attacker could view jobs, pipelines, and namespace details of private projects they no longer had permission to access.
GitLab
Originally disclosed on GitLab
- Fixed in 17 months
- Disclosed after 17 months
HackerOne report #1092199 by vaib25vicky on 2021-02-01, assigned to @rchan-gitlab:
Report | How To Reproduce
Report
Summary
The past report https://gitlab.com/gitlab-org/gitlab-foss/-/issues/53032 is not considered a security issue because
as per this https://gitlab.com/gitlab-org/gitlab-foss/-/issues/53032#note_110938617
Even if we restricted that endpoint, it wouldn't matter because who owns the runner will still be able to access private repo source code, jobs handled by the runner, etc.
But I've found that this is a valid security issue in different cases such as
- Owner of the runner user A , enabled specific runner to be used by other maintainers of the project
- user B add the runner to their project, now as mentioned this is not a security issue because user B knows that user A owns runner and they can access the Jobs/Pipelines/namespace etc.
- BUT this becomes a security issue when the user A removes the user B from the project then user B can also access the endpoint
/runners/:id/jobsand access user A private projects jobs/Pipelines/namespace. - In this case user B is not the owner of the runner
There should be access control on the endpoint /runners/:id/jobs. There may be more such cases.
Impact
Private Projects' Jobs/Pipelines/namespace etc are leaked to Specific Runner Jobs API endpoint due to missing access control on the endpoint /runners/:id/jobs
How To Reproduce
UserAcreatesProjectAand addsUserBas maintainerUserAcreates a specificrunnerAforProjectAand allows it to be assigned to other projectsUserBcreates a public project and enablesrunnerAon itUserBis removed fromProjectA
THE ISSUE:
5. UserB can access current and future private projects from the endpoint /runners/:id/jobs because they are still considered owner of runnerA
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 endpoint /runners/:id/jobs did not verify that the requesting user still had access to the projects associated with the runner, only that they were considered an owner of the runner.
Impact
Private projects' jobs, pipelines, and namespace information could be leaked to a user who is no longer a member of the project.
What the attacker needed
UserA creates a project and adds UserB as maintainer; UserA creates a specific runner and allows it to be…; UserB creates a public project and enables the runner; UserB is removed from the original project
How it was found
- UserA creates ProjectA and adds UserB as maintainer
- UserA creates a specific runnerA for ProjectA and allows it to be assigned to other projects
- UserB creates a public project and enables runnerA on it
- UserB is removed from ProjectA
- UserB can access current and future private projects from the endpoint /runners/:id/jobs because they are still considered owner of runnerA
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 runner is a service that runs jobs for a project. The report shows that a user who was removed from a project could still see the jobs of that project through a specific API endpoint because the endpoint did not check if the user still had permission.
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.