USB charging ports in public places are convenient but possibly risky. Data is transferrable over a USB connection, so plugging your phone into an unknown charging port puts it at risk.
What’s the Danger?
Let’s be realistic: You probably shouldn’t be too paranoid about these attacks. We haven’t seen widespread reports of charging ports causing problems. However, many possible attacks could happen over a USB port, and avoiding the risk is easy enough that it won’t inconvenience you.
The main problem is that USB doesn’t just transmit power—it sends data. That’s why you can plug your phone into your computer to transfer files back and forth, update the phone’s operating system, and back up its contents.
A correctly behaving USB charging port wouldn’t even try to access your phone’s data. But there’s nothing stopping it from trying after you plug in a USB cable. A charging port could try to access private data on your phone or exploit a security vulnerability and run dangerous code on your device. This type of attack is known as “juice jacking.”
While older phones just made your photos and other data accessible whenever you plugged in a cable, current iPhones and Android phones usually require your permission to share things. Your iPhone will prompt you to “Trust This Computer” when a device you’re plugged into wants access. On Android, you must enable transferring files over the connection. Even if you have USB debugging enabled, you must permit the device to access it.
If you don’t give your phone those permissions, it will still allow charging over the port but not allow data transfer.
With an iPhone, you’re probably safe unless the charger attacks your phone through an unknown security hole. Of course, Apple just added “USB Restricted Mode” to the iPhone and iPad to prevent them from being attacked by password-cracking tools connected to the Lightning data port.
Read more: https://www.howtogeek.com/364032/how-to-protect-yourself-from-public-usb-charging-ports/