Repository navigation
Use GET with :developer strategy. - #1106
Merged
Merged
Conversation
The changes the default method of the :developer strategy to GET. It does this by allowing OmniAuth::Form to accept a `:method` option, which is optional and defaults to 'post', the current behavior. Because the default behavior remains unchanged, I don't expect this to introduct any breaking changes. This allows the developer strategy to work with the directions provided in the README. Further, it seems that the default action of most stratigies is to use GET for their callbacks. Fixes omniauth#1087 Fixes omniauth#1061 Fixes omniauth#957
Member
|
I'll get around to diagnosing the POST issue, but GET is not recommended for omniauth strategies as it is vulnerable to CVE-2015-9284 |
Contributor
Author
|
I am a bit confused though. The CVE discusses a POST to launch to the authentication provider, not the callback route. Today, as best I understand - and it is still true with this PR:* user clicks a POST form to be redirected to a login provider* provider does its stuff* provider redirects to /auth/:provider/callback via a GET* Omni auth/each state get validates the paeans to that request. Today, in Rails, if you want to accept the POST in the callback, you need to add a 2nd route not mentioned in the docs, and you need to add an controller hook to skip the token verification - which I think is understandable since it’s very easy for that hook to be too broad (though it likely won’t be a security issue since we do allow GETs). But unless I am wrong, basically every strategy I’ve used is fine with a GET callback - google, GitHub, Microsoft, a bunch of others. There are two other ways I could see fixing this:* the developer strategy from POSTs to some new internal route which is NOT the callback route. That route then redirects to the callback route with a GET. * we allow the rails CSRF gem to inject a CSRF token, generated by Rails unless the appropriate Rails config, so that Rails can validate it. You still have to configure your app to accept a POST callback, which feels odd just for development but it would work. Thanks for considering this! -- Michael BallFrom my iPhonemichaelball.coOn Mar 3, 2023, at 5:36 AM, Bobby McDonald ***@***.***> wrote:
Closed #1106.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Member
|
Sorry, you're correct, I only glanced at this PR and assumed it was altering the POST allowed actions |
Contributor
Author
|
No worries, thanks! I mean, the Development provider is definitely insecure as is, but hopefully it is clear this shouldn’t be used in production! Still, if there’s a better path, I’m happy to help. Sent from my iPadOn Mar 3, 2023, at 10:00 AM, Bobby McDonald ***@***.***> wrote:
Sorry, you're correct, I only glanced at this PR and assumed it was altering the POST allowed actions
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
BobbyMcWho
approved these changes
Apr 5, 2023
|
When there will be next stable release that includes this change? |
|
I would appreciate a 2.1.2 which contains this change. |
Member
Released |
Contributor
Author
|
Thanks very much! :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changes the default method of the :developer strategy to GET. It does
this by allowing OmniAuth::Form to accept a
:methodoption, which isoptional and defaults to 'post', the current behavior. Because the default
behavior remains unchanged, I don't expect this to introduct any breaking
changes.
This allows the developer strategy to work with the directions provided in
the README. Further, it seems that the default action of most stratigies is
to use GET for their callbacks.
Fixes #1087 Fixes #1061 Fixes #957