Security device (1) consisting of a holder (3) fixed to the frame (11) and to the wall by screws (12 12a). One or more bars (4) are held in the locking position by bar springs (5) and lie against an angle piece (2). The angle piece is fixed to the window (10) or door by screws (13) and lies fully against the outer surface (19) and the room-side surface (20). The angle piece so transmits lifting forces that the bars are held in the locking position.