AHAPX / dark-chess

chess with fog of war
https://dark-chess.com
GNU General Public License v3.0
10 stars 4 forks source link

I think I crashed the server #1

Closed petercunha closed 7 years ago

petercunha commented 7 years ago

Hi, I was doing a little pentesting on your site and I think I found a vulnerability that allows an attacker to crash the chat application and matchmaking server.

By requesting the following URL's, I was able to break the chat server:

https://dark-chess.com/v1/chat/messages?offset=-1
https://dark-chess.com/v1/chat/messages?offset=1000000

Now, when requesting an offset of any length, the API returns: critical server error. Also, I am unable to create match requests. This may have crashed the game server as well.

You may want to consider bounds checking requests to the API! Sorry if I caused any trouble on the server. A simple restart should fix it.

Take care, Peter

petercunha commented 7 years ago

It appears that login and signup are broken as well. I think this took down the entire server (!!)

AHAPX commented 7 years ago

Seems like limit=-1 and offset=-1 broke the server, coz postgres crashed with these args, fixed it.

Thanks for feedback 👍

petercunha commented 7 years ago

No problem! Love the site, keep up the great work.