This could probably be improved, but it generally does the trick.
It'll stop basically all net message based crash exploits, but that doesn't mean you shouldn't fix the pre-existing issues.
Config is located in lua/autorun/server/badger-anti-crash.lua
, but the default settings should be fine.