In massive millimeter-wave (mmWave) multiple-input–multiple-output (MIMO) systems, eavesdroppers may transmit the identical pilot sequences as legitimate users to manipulate channel estimation in pilot phase and afterwards intercept the transmitted information in data transmission stage, constituting a severe attack for secure communications. In this paper, for a three-terminal massive mmWave MIMO system with a cooperative relay, the achievable secrecy rate under the presence of a pilot spoofing attack is investigated, and then an accurate detection scheme is proposed. Specifically, in the first slot of the uplink pilot stage, the full-duplex relay sends pilot sequence to the base station simultaneously when it receives the transmitted pilot signal from the user, through which the CSI from the relay to the base station is obtained. In the second slot, after the received pilot signal has been forwarded from the cooperative relay, the equivalent CSI from the base station to the user is obtained, and the joint CSI from the user/attacker to the relay is derived, based on which the likelihood ratio method is exploited to detect the potential pilot spoofing attack. Finally, numerical simulation is presented to show the performance of the proposed scheme in terms of miss detection and false detection events.