Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Security: password reset email host injection #601

Closed
platypii opened this issue Feb 22, 2017 · 2 comments
Closed

Security: password reset email host injection #601

platypii opened this issue Feb 22, 2017 · 2 comments

Comments

@platypii
Copy link
Contributor

It is possible for an attacker to trigger securesocial to send an authentic password reset email to a user, but with a malicious link included.

Steps:

  1. Fill out reset password form with victim's email address
  2. Intercept or modify outgoing request, add http header "Host: evildomain.com"
  3. Send POST request to securesocial
  4. Victim will receive an email with a link to reset their password, but pointed at evildomain.com

This happens because RoutesService.scala:115 uses Call.absoluteURL, which will pick up the domain from the Host field.

@platypii
Copy link
Contributor Author

It's worth mentioning that this allows evildomain.com to receive the password reset token, and therefore could reset the password of anyone who clicks the link.

@jaliss jaliss closed this as completed in 44193d5 Mar 10, 2017
@jaliss
Copy link
Owner

jaliss commented Mar 10, 2017

@platypii thanks a lot for reporting this. I added 2 properties that let you configure the host and port of the application. From RoutesService I'm now using a version of Call.absoluteURL that receives the host/port instead of picking it up from the Host header.

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

No branches or pull requests

2 participants