Transferred group to new owner / namespace - Allowing unauthorized SSO, SCIM token misused, and other issues!
When a group with SAML SSO and SCIM is transferred to a new namespace as a child group, the SSO settings become invisible but the previous configuration still works. This allows a removed owner to regain owner access via SSO, the SCIM token to be misused to create users, and paid features to be used on a free plan.
GitLab
Originally disclosed on GitLab
- Fixed in under an hour
- Disclosed after under an hour
HackerOne report #1258092 by vaib25vicky on 2021-07-12:
Report | Attachments | How To Reproduce
Report
Summary
Group with SAML SSO when transferred to new namespace as a child group then group SAML SSO setting options become invisible.
But all the previous config still works such as SSO and SCIM token
This bug can be exploited for three things
-
Previous owner transferred the group to private namespace, he got kicked out of the new group but he can again SSO into the group with owner permission
New owner can't stop him because SSO settings are invisible -
Billing is associated with the parent group so when the group with SAML SSO transfer to the parent group on free plan, SSO still works and allows paid feature group SAML SSO and SCIM to use as free
-
Since, group SAML SSO becomes invisible SCIM token can longer be reset so in case when SCIM token is known to previous users or got leaked
then token can be used to create new users in the group with higher permissions
Steps to reproduce
SCIM Token
This is much simple poc and suggested to use for quick triage!
- set-up group sso and creates SCIM token
- transfer the group to a new namespace/group as child group
- child group saml sso setting becomes invisible
- use the token to creates a new user (https://docs.gitlab.com/ee/api/scim.html#create-a-scim-provisioned-user)
curl --verbose --request POST "https://gitlab.com/api/scim/v2/groups/<group_path>/Users" \
--data '{"externalId":"test_uid","active":null,"userName":"username","emails":[{"primary":true,"type":"work","value":"[email protected]"}],"name":{"formatted":"Test User","familyName":"User","givenName":"Test"},"schemas":["urn:ietf:params:scim:schemas:core:2.0:User"],"meta":{"resourceType":"User"}}' \
--header "Authorization: Bearer <your_scim_token>" --header "Content-Type: application/scim+json"
User will be successfully created
SSO into new private group
- set up group sso and generate scim token
- transfer the group as a child group in different namespace (private group)
- remove previous owner, he can't access the private group
- change your idP config of the saml and replace old group path to the new one
- go the saml auth url directly and intercept the request
- change the path parameter with the new namespace
- continue the authorization process
On success, previous owner will again gain owner permission in the new private group where he didn't have any access initially
Impact
Old SAML SSO still active so users part of the idP can still SSO into new private group which belongs to different owners
Previous kicked out owner can again become owner and new owner can't stop because saml settings are invisible
Billing is associated with the parent group so when the group with SAML SSO transfer to the parent group on free plan, SSO still works and allows paid feature group SAML SSO and SCIM to use as free
Since, group SAML SSO becomes invisible SCIM token can longer be reset so in case when SCIM token is known to previous users or got leaked
then token can be used to create new users in the group with higher permissions
Thanks!
Attachments
Warning: Attachments received through HackerOne, please exercise caution!
How To Reproduce
Please add reproducibility information to this section:
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 group transfer does not clear or disable the existing SAML SSO and SCIM configuration, and the UI hides the settings without removing the underlying functionality.
Impact
A previous owner could regain owner access to a private group, the SCIM token could be used to create users with higher permissions, and paid SSO/SCIM features could be used on a free plan.
What the attacker needed
Group with SAML SSO and SCIM configured; ability to transfer the group; SCIM token known or leaked
How it was found
- Set up group SSO and create a SCIM token.
- Transfer the group to a new namespace/group as a child group.
- Observe that the child group's SAML SSO settings become invisible.
- Use the SCIM token to create a new user via the SCIM API.
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.
SAML SSO is a way to log in using an external identity provider. SCIM is a system for automatically creating user accounts. The report shows that after moving a group, the old login and user-creation settings still worked even though they were hidden, letting someone who should have lost access get back in.
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.