Skip to content

Warn only on GET requests for a login path - #1041

Merged
BobbyMcWho merged 1 commit into
omniauth:masterfrom
charlie-wasp:fix/get-request-warning
Apr 7, 2021
Merged

BobbyMcWho merged 1 commit into
omniauth:masterfrom
charlie-wasp:fix/get-request-warning

Conversation

@charlie-wasp

@charlie-wasp charlie-wasp commented Mar 31, 2021 •

Copy link
Copy Markdown
Contributor

This is a fix for warning logging brought up in #1010 (comment)

The problem is that currently warning message is logged on every GET request, not only for a login path. Such messages can bloat application logs very fast

Also, it contradicts this particular piece of documentation (source):

Because using GET for login poses concerns (see OWASP Cheatsheet), after upgrading OmniAuth will log a :warn level log with every GET request to a login path when your OmniAuth.config.allowed_request_methods include :get.

@charlie-wasp
charlie-wasp force-pushed the fix/get-request-warning branch from 7a5605d to b72a8db Compare March 31, 2021 08:03
@charlie-wasp charlie-wasp changed the title Warn only on GET requests for auth paths Warn only on GET requests for a login path Mar 31, 2021
@charlie-wasp

Copy link
Copy Markdown
Contributor Author

There is a couple of failed jruby builds, and I actually don't know, what can I do about them. They fail yet on the ruby setup, my code isn't involved, I could guess

@sponomarev sponomarev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@BobbyMcWho BobbyMcWho left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay on this, was there something that you found during testing that made on_request_path? a better choice than on_auth_path?. I'd lean towards using the latter if not

@charlie-wasp

Copy link
Copy Markdown
Contributor Author

@BobbyMcWho no particular research was made on this matter. Reason for choosing request_path is only current docs – it says "login path", and on_auth_path? returns true for callback path too AFAIK

@BobbyMcWho

Copy link
Copy Markdown
Member

@BobbyMcWho no particular research was made on this matter. Reason for choosing request_path is only current docs – it says "login path", and on_auth_path? returns true for callback path too AFAIK

I think we will want to log on the callback path as well, so I'd prefer the on_auth_path?

@charlie-wasp

Copy link
Copy Markdown
Contributor Author

@BobbyMcWho but original CVE states, that request path is vulnerable to CSRF attacks, it says nothing about callbacks. Besides that, correct me, if I'm wrong, but GET-request is acceptable for callback URI, since user is redirected there?

@BobbyMcWho
BobbyMcWho merged commit f0e5d42 into omniauth:master Apr 7, 2021
@BobbyMcWho

Copy link
Copy Markdown
Member

This has been released in v2.0.4

@charlie-wasp

Copy link
Copy Markdown
Contributor Author

Thanks @BobbyMcWho! Really appreciated such a quick feedback

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

Successfully merging this pull request may close these issues.

3 participants