Not sure if we're supposed to have one mega-thread for bug reports but I'll post this a separate thread as this bug seems horrible enough.
I was testing epochtalk moderator functions related to this:
https://bitcointalksearch.org/topic/m.55430312So I logged in as a regular user (let's call the user "suchmoon", complete coincidence of course), opened two browser tabs (using Firefox; as I've
reported previously it's impossible to open multiple tabs with the same user in Tor Browser), created a few posts. Then in tab 1 I logged out and logged in as an admin. A few minor things here: can't report my own post and seemingly can't just delete a post without it being reported, but that's not the issue here.
So I'm doing admin things in tab 1. Then switch to tab 2. Still shows me logged in as suchmoon. I click on a thread. I post in the thread. It still shows me logged in as suchmoon but the post's author is admin. I can report the post though so I do. I switch back to tab 1 and in the report queue it shows that the post was created by admin and reported by suchmoon. Keep in mind that both posting and reporting took place in one tab where the logged in user was shown as suchmoon. I have a feeling that there might be some API calls where the backend just trusts whatever user ID is coming through...
or maybe not quite as bad, maybe just expired but otherwise valid authentication is being accepted. A bug in either case.Edit - upon further digging it looks that the frontend sends the correct JWT bearer token in both tabs but the backend uses reporter_user_id from the payload. I don't know why that reporter_user_id is even there.