A peak current detector is integrated into a power supply, such as a power management integrated circuit, to detect glitch attacks imposed on the power rails inside the power supply. Integrated circuitry being supplied by the power supply periodically checks the state of the power supply via a secure communication channel to obtain the detected peak current values, which allow the integrated circuitry to detect those attacks and react accordingly to any possible threats.