Skip to content

Group Maintainers are able to use the Group CI/CD Variables API

Summary

Group Maintainers are able to use the Group CI/CD Variables API. According to our permissions model, this action should be limited to Group Owners. Thus is a critical elevation of user permissions.

Steps to reproduce

curl --request POST --header "PRIVATE-TOKEN: $GROUP_MAINTAINER_TOKEN" "https://gitlab.com/api/v4/groups/$GROUP_ID/variables" --form "key=maintainertest" --form "value=test"

What is the current bug behavior?

Group Maintainers are able to manage Group-level CI/CD variables using the API.

What is the expected correct behavior?

Only Group Owners should be able to manage Group-level CI/CD variables.

Relevant logs and/or screenshots

curl --request POST --header "PRIVATE-TOKEN: $GROUP_MAINTAINER_TOKEN" "https://gitlab.com/api/v4/groups/$GROUP_ID/variables" --form "key=maintainertest" --form "value=test"
{"variable_type":"env_var","key":"maintainertest","value":"test","protected":false,"masked":false}%

expected

curl --request POST --header "PRIVATE-TOKEN: $GROUP_MAINTAINER_TOKEN" "https://gitlab.com/api/v4/groups/$GROUP_ID/variables" --form "key=maintainertest" --form "value=test"
{"message":"403 Forbidden"}

Output of checks

This bug happens on GitLab.com