You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This could potentially be exploited for open redirect attacks where an attacker crafts a malicious OAuth login URL that redirects to an external site after authentication. While the impact is somewhat mitigated because it only affects post-authentication redirects, it could still be used for phishing attacks.
The original intent was to provide a convenient way to return users to their previous page after logging in, but the implementation needs proper validation.
To fix this, implement strict validation of the redirect path:
defsafe_redirect_path(path)returnroot_pathunlesspath.present?parsed_path=URI.parse(path)returnroot_pathunlessparsed_path.relative? && parsed_path.path.start_with?('/')pathrescueURI::InvalidURIErrorroot_pathend# In the create action:redirect_path=safe_redirect_path(request.env["omniauth.origin"]) || root_pathredirect_toredirect_path
This ensures the redirect can only go to paths within your application domain.
Note
This issue was created automatically by Revise as part of a routine security audit.
A pull request will be opened shortly to address this issue.
The text was updated successfully, but these errors were encountered:
In sessions_controller.rb (line 7-8), the code uses omniauth.origin as a redirect destination without validation:
This could potentially be exploited for open redirect attacks where an attacker crafts a malicious OAuth login URL that redirects to an external site after authentication. While the impact is somewhat mitigated because it only affects post-authentication redirects, it could still be used for phishing attacks.
The original intent was to provide a convenient way to return users to their previous page after logging in, but the implementation needs proper validation.
To fix this, implement strict validation of the redirect path:
This ensures the redirect can only go to paths within your application domain.
Note
This issue was created automatically by Revise as part of a routine security audit.
A pull request will be opened shortly to address this issue.
The text was updated successfully, but these errors were encountered: