In this paper we investigate the three-dimensional stability of the 2D flow generated in a cavity by the motion of two facing walls. An adjoint-based analysis of the most unstable global mode will be performed in order to localize the core of the instability.