Javascript Security Concern

后端 未结 1 791
北海茫月
北海茫月 2020-12-12 07:16

In my previous question: Securing javascript game timing

... it became clear that client-side timing in a Javascript/Canvas game simply won\'t be secure. I know the

相关标签:
1条回答
  • 2020-12-12 08:05

    Don't care too much about the console. Yes, if there are global objects whose method can easily be fired to "win" the game, it's a nice possibility to cheat, but it can easily prevented as you demonstrated.

    So, the hacker would just listen (look at the network pane) which requests are made to your server and fire them manually. If they were just some simple urls like /action=start and /action=end, he could very easily fire them manually without any timing. So you will need to prevent that (although you never can really make it safe), e.g. by adding additional credential tokens. Or you could embed some "secret"(s) into the game code, which are revealed during the gameplay, and need to be sent to the server to prove the rightfulness. Of course they could be read out of your code, but you have to make it too complicated for the hacker. It's a bit like security by obscurity…

    0 讨论(0)
提交回复
热议问题