Slashdot Mirror


Ask Slashdot: Is Non-USB Flash Direct From China Safe?

Dishwasha (125561) writes I recently purchased a couple 128GB MicroSDXC card from a Chinese supplier via Alibaba at 1/5th the price of what is available in the US. I will be putting one in my phone and another in my laptop. A few days after purchased, it occurred to me there may be a potential risk with non-USB flash devices similar to USB firmware issues. Does anybody know if there are any known firmware issues with SD or other non-USB flash cards that could effectively allow a foreign seller/distributor to place malicious software on my Android phone or laptop simply on insertion of the device with autoplay turned off?

5 of 178 comments (clear)

  1. Make you sure you can read and write every bit by kimgkimg · · Score: 5, Informative

    You'll want to check to make sure you are actually getting a 128GB card. I've gotten a couple of fake flash drives and cards over the years which report the proper capacity and will even format, but when you try to write actual data to the device you end up with corrupt files. If the price is too good to be true, it generally is, so I don't buy cards or sticks from vendors that I can't return anymore. Use H2TESTW to test the speed and capacity of your flash card/device: http://forums.sandisk.com/t5/S...

  2. Re:Nope. by Anonymous Coward · · Score: 5, Informative

    He was asking about firmware. Formatting the SD card will not do anything to the firmware.

  3. No badusb-type attack (% SDIO), but malware inject by raymorris · · Score: 5, Interesting

    The SD* interface doesn't have the _same_ problem that USB does, ie badusb. It has other issues, though, and an SD card could made malicious. The issue with USB is that a USB device can be / act as storage, a keyboard, a mouse, a camera, etc. You can plug in a USB device which you think is just a memory stick, but unbeknownst to you you, it's also acting as a keyboard and "typing" commands to your computer. A pure SD card interface supports _only_ storage devices, so they can't act as keyboards. They therefore can't directly attack the host device in the same way that USB can.

    Android does have some support for SDIO, though, which allows a card to act as a camera, wifi card, or keyboard. I *don't* think Android will by default use an SDIO input device. It's possible that it will, though. I may have to emulate such a card with a microcontroller and see what happens when it is plugged in to various iOS and Android devices. If it works, you just witnessed the birth of badsd, as I haven't heard of anyone doing that before.

    What an SD card could do on a pure SD storage interface is muck with any files you put on the card. Suppose you installed towelroot or supersu on the SD card. The controller on the card could inject malware into the executable, and that malware would then be run with the same privileges you have - full root access if you root your phone, or the same access the apps have. Along with injecting malware into your files, the trojan SD card could send your files to the attacker. Wifi adapters can be made that small, so any data saved to the card could be sent to the attacker via the built-in wifi.

    Your best defense in that case might be "at 1/5th the price of what is available in the US". A trojaned card like that is going to cost some money to make, particularly the version with built-in wifi. It wouldn't make sense to sell a million of them on Alibaba, losing money on all of them. They would more likely be used in a targeted attack - "mistakenly dropped" on the premises of a defense contractor or R&D lab, maybe even advertised on on a forum likely targets tend to visit, such as one related to aerospace engineering or large-scale investments.

    One step you could take to protect yourself would be to write and read back some known files of various types and compare their SHA hashes within a VM. The card should return a bit-by-bit identical copy of the file that you copied to it. If you save an .exe or .apk file and it comes back changed, that would be a bad sign. I'd like to hear from anyone who experiences tat so we can investigate further.

  4. don't worry about it by frovingslosh · · Score: 5, Insightful

    Don't worry about it. If you got it through Alibaba it is almost certain to be a counterfeit card with the size and even brand name printed on failing rejected cards, and it will have no better chance of retaining malware than it will have of holding your own data. I know a couple of people who bought through Alibaba that this happened to.

    --
    I'm an American. I love this country and the freedoms that we used to have.
    1. Re:don't worry about it by resfilter · · Score: 5, Informative

      oh dear god dont write over the protected area! ...

      it's used for some specialized keys for some rarely used version of DRM. so if you have a CPRM "protected" file on the sd card, then.. you know.... "accidently" give the file to someone else, they'll lack the decryption keys (since they're stored outside of the filesystem by the program that wrote the file to the flash card) and the file will be useless.

      http://en.wikipedia.org/wiki/C...

      it's another one of those things that attempts to relabel yet another "generic binary storage device" as a "specialized media holder to assist content protection", and you should actually go out of your way to destroy this "protected area" instead of carefully avoiding damage to it.

      it's totally safe to write over this "protected area" and use it for your own data, and it's rare to run into programs that actually use CPRM for protection against distribution (although they probably do exist, why would you use such a thing?).

      that's probably why you've never heard of it or noticed writing over it.