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

password reset link security vulnerability #447

Open
tcnichol opened this issue Apr 19, 2024 · 6 comments
Open

password reset link security vulnerability #447

tcnichol opened this issue Apr 19, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@tcnichol
Copy link
Contributor

tcnichol commented Apr 19, 2024

Host Header Injection: By capture the POST request for a password reset sent
to https://cpmr.tacc.utexas.edu/reset, a malicious user can edit the Host
entry in the header. This will modify the password reset link sent to the user
to direct them to the attacker's site.

@tcnichol tcnichol added the bug Something isn't working label Apr 19, 2024
@tcnichol tcnichol self-assigned this Apr 19, 2024
@tcnichol
Copy link
Contributor Author

This may fix the issue. Need to upgrade secure social.
jaliss/securesocial#601

@longshuicy
Copy link
Member

longshuicy commented Apr 29, 2024

@lmarini and I brainstormed some possible fix:

  1. instead of directly using "@securesocial.core.providers.utils.RoutesHelper.signUp(token).absoluteURL(IdentityProvider.sslEnabled)" compare this link with the host name to see if they match
    2. use the "host_ip" environment variable or introduce another hostname environment variable
  2. when compare, if doesn't match, replace the hostname with that

In below places:

<a href="@securesocial.core.providers.utils.RoutesHelper.resetPassword(token).absoluteURL(IdentityProvider.sslEnabled)">

and

<a href="@securesocial.core.providers.utils.RoutesHelper.signUp(token).absoluteURL(IdentityProvider.sslEnabled)">link</a> to complete your registration

@longshuicy
Copy link
Member

Host_IP see here:

hostIp = "localhost"

In the .html template, here is an example of how you get variable (e.g. sortInMemory)

@if(play.Play.application().configuration().getBoolean("sortInMemory")) {

play.Play.application().configuration().getBoolean("sortInMemory")

@robkooper
Copy link
Member

robkooper commented Apr 29, 2024

Problem is that the hostIp is almost never set, this was a hack for one of the previewers. Since the URL can change we tried to not hardcode this in the configuration.

The following code try to see what the URL should be.

https://github.com/clowder-framework/clowder/blob/develop/app/util/RequestUtils.scala#L15

https://github.com/clowder-framework/clowder/blob/develop/app/controllers/Utils.scala#L18

@longshuicy
Copy link
Member

Problem is that the hostIp is almost never set, this was a hack for one of the previewers. Since the URL can change we tried to not hardcode this in the configuration.

The following code try to see what the URL should be.

https://github.com/clowder-framework/clowder/blob/develop/app/util/RequestUtils.scala#L15

https://github.com/clowder-framework/clowder/blob/develop/app/controllers/Utils.scala#L18

Maybe it's time we introduce another config variables? The idea is we need to have control on the host in the email sent out to avoid host header injection.. i think...

@longshuicy
Copy link
Member

Problem is that the hostIp is almost never set, this was a hack for one of the previewers. Since the URL can change we tried to not hardcode this in the configuration.

The following code try to see what the URL should be.

https://github.com/clowder-framework/clowder/blob/develop/app/util/RequestUtils.scala#L15

https://github.com/clowder-framework/clowder/blob/develop/app/controllers/Utils.scala#L18

I think the similar idea of getBaseUrlAndProtocol triggered this bug report in the first place? That's a known bug in secure social: jaliss/securesocial#601

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants