Closed FLX-0x00 closed 3 months ago
Are you using protect_from_forgery with: :null_session
(or with no :with
)? That would cause the request to proceed just with an empty session.
Yes, I agree rodauth-omniauth should handle this, probably by converting it into a 4xx error 👍🏻
protect_from_forgery does not cover GET or HEAD requests, so I don't think this would be an impact. We use it with only small exceptions for the API. Is there anything you need from us to debug that?
I don't think that authenticity token plays a role here, because as you said CSRF protection isn't activated on GET/HEAD requests. The scenario that triggers this error seems to be making a GET request to the request phase, while only POST requests are allowed. In this case, the OmniAuth app will not handle the request, but omniauth.auth
won't be set either.
I just pushed a fix to master, would you mind testing it out and let me know if it fixes the issue? I will then publish a release shortly.
@janko Thank you! The 5xx is gone and I receive a 404 with the github master branch. Awesome.
Great, just released 0.4.0 with these changes 🙂
We got a lot of 5xx errors on our application whem people try to manipulate the
authenticity_token
parameter and submit an invalid one on our OAuth rodauth rails implementations. I think the error handling of the function should be more resistent and never raise a 5xx error. Is it possible to catch this type of errors? Would be very awesome to get this type of errors away from our logs.