google / ctfscoreboard

Scoreboard for Capture The Flag competitions.
Apache License 2.0
164 stars 61 forks source link

Site freezing when submitting answer #269

Open mrmmarcell opened 4 years ago

mrmmarcell commented 4 years ago

I noticed an issue when submitting answers for challenges on certain browsers the site freezes and becomes unresponsive, forcing the browser to terminate. This happens in: Chrome 78.0.3904.108 on Windows 10 MS Edge 42.17134.1098.0 Tried fixing it but got lost in the recursion, seems like in _tryProofOfWork the params variable is never defined under Chrome, the execution never reaches testbits and gets stuck a loop. Also debugged with Burp the api call is not issued before the freeze.

mrmmarcell commented 4 years ago

Okay after a few hours of debugging I managed to find a workaround. If you set PROOF_OF_WORK_BITS to zero in the config.py file it basically turns off the proofofwork token feature and the browser doesn't get stuck in a loop. You do have to restart the server and hit a few Crtl-F5s in the browser after setting it because the js gets cached. So add this to config.py: PROOF_OF_WORK_BITS = 0

Matir commented 4 years ago

Sorry I didn't get to this sooner. I can't seem to reproduce the issue on Chrome 80.

Setting PROOF_OF_WORK_BITS to 12 results in hashing times of ~1-2s per time.