Deploy key with write access can force push a protected branch
Summary
A deploy key with write access can force push a protected branch.
Steps to reproduce
- Setup a deploy key with write access in a non-empty repository.
- Make sure (e.g.) the
masterbranch is protected (e.g. merge/push restricted to maintainer). - Amend a commit.
- Force push the diverged
masterusing the deploy key with write access.
Example Project
(Not project specific.)
What is the current bug behavior?
Branch is force-updated despite protection.
What is the expected correct behavior?
Forced push to protected branch should be denied.
Relevant logs and/or screenshots
(None.)
Output of checks
Observed both on GitLab.com and a hosted GitLab instance.
Results of GitLab environment info
(n/a)
Results of GitLab application Check
(n/a)
Possible fixes
No known fix.
Edited by Claas Augner