Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

XSS and Open Redirect #1332

Closed
alboxie opened this issue Aug 22, 2019 · 4 comments · Fixed by #1342
Closed

XSS and Open Redirect #1332

alboxie opened this issue Aug 22, 2019 · 4 comments · Fixed by #1342
Labels

Comments

@alboxie
Copy link

alboxie commented Aug 22, 2019

Version:
>= 0.1.33

Routes:
/omniauth/failure

Description:

  • The omniauth failure endpoint is vulnerable to Reflected XSS through the message parameter.
    Unauthenticated attackers can craft a URL that executes a malicious JavaScript payload in the victim’s browser.
  • The same endpoint is also vulnerable to an Open Redirect through the auth_origin_url parameter. Unauthenticated attackers can craft a URL that sends users to a malicious site to phish credentials or launch additional attacks.

URLs to reproduce:

  • The following URL should trigger a JS alert with the XSS message.
    https://site/omniauth/failure?message=<script>alert('XSS')</script>&omniauth_window_type=sameWindow&resource_class=User

  • The following URL should redirect to google.
    https://site/omniauth/failure?message=failure&omniauth_window_type=sameWindow&resource_class=User&auth_origin_url=http://www.google.com

Reason:
The render_data_or_redirect method and fallback_render methods in app/controllers/devise_token_auth/omniauth_callbacks_controller.rb are using untrusted input to build the redirect and render the error message.

Remediation:

@alboxie
Copy link
Author

alboxie commented Sep 24, 2019

The XSS vulnerability has been assigned CVE-2019-16751

@booleanbetrayal
Copy link
Collaborator

Hadn't seen this before today. =[

Have a PR in the mix, but it could probably use specs.

@booleanbetrayal
Copy link
Collaborator

Thanks for the visibility on this @alboxie

@booleanbetrayal
Copy link
Collaborator

This was pushed to RubyGems as 1.1.3 - https://rubygems.org/gems/devise_token_auth/versions/1.1.3

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants