-
Notifications
You must be signed in to change notification settings - Fork 96
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
Add check for GET and POST globals for state validation #707
Conversation
b53d360
to
a1bb712
Compare
@@ -639,6 +639,12 @@ protected function query_vars( $key ) { | |||
if ( isset( $_REQUEST[ $key ] ) ) { | |||
return $_REQUEST[ $key ]; | |||
} | |||
if ( isset( $_GET[ $key ] ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this function only used in the WP_Auth0_LoginManager above?
I'm wondering if now accepting values from GET or POST as well as the previous objects opens up any kind of exploits. i.e. Perhaps we were validating some parameter we got posted back from auth but now the user could pre-inject a value on the URL so when we get redirected back we take the value from there rather than from the POST...
I think this function is a bit dangerous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this function only used in the WP_Auth0_LoginManager above?
Yes, protected.
I totally understand your concerns here and thought about implications. It's used to:
- Get an
auth0
parameter, which just triggers callback processing - Checks for a state param, which is validated one time against a stored value
- Gets a code parameter which is exchanged immediately for tokens
The existing checks can only be internally set in WordPress, the ones I'm adding would just roll up into those if they are present (if everything goes according to plan) so no additional risk added here.
I'll address this in the upcoming, I agree that we should be looking for these values only where we expect them.
Changes
Add checking for state in other PHP globals in case
$_REQUEST
is not set.Testing
Checklist