StrangeOne101 / BB-Team-Section-Camp

The website for the 2017 Boys Brigade "Team Section Camp"
0 stars 0 forks source link

Cannot download CSV from view page when admin session times out #11

Open StrangeOne101 opened 6 years ago

StrangeOne101 commented 6 years ago

Issue

When logged into the admin panel and your session times out, you will be unable to download CSV files from viewing pages.

How to Replicate

  1. Log into the admin panel
  2. Open registration viewer page of a company
  3. Wait for the session to time out (unknown how long this is - probably around an hour)
  4. Try to download the CSV. In the CSV there will be an error

Cause

This is an issue with how dbquery.php validates the request from the user. It checks to see if you are logged in, and if you are, it uses those credentials. If not, it checks to see if you are using a token (e.g. from a registration viewer page). However, when the session times out, it fails the permission check because you are no longer validated, but the session also still exists.