mirror of
https://github.com/zulip/zulip.git
synced 2025-11-08 16:01:58 +00:00
Apparently, Django's CSRF protection mechanism changed at some point, and now we get a different CSRF token every time the webapp is loaded. This, in turn, caused our reload logic to avoid losing state to be completely ineffective, since the CSRF check in reload.initialize always failed. We fix this in a secure fashion by passing the reload instructions from the browser to its reloaded self via localstorage, keyed by a randomly generated token. The token randomization is primarily relevant for handling several Zulip tabs in the same browser, but also servers to make it very difficult for an attacker to ever trigger this code path by redirecting a browser to `/#reload` URLs. Fixes #3411. Fixes #3687.
10 KiB
10 KiB