If you wipe the device before using it, then it's as-new. The only security risk at that point is you. That said, I would discourage you from buying a used device from a non-Apple reseller. Stick to a new phone or refurbished one from Apple. If you buy used devices, then you are at risk of the Find My Phone activation lock.
Activation Lock Problem
If you purchased the device second-hand, then it is useless without the Apple ID and password to which it is locked. If you don't have it, can't remember it or cannot get it, then the device is useless to you. Try to get your money refunded, if you can, or take it to an Apple store for an exchange provided they will help you. If you are the original owner, then take the device, a copy of your purchase receipt and identity proof to an Apple retailer where they may be able to assist you. For a deceased owner, you will need a certified copy of the Death Certificate, the device, proof of inheritance and proof of your identity. Take all to your local Apple Store for help. Note: there is no guarantee that anyone can gain access to the device.
About Activation Lock on your Mac - Apple Support
Activation Lock - Turn off Find My iPhone
About Activation Lock on your Apple Watch - Apple Support.