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

VerifyAssertion does not fail when return URL with different parameter is provided. #174

Open
OndrishD opened this issue Jan 11, 2020 · 3 comments

Comments

@OndrishD
Copy link

There is a bug on line 994 in openid.js

The foreach iterator for query parameters is checking for different values on receivedReturnUrl and assertionUrl which is the same URL as receivedReturnUrl was constructed from assertionUrl. Therefore it always evaluate to FALSE and fails to detect if query parameters of return url are mismatched.

for (var param in receivedReturnUrl.query) {
    // THIS IS ALWAYS FALSE
    if (hasOwnProperty(receivedReturnUrl.query, param) && receivedReturnUrl.query[param] !== assertionUrl.query[param]) {
      return false;
    }
  }

I think the intended code was meant to be as follows:

for (var param in originalReturnUrl.query) {
    if (hasOwnProperty(receivedReturnUrl.query, param) && receivedReturnUrl.query[param] !== originalReturnUrl.query[param]) {
      return false;
    }
  }
@havard
Copy link
Owner

havard commented Jan 26, 2020

Yes, it seems you are correct. Would you care to make a PR? I'd be happy to review and pull.

@RomenPoirierTaksev
Copy link

Hello! im still having this issue today. Any chance I can open a PR and get this through?

@havard
Copy link
Owner

havard commented Jul 12, 2024

Sure!

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

3 participants