Skip to content

Add state parameter on bitbucket import project oauth

Illya Klymov requested to merge 350336-confidential-issue into master

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

  1. Set up your GDK with bitbucket integration following our guidelines (omniauth configuration lives in config/gitlab.yml under development section
  2. Go to /projects/new#import_project, click "Bitbucket"
  3. Observe state parameter in bitbucket auth process
  4. Ensure that bitbucket auth was succesfull
  5. Logout (this is required to clear session)
  6. Go to /projects/new#import_project, click "Bitbucket"
  7. Hijack link used for auth (easiest way is by putting your browser to offline mode and modify URL in the browser)
  8. 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.

Edited by Illya Klymov

Merge request reports

Loading