Skip to content

Commit 80ec947

Browse files
committed
fix: Patch CSRF vulnerability with omniauth authorization
Patches CVE-2015-9284 with https://github.com/cookpad/omniauth-rails_csrf_protection
1 parent 2669a67 commit 80ec947

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ gem 'devise', '~> 4.2'
4242
gem 'omniauth-mlh', '~> 0.1'
4343
gem 'doorkeeper', '~> 5.0'
4444
gem 'devise-doorkeeper'
45+
gem 'omniauth-rails_csrf_protection'
4546

4647
# User uploads
4748
gem "aws-sdk-s3", require: false

Gemfile.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ GEM
266266
omniauth-oauth2 (1.3.1)
267267
oauth2 (~> 1.0)
268268
omniauth (~> 1.2)
269+
omniauth-rails_csrf_protection (0.1.1)
270+
actionpack (>= 4.2)
271+
omniauth (>= 1.3.1)
269272
orm_adapter (0.5.0)
270273
popper_js (1.14.5)
271274
power_assert (1.1.4)
@@ -484,6 +487,7 @@ DEPENDENCIES
484487
mustache (~> 1.0)
485488
mysql2 (>= 0.4.4, < 0.6.0)
486489
omniauth-mlh (~> 0.1)
490+
omniauth-rails_csrf_protection
487491
puma (~> 3.11)
488492
rails (~> 5.2.2)
489493
rails-controller-testing

app/views/application/_my_mlh_cta.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%a.button.my-mlh-cta__button{href: user_mlh_omniauth_authorize_path}
1+
= link_to user_mlh_omniauth_authorize_path, class: 'button my-mlh-cta__button', method: :post do
22
%span.my-mlh-cta__text Continue with
33
%span.my-mlh-cta__image-wrapper
44
= image_tag 'my-mlh.svg', alt: 'My MLH', class: 'my-mlh-cta__image'
Binary file not shown.

0 commit comments

Comments
 (0)