Screeps: How a game about programming exposed thousands of players to remote code execution

37 points by albino


albino

imo the part that makes this really high-impact and quite serious is hidden down in the footnotes:

The community is very nice, but terrifyingly nonchalant about the insecurity of the client. Far from being an unknown vulnerability, the community actively uses it as a convenient injection point for third-party modding of the client. The official Discord server has a "client-abuse" channel for sharing these snippets, and a Github repo for storing the popular ones.

Savvy users can of course protect themselves by either studiously avoiding ever logging any attacker-controller string, or overwriting the native console.log function with one that sanitizes the HTML. The community does not make any attempt to warn newcomers that they need to do this if they want to play the game safely. Astonishingly, even many of the most enfranchised players choose not to take this easy step, knowingly exposing themselves to an easy hack. Some of the most complex open-source bots also use console.log statements in an unsafe way... which hundreds of newbies then unknowingly clone to run themselves...

dzwdz

Screeps is on Steam, and the native client reuses the browser code but with no sandboxing.

Why.

Look, it's great that you renamed the function from console.log to console.logUnsafe, but why the fuck should things logged using it be able to execute things on my computer?! Why would you ever allow <script> tags in the console output at all?

Players will just use console.logUnsafe with no further precautions to log things because they want to have fancy colors in their log output, and then they will let others install RATs or whatever on their computer.

This is not a bugfix, it's just a way to try to shift the responsibility away from themselves. A game should never be able to do this.