sparticle999 / SpaceCompany

An incremental game about Space Mining
http://sparticle999.github.io/SpaceCompany
Other
301 stars 169 forks source link

Everybody can modify their amounts of resources easily. #451

Open nalemy opened 3 years ago

nalemy commented 3 years ago

I just analysed the function "gainResource" and found that you could use commands like "window['metal'] = 1000000;" in the console to modify the amount of the metal.

WarpPrime commented 3 years ago

Many web games have this issue; maybe if the save files are tampered with, the savegame is reset to avoid cheating. But all web games like this have this issue unless you somehow encrypt/hash the resource statistics

nalemy commented 3 years ago

Yeah, that's just what I meant. You can try to encrypt the data or obscure the code to fix this bug.

Mekomancer commented 2 years ago

Anyone that knows there way around a browser debugger could easily change their resources, even if encrypted, by calling the encryption function to assign data, also obscuring code isn't going fix this. this is a static site and making the function or variables private would just mean they would have to do a quick search in the code, find the 'metal' variable, and add a break point and now the variable is inscope