GitLab master branch is missing MRs from last security release: Access to package list of restricted projects
A security fix for a package list access control issue was applied to stable branches but not to the master branch, leaving the master branch vulnerable. An unauthenticated user could view the package list of a restricted project via the group's package list endpoint.
GitLab
Originally disclosed on GitLab
- Fixed in 11 days
- Disclosed after 11 days
HackerOne report #731508 by xanbanx on 2019-11-07, assigned to @cmaxim:
Hi GitLab Security Team,
Summary
In the latest security release, GitLab fixed a vulnerability where non-project members of restricted projects could read the package list via the group's package list.
While this has been fixed in GitLab 12.4.2, the master branch of GitLab does not contain this fix, and thus is still vulnerable.
The fact, that a security fix is missing the master branch is quite critical as this now basically created a Zero-Day.
While the vulnerability itself is Low, I flag this as a Medium severity because it seems to be a problem in the process of creating a security release that the fix to master was missing.
In particular, the following MR is missing: https://gitlab.com/gitlab-org/gitlab/commit/786b4dd2426aaee18e4337302be04bdf0972de23
Steps to reproduce
- Create a public group
- Inside of that group, create a public project and restrict the repository to project members only
- Push a package
- As an unauthenticated user visit the groups package list, which leaks the package of the previous step.
Impact
First, unauthorized users have access to the package list.
Second, this created a Zero-Day, which can be much worse for a more critical vulnerability.
This is flagged as Medium because there seems to be an issue how security fixes are merged internally and it can be the case that partial security fixes are merged.
There must be automated infrastructure, which ensures that security fixes which are merged to stable branches are also merged to master.
What is the current bug behavior?
Unauthorized users have access to the package list. And Security fixes are backported but not included in the master branch.
What is the expected correct behavior?
If user does not have access to the repo, it cannot view the package list via the groups endpoint.
It cannot be the case that a security fix is merged but only to stable branches without the master branch.
Relevant logs and/or screenshots
Results of GitLab environment info
System information
System: Ubuntu 18.04
Proxy: no
Current User: git
Using RVM: no
Ruby Version: 2.6.3p62
Gem Version: 2.7.9
Bundler Version:1.17.3
Rake Version: 12.3.3
Redis Version: 3.2.12
Git Version: 2.22.0
Sidekiq Version:5.2.7
Go Version: unknown
GitLab information
Version: 12.5.0-pre
Revision: b633727c47d
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: PostgreSQL
DB Version: 10.9
URL: https://example.gitlab.com
HTTP Clone URL: https://example.gitlab.com/some-group/some-project.git
SSH Clone URL: [email protected]:some-group/some-project.git
Elasticsearch: no
Geo: no
Using LDAP: no
Using Omniauth: yes
Omniauth Providers:
GitLab Shell
Version: 10.2.0
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell
Git: /opt/gitlab/embedded/bin/git
Best regards,
Xanbanx
Impact
See above.
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 a process failure where the security fix was merged only to stable branches and not to the master branch.
Impact
Unauthorised users could access the package list of a restricted project, and the missing fix on master created a zero-day condition.
What the attacker needed
A public group; a public project with repository restricted to members; at least one package pushed; unauthenticated access
The fix
The fix should be merged to the master branch as well, and automated checks should ensure security fixes reach master.
How it was found
- Create a public group
- Inside the group, create a public project and restrict the repository to project members only
- Push a package to the project
- As an unauthenticated user, visit the group's package list, which shows the package from the previous step
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 security fix was made in a released version of GitLab, but the main development version (master branch) did not get the same fix. This means the main version still had the bug, so anyone could see a list of software packages for a project that was supposed to be private.
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.