Chances are that each of us has found ourselves in a situation where our phone is dying and we have no charger on hand, but at the same time we desperately need to stay connected — to answer an important call, receive a text message or email, whatever.
It is perfectly normal to look for any source of precious electricity on such occasion — any USB port would do. But is it safe? No. In fact, it can be dangerous: Over a USB connection someone can steal your files, infect your smartphone with something nasty — or even brick it.
Ride the lightning
Before we get to the problem of thieves, we must point out that not all electricity is equally good for your phone. The Internet is full of complaints, filed mostly by users who tried to charge their fancy phones by connecting them to aftermarket (or non-original) chargers. In some cases doing so turned the phones into quite expensive bricks. In the most bizarre cases, people holding the phone in their hands were seriously injured or even killed.
Teen dies after being electrocuted in her sleep while charging her iPhone http://t.co/1YyPVHOhN0
— Daily Mail Online (@MailOnline) July 31, 2014
Unfortunately, these may be more than just accidents. For example, last year we saw a twisted device aptly named USB Killer. It contained an impressive set of capacitors, housed in a USB-flash-drive-size frame, that would discharge 220 V into a USB port. Such discharge would destroy the USB port at minimum, and possibly fry the whole computer’s motherboard in a worst-case scenario. We doubt that you’d want to try your phone’s durability in such a way.
Show me your files, baby
Secondly, USB ports were designed not just to provide charge, but also to transfer data. So whenever a mobile device is connected to a USB port, it attempts a handshake, during which it transmits some data. The most data-wasteful are phones based on Android platform 4.x and earlier — they connect in MTP (Media Transfer Protocol) mode by default, exposing all of the device’s files.
On average, it takes more than 100 kilobytes of data just to tell the host system about the phone’s files and folders — for reference, that’s about the size of Alice in Wonderland e-book.
Locking the phone will save you from such exposure — but, honestly, do you abstain from using the phone while it’s charging? And do you always disconnect the phone from the USB port when you receive a text message, for example?
Now, let’s take a closer look at the data that is transmitted to the USB port even when the mobile is in “charging only” (blocked) mode. The amount of data varies depending on the mobile’s platform and the operating system of the host, but in any case it’s more than “just charge, nothing personal” — as we found out, this data includes device name, vendor name, and serial number.
Full access and beyond
You may think the data transmission issue is not a big deal, but the problem — as we’ve discovered by looking into publicly available information about one specific vendor — is that they allow for much more than specified by the system.
How is that possible?
It is done by a legacy system of commands called AT-commands. The AT commands were developed a few decades ago to enable the modem and PC communications. Later, the set was included in the GSM standard, and to this day it is supported in all smartphones.
To give you an idea of what can be done using AT commands: They enable an attacker to get your phone number and download the contacts which are stored in the SIM card. Then, they can call any number — at your expense, of course. (And if you’re roaming, such surprise calls may quickly drive your balance into the red.) Depending on your vendor, this mode can also open access to install any type of application — including malicious ones.
All of the above is possible even if your smartphone remains locked!
To sum up: Remember that you can never tell what is on the other side of a normal-looking USB port. A USB port can be a system that gathers data about the devices that are connected to it, a flawed power source, a powerful capacitor, or a computer that installs a backdoor on your device. You simply cannot know before you plug in your device — so don’t.