Critical observability of finite state machines under attacks