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

External redirects allowed #3718

Closed
2 of 9 tasks
bengerman13 opened this issue Jul 17, 2019 · 5 comments · Fixed by #3933
Closed
2 of 9 tasks

External redirects allowed #3718

bengerman13 opened this issue Jul 17, 2019 · 5 comments · Fixed by #3933
Assignees
Labels
bug community Community Raised Issue in progress

Comments

@bengerman13
Copy link
Contributor

bengerman13 commented Jul 17, 2019

Frontend Deployment type

  • Cloud Foundry Application (cf push)
  • Kubernetes, using a helm chart
  • Docker, single container deploying all components
  • npm run start
  • Other (please specify below)

Backend (Jet Stream) Deployment type

  • Cloud Foundry Application (cf push)
  • Kubernetes, using a helm chart
  • Docker, single container deploying all components
  • Other (please specify below)

Expected behaviour

Stratos should validate redirects passed as query parameters on login

Actual behaviour

Stratos redirects to any url upon login

Steps to reproduce the behavior

  1. log in to stratos
  2. go to https://your stratos url/pp/v1/auth/sso_login?state=some url that is not stratos

Context

This is a security vulnerability.
An attacker could use a specially-crafted url that looks trusted to a user. When the user clicks on the url, they could be taken to a nefarious site. This can also make phishing attempts more convincing by using trusted urls.
More details on why this is bad available from OWASP

Possible Implementation

I think this is happening here: https://github.com/cloudfoundry-incubator/stratos/blob/v2-master/src/jetstream/auth.go#L196

I think the best implementation here is to have a whitelist of safe redirect hosts, or to not follow redirects from the url at all.

@richard-cox richard-cox added bug community Community Raised Issue labels Jul 18, 2019
@richard-cox
Copy link
Contributor

Hi @bengerman13 , thanks for raising this issue. This looks like something we should fix and will have a look in our next sprint (due to start next week).

@bengerman13
Copy link
Contributor Author

Thanks @richard-cox!

@siennathesane
Copy link

@richard-cox any update on this?

@nwmac
Copy link
Contributor

nwmac commented Aug 28, 2019

We plan to add an env var that specifies a whitelist of URLS that can be redirected to. This can be configured in the manifest or via env vars depending on how Stratos is deployed. We will check SSO redirects match this whitelist if one is set.

@mxplusb Seem reasonable?

@siennathesane
Copy link

Works for me! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug community Community Raised Issue in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants