Add state parameter on bitbucket import project oauth
What does this MR do and why?
Related to #350336 (closed)
This MR introduces state
param for bitbucket oauth and verification that same state is passed back to avoid attacker passing link and linking attacker account to victim
Screenshots or screen recordings
https://watch.screencastify.com/v/4pSCPGk2SfNvDwuG5n5B
How to set up and validate locally
- Set up your GDK with bitbucket integration following our guidelines (omniauth configuration lives in
config/gitlab.yml
underdevelopment
section - Go to
/projects/new#import_project
, click "Bitbucket" - Observe
state
parameter in bitbucket auth process - Ensure that bitbucket auth was succesfull
- Logout (this is required to clear session)
- Go to
/projects/new#import_project
, click "Bitbucket" - Hijack link used for auth (easiest way is by putting your browser to offline mode and modify URL in the browser)
- Observe that auth fails and you're redirected again to bitbucket auth
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Illya Klymov