We study the stability properties of the interconnection of an LTI dynamical
plant and a feedback controller that generates control signals that are
compromised by a malicious attacker. We consider two classes of controllers: a
static output-feedback controller, and a dynamical gradient-flow controller
that seeks to steer the output of the plant towards the solution of a convex
optimization problem. We analyze the stability of the closed-loop system under
a class of switching attacks that persistently modify the control inputs
generated by the controllers. The stability analysis leverages the framework of
hybrid dynamical systems, Lyapunov-based arguments for switching systems with
unstable modes, and singular perturbation theory. Our results reveal that under
a suitable time-scale separation, the stability of the interconnected system
can be preserved when the attack occurs with "sufficiently low frequency" in
any bounded time interval. We present simulation results in a power-grid
example that corroborate the technical findings