-
Notifications
You must be signed in to change notification settings - Fork 131
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
Occasional blackholes when sending a PM #2198
Comments
well, it took no more than five minutes to write the message, I think, and I didn't send the message right away, but I took a couple of minutes to check what I wrote to avoid mistakes. |
Finally found a way to reproduce this! Steps to reproduce
AnalysisRelevant nginx logs (formatted as timedate, request line, server response code, response length, referer)
This error happens because a security check fails on one of these data changing between form creation and form submission:
The only thing that can possibly trigger the error here is the session id. Session ids can be renewed in some specific cases, mainly everywhere we call tatoeba2/src/Controller/AppController.php Lines 151 to 158 in f5378fe
In the example above, Ctrl+click makes a GET request to the login page tatoeba2/src/Controller/UsersController.php Lines 241 to 244 in f5378fe
which, as a result, triggers a session id renewal. Basically updating your profile while sending a PM also triggers the error. As far as I can tell, the "remember me" auto-login feature also renews the session id, but that’s not very relevant to this issue. So this call to |
In #2820, I simply disabled Form Tampering Protection for the sentence comment form, so that the changed session ID doesn't cause any issues. At the time, I planned to do something similar for the private message form, but I didn't get around to thoroughly checking the security implications to make sure that that change is harmless. |
@Yorwba Maybe we could just stop storing the whole user record in the Auth component, so that most changes to a user profile/settings/last-login-time do not require calling
Although I suspect that most of these could be replaced by calls to the CurrentUser model. I suppose we should only be storing users fields that are relevant to login and permissions in the Auth component. Like id, username, password and role fields. Then it would make sense that any change to these fields (and these fields only!) would result in a session renewal. |
I just tried to reply to a PM I received and I just got the message that the request got blackholed, and the PM wasn't sent. I remember getting the same issue almost a couple of weeks ago.
EDIT = I noticed that sending PMs is pretty slow now, loading other Tatoeba pages is fine, though
NEW EDIT = now PMs are fine
The text was updated successfully, but these errors were encountered: