moloch-- / RootTheBox

A Game of Hackers (CTF Scoreboard & Game Manager)
http://root-the-box.com/
Apache License 2.0
908 stars 292 forks source link

404 error registering users #574

Closed PJNorrisS1 closed 1 year ago

PJNorrisS1 commented 1 year ago

Brand new box - register a user and get a 404 glitch in matrix straight after. Email validation is on and set up. The user is created, and can log in without any validation.

archivetesting-webapp-1     | [I 230623 12:53:28 web:2344] 101 GET /connect/notifications/updates (86.xxx.58) 0.68ms
archivetesting-webapp-1     | [E 230623 12:53:43 web:1871] Uncaught exception POST /registration (86.xxxx8)
archivetesting-webapp-1     |     HTTPServerRequest(protocol='https', host='archivetexxxx.io', method='POST', uri='/registration', version='HTTP/1.1', remote_ip='86.xxxxx8')
archivetesting-webapp-1     |     Traceback (most recent call last):
archivetesting-webapp-1     |       File "/usr/local/lib/python3.8/site-packages/tornado/web.py", line 1784, in _execute
archivetesting-webapp-1     |         result = method(*self.path_args, **self.path_kwargs)
archivetesting-webapp-1     |       File "/opt/rtb/handlers/PublicHandlers.py", line 415, in post
archivetesting-webapp-1     |         user = self.create_user()
archivetesting-webapp-1     |       File "/opt/rtb/handlers/PublicHandlers.py", line 562, in create_user
archivetesting-webapp-1     |         self.send_validate_message(user)
archivetesting-webapp-1     |       File "/opt/rtb/handlers/PublicHandlers.py", line 645, in send_validate_message
archivetesting-webapp-1     |         emailtoken.value = sha256(email_token).hexdigest()
archivetesting-webapp-1     |     TypeError: Unicode-objects must be encoded before hashing
archivetesting-webapp-1     | [E 230623 12:53:43 BaseHandlers:196] Request from 86.10.128.58 resulted in an error code 500:
archivetesting-webapp-1     |     Traceback (most recent call last):
archivetesting-webapp-1     |       File "/usr/local/lib/python3.8/site-packages/tornado/web.py", line 1784, in _execute
archivetesting-webapp-1     |         result = method(*self.path_args, **self.path_kwargs)
archivetesting-webapp-1     |       File "/opt/rtb/handlers/PublicHandlers.py", line 415, in post
archivetesting-webapp-1     |         user = self.create_user()
archivetesting-webapp-1     |       File "/opt/rtb/handlers/PublicHandlers.py", line 562, in create_user
archivetesting-webapp-1     |         self.send_validate_message(user)
archivetesting-webapp-1     |       File "/opt/rtb/handlers/PublicHandlers.py", line 645, in send_validate_message
archivetesting-webapp-1     |         emailtoken.value = sha256(email_token).hexdigest()
archivetesting-webapp-1     |     TypeError: Unicode-objects must be encoded before hashing
archivetesting-webapp-1     |     
archivetesting-webapp-1     | [E 230623 12:53:43 web:2344] 500 POST /registration (86.xxx8) 229.29ms
archivetesting-webapp-1     | [I 230623 12:53:43 web:2344] 101 GET /connect/notifications/updates (86.xxx8) 0.69ms
eljeffeg commented 1 year ago

Sorry, screwed that up in the last commit. Reverted that change for the email token.

PJNorrisS1 commented 1 year ago

So will that break the API one or another issue? (thank you!)

eljeffeg commented 1 year ago

No, I don't think so. I made some additional changes when I did the garbage issue thinking email might have the same problem. I just reverted my change to the email token, nothing else.

PJNorrisS1 commented 1 year ago

I've tested our workflow and it works as it should Thanks for jumping on this one quickly! :-)

eljeffeg commented 1 year ago

I see the mistake I made with it (shouldn't have added the .decode() but it works so I'll leave it as is.