timotheeg / nestrischamps

A web-based OCR and restreamer system for NES Classic Tetris players
MIT License
45 stars 11 forks source link

Validate all game inputs #83

Closed timotheeg closed 3 years ago

timotheeg commented 3 years ago

The nestrischamps server right now is much too trusting on incoming game frames:

Expected

No user input should ever be able to crash the server. Replay game files should be of the correct format so they should protect themselves.

TODO:

Do minimum inspection on game frames before they are used for anything. No need to do full parsing of the data, but at least extract the version field and from it validate binary frame size

timotheeg commented 3 years ago

Done in https://github.com/timotheeg/nestrischamps/commit/00602042eb40a06eedd94b1cbc811ce730c9aad7

(alongside some other minor cleanups)