Skip to content

Commit 80d75bf

Browse files
committed
CSRF vulnerability, injecting state in session
PoC https://gist.github.com/3673012
1 parent 74a15ad commit 80d75bf

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/omniauth/strategies/oauth2.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ def request_phase
4949
end
5050

5151
def authorize_params
52-
if options.authorize_params[:state].to_s.empty?
53-
options.authorize_params[:state] = SecureRandom.hex(24)
54-
end
52+
options.authorize_params[:state] = SecureRandom.hex(24)
5553
params = options.authorize_params.merge(options.authorize_options.inject({}){|h,k| h[k.to_sym] = options[k] if options[k]; h})
5654
if OmniAuth.config.test_mode
5755
@env ||= {}

0 commit comments

Comments
 (0)