While opening the medicine cabinet last night I felt it move away from the wall! When I took off the cabinet it appears that the person that installed it just drilled screws into a horizontal sheet of drywall to secure the top of the cabinet and they pulled out... incredible.

What is the best way to safely secure the top of the cabinet?

[![mirrored medicine cabinet off mounts](https://i.stack.imgur.com/g8Eyz.jpg)](https://i.stack.imgur.com/g8Eyz.jpg)

[![cutout in wall for cabinet](https://i.stack.imgur.com/wngBD.jpg)](https://i.stack.imgur.com/wngBD.jpg)

[![cutaway of material at top of cutout](https://i.stack.imgur.com/OnZ2p.jpg)](https://i.stack.imgur.com/OnZ2p.jpg)

And here's the screw that pulled out of the wall:

[![attachment bracket and screw with drywall debris on threads](https://i.stack.imgur.com/cljbb.jpg)](https://i.stack.imgur.com/cljbb.jpg)