Skip to content
Access control Disclosed report Beginner

Unauthenticated users can see and download packages from public projects whose repositories are restricted

A public project with repositories restricted to team members still exposed its package list and downloadable files to unauthenticated users. An attacker could view and download packages without any authentication.

GitLab

Originally disclosed on GitLab

  • Fixed in 3 months
  • Disclosed after 3 months

HackerOne report #1419637 by ashish_r_padelkar on 2021-12-08, assigned to @rshambhuni:

Report | Attachments | How To Reproduce

Report

Summary

Hello,

I reported similar issue before #635502 and it was resolved.

Not sure if there are any changes afterwards but this issue is appearing again for me. The list of packages are visible (and also downloadable now) to any unauthenticated users even when public project has repositories restricted only to team members.

Steps to reproduce
  1. Create a public group and public project underneath.
  2. Go to project settings and set Repositories to be limited only to team members.
Screen_Shot_2021-12-08_at_2.01.10_PM.png
Screen_Shot_2021-12-08_at_2.01.10_PM.png From the original on GitLab
  1. Since Packages are part of repositories, they shouldn't be visible to users without access to group or project.
  2. Now browse the url unauthenticated https://gitlab.com/<GroupName>/<ProjectName>/-/packages and you will see the packages as well as you can download the files (which was not possible during #635502).
  3. The permissions are correctly enforced at group level though. You CAN NOT see packages at group level https://gitlab.com/groups/<GroupName>/-/packages.
Examples

You can browse my url unauthenticated https://gitlab.com/g3220/githubimport/-/packages and you will see list of packages and download the files inside it.

Repositories for that projects are restricted only to team members.

Permissions correctly enforced at group level https://gitlab.com/groups/g3220/-/packages

What is the current bug behavior?

Unauthenticated user can see and download packages of public projects whose repositories are restricted .

What is the expected correct behavior?

When repositories are restricted, users without access to project shouldn't see packages l.

Output of checks

This bug happens on GitLab.com

Regards,
Ashish

Impact

Unauthenticated users can see and download packages from public projects whose repositories are restricted

Attachments

Warning: Attachments received through HackerOne, please exercise caution!

How To Reproduce

Please add reproducibility information to this section:

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 access control check for packages did not properly inherit the repository restriction setting, allowing unauthenticated access at the project level while group-level checks worked correctly.

What the attacker needed

Public project with restricted repositories; no authentication required

How it was found

  1. Create a public group and a public project under it.
  2. In project settings, set Repositories to be limited to team members only.
  3. As an unauthenticated user, browse to the project's packages URL.
  4. Observe that the package list is visible and files can be downloaded.

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 public project on GitLab can have its code repositories restricted so only team members can see them. However, the packages (like software libraries) attached to that project were still visible to anyone, even without logging in. This means someone could see and download those packages despite the restriction.

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.