In this paper we point out the vulnerabilities of the virtual force approach to mobile sensor deployment, which is at the basis of many deployment algorithms. For the first time in the literature, we show that some attacks significantly hinder the capability of these algorithms to guarantee a satisfactory coverage. An attacker can compromise a few mobile sensors and force them to pursue a malicious purpose by influencing the movement of other legitimate sensors. We make an example of a simple and effective attack, called Opportunistic Movement, and give an analytical study of its efficacy. We also show through simulations that, in a typical scenario, this attack can reduce coverage by more than 50% by compromising a number of nodes as low as the 7%. We propose SecureVF, a virtual force deployment algorithm able to neutralize the above mentioned attack. We show that under SecureVF malicious sensors are detected and then ignored whenever their movement is not compliant with the moving strategy provided by SecureVF. We also investigate the performance of SecureVF through simulations, and compare it to one of the most acknowledged algorithms based on virtual forces. We show that SecureVF enables a remarkably improved coverage of the area of interest, at the expense of a low additional energy consumption.