SIM Cards Have Finally Been Hacked, and the Flaw Could Affect Millions of Phones
forbes.com
forbes.com
Here, for us, are the nut grafs:
In early 2011, Nohl’s team started toying with the OTA protocol and noticed that when they used it to send commands to several SIM cards, some would refuse the command due to an incorrect cryptographic signature, while a few of those would also put a cryptographic signature on this error message.
With that signature and using a well known cryptographic method called rainbow tables, Nohl was able to crack the encryption key on the SIM card in about one minute. Carriers use this key to remotely program a SIM, and it is unique to each card.
This is a little vague and I don't understand the OTA protocol like, at all, but what it sounds like is that there is a case in some implementations of SIM OTA where (a) errors for improperly signed messages are noisy, (b) those errors include some of the plaintext of the improperly signed message, and (c) the error message itself has a signature that is intended to be valid only for the error.
Possible next steps: (i) you can table-solve for the signature (presumably this is a MAC, not a signature) for your intended message due to the way plaintext hits the error message, or (ii) you can table-solve for the plaintext of a previously unknown ciphertext by taking that ciphertext, flipping a bit to invalidate the signature, and collecting the error signature.
On a different note, I find it extremely frustrating that the community still has to deal with buffer overflow bugs in 2013. Hardware bounds checking architectures have existed for half a century, and SIM cards are a perfect example of special use devices that would benefit from this.
Makes you wonder if the FBI snooping cell tower already does this :-)
Makes me wish I had the burner phone concession at DefCon.
http://www.theregister.co.uk/2013/07/22/mobile_gsm_sim_card_...
An attack similar in spirit to this breaks RADIUS.
A rainbow table resolves this plaintext-signature tuple to
a 56-bit DES key within two minutes on a standard computer.
The cracked DES key enables an attacker to send properly
signed binary SMS, which download Java applets onto the SIM.
It's particularly sad that the same key is used for the MAC in both directions (network-to-SIM and SIM-to-network).Edit: Found this: http://www.3gpp.org/ftp/tsg_sa/wg3_security/TSGS3_33_Beijing...
Anyway, there is something missing, as a security measure SIM cards should burn out if you keep calling it.
For this attack to work remotely you need to send a binary SMS and be able to read the SIM answer, which probably requires some privileged access to an operator's SS7 network. Far from obvious. Since Network Operators are in complete control of SMS traffic, blocking anything that has not been issued by their own OTA platform is just a matter of configuring a filter on an SMS-C -- if not already done.
But seriously, there is a sunny side to this story: a user could load her own programs onto her SIM. She could gretaly extend the functionality of her phone... with programs that she trusts. Maybe even ones she wrote herself.
Imagine... an open platform. Oh gosh, that would be terrible, wouldn't it?
Otherwise this story highlights the concept of "minimum viable product" not in the startup world, but as it exists among major industry manufacturers. For example, if SIM manufacturers can get away with using DES, then why invest their time and money in using stronger crypto? There are so many examples of this type of thinking... it's certainly not limited to imlementations of cryptography or SIM cards. No doubt, some would say this is simply Business 101... ask any used car salesman. But it's particularly acute in hardware and software.
Do hardware and software worlds makers need higher standards and more serious "quality control"? Beyond the cosmetic appearance of their work, no. Because users are generally indifferent to all else. What they don't know won't hurt them.
Did you know you can type encrypted messages directly with a text editor called ed(1)? How cool is that? It's so easy. Who needs PGP?
It uses DES, but hey, DES is good enough for SIM cards, so...
They might do it out of necessity: to "scratch itches".
Limitation breeds creativity. This is true in general, but certainly in computers. Ever heard of demoscene? By comparison to the constraints we had to work with in the 80's, the power of today's handheld computers (one usage of which is as a "phone") is hardly a limitation. But I guess it would depend on what you are trying to do. I have no idea what you would want to do. Only you know that.
As for what others might do, were they to be able to upload their own software to their phones, well, the only way to answer that question is to let them and see what comes out of it.
Only a fool would believe he could direct, let alone predict, all the uses that might be made of a particular software program, a particular language or a particular computer.
One use of a computer is as a communications device, aka a "phone". Another is a "game console". There are plenty of other uses for handheld computers even if you yourself cannot think of them.
Can I upload software to my SIM card? No.
Most phones accept some type of SIM card, while not all phones have a means of user-controlled offline external storage (microSD, etc.).
Why can't the user access a SIM card? Why can't she look at the software stored on a SIM card?
The SIM card slot is pretty much off-limits to the user. Yet the user owns the phone.
This is like buying a computer that has a special card slot owned by a single company or a consortium of companies that produce special cards only for their own use. The user is effectively denied access to the slot.
"Crapware" is just my opinion. Although I've heard others note the same thing.
The ChromeOS developers are currently porting coreboot to ARM, too.
http://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Int...
Hence firmware to replace BIOS, with the same purpose as BIOS.
So do you re-program your UEFI firmware?
And since when is x86-64 an ARM system, since that was my remark?
FYI: the main Javacard applet on a SIM card is the GSM applet, the one you use to authenticate against your network. Other applets are useful for network operators: IMEI tracking sends them your phone ID to help them configure it correctly -- it is also used to track stolen phones. Another useful one updates your preferred foreign network list when you change countries, connecting you automatically to a cheaper network when available.
Uploading your own software will not do you much good. As mentioned above, CPU and memory are very limited on SIM cards, and Javacard is basically a glorified assembler you do not want to touch. SIM cards are mostly there to perform some simple crypto operations for network authentication and that's it.
As for running a known-secure firmware: in the end a SIM card only authenticate you against a Mobile Operator with a pre-shared key. If you believe your SIM is running a non-secure firmware, how can you trust your Mobile Network Operator not to do fancy stuff on their network behind your back?
Yes, the telecom owns the card they give you. Indeed, that is their property. But they don't need to own the smart card standard and use it to exclude users from using the slot.
Imagine if the motherboard you bought would had certain slots that were off-limits to you and open to use only by certain companies.
As for "glorified assemler", have you considered something more succinct, like FORTH. There's nothing glorious about Java.
Javacard is not Java. No OO, no classes, no GC, no floats, no strings, the only data type you can use is int16. Have fun.
I don't want no stinking Java, whether it's a small subset of the language or the full blown monster. For the task at hand, I'd have more fun with assembly language than anything prefixed with "Java".
The blank smart card possibilities are enticing. If we can use our own crypto.
Doesn't OpenMoko's WikiReader run FORTH?
1) Buy a slim ipod touch 2) Jailbreak (unnecessary) 3) App CryptMe allows transfer of plaintext from your computer through iTunes, password unlock on the device, quick search (nice), and according to Firewall iP (Cydia program) doesn't connect to the internet (or you could just always keep wifi off).
GPG isn't pretty, and support lags with OS X releases but you can do alot with it.
I've been using this methodology for securing cloud backups for several years. Using tools like Duplicity, you can safely encrypt data on potentially untrusted devices or networks using a public key, and keep the private key safely stored somewhere on the smartcard.
The downsides to these sorts of approaches is that encrypting data is easy, key management for decrypting it is a pain.
I don't think you've really understood the complexity of the SIM - there are literally thousands and thousands of pages of specification, which means that any sim will interoperate with any phone.
A SIM is not an "MVP" by any stretch of the imagination - it costs millions of dollars to enter the market; there are stringent security and compatibility controls, and no-one will consider selling you silicon unless you're ordering millions of units per year.
You're wrong on the SIM as an MVP idea. I guess I'm not communicating clearly enough. What I mean is the computer ("phone") itself, of which the smart card subsystem (e.g. SIM card system) is a part, is of inferior quality. This is only my opinion.
I understand there are barriers to entry in place. But how does that relate to low quality, minimally viable products? I'll let you or someone else answer that.
Maybe we need to remove the barriers, lower the cost of entry and lower the complexity (simplify)? No, those sound like ignoble pursuits.
I don't know of any attacks on DES better than brute force and on 3DES better than brute force w/ meet-in-the-middle.
For instance, if 3DES were used in OFB mode, one would expect on average to have a unique 64 GB keystream before entering a repeating 32 GB keystream. If the attacker is able to choose the data being encrypted, CFB could have similar limitations. With CBC mode, you'd expect only 32 GB of encrypted data before you got your first self-collision in ciphertext. CTR mode with perfectly random IVs does much better, at 64 exabytes. Even 64 EB isn't as big as it used to be, especially for a key that can't be changed.
For many uses, you'd much rather have an ideal block cipher with a 128-bit block and 112-bit keys than an ideal block cipher with a 64-bit block and 512-bit keys.
edit: I just now found on HN front page:
http://translate.google.com/translate?sl=auto&tl=en&js=n&pre...
EDIT: Ok, I just read your other comment and must say that you probably understand a million times more about this than me, so disregard this comment.
"All SIMs could reject OTA message without Digitial Signature (DS), but this is rarely done as it brings additional pain to gsm providers. Most of the SIMs are correctly secured. Most of the SIMs accept OTA messages that are not encrypted. Some SIMs accept OTA messages that only have a correct Cryptographic Checksum (CC) and some SIMs only require a correct Redundancy Check (RC) and also require counter increase N+1. Most of the SIMs dont require any security feature and accept OTA messages without no RC, CC or DS, for example - Globul. (by marek, TODO: name the networks!)."
http://wiki.thc.org/gsm/simtoolkit#head-1c0ca2c9ebd6ac101c90...
I always presumed that these sim java applets are crapware that is mercifully hidden on todays smartphones.
It's also my impression that Mastercard and Visa paid a hefty stupidity tax by thinking in the 2000s that it would be important to have their software on SIM cards, not foreseeing that smartphone apps would just bypass that whole layer.
Anybody know of an application in the western world, on smart phones, where these java applets are really used?
Google Wallet uses the same type of applets but stored in the phone's SE rather than the SIM card.
BankID is a centralized service for authentication used by banks, and the "other" implementation is based on a (browser) java applet.
i want to try out some of the gsm mvnos in the states (eg airvoice, ptel and h2o). an at&t or comcast or microsoft has a reputation that's worth billions, so i "trust" them to only be semi-evil and at least semi-responsible. i don't know much of these mvno companies, but assume they're living on the margins and don't have too much to risk. could they, or an enterprising engineer working for them, mess with the sim card to take something of value from me ?
A friend of mine implemented a wifi-posistioning system that got power from the phone's GSM signals (it wasn't using a full wifi stack, just enough to broadcast an 802.11b frame that access points could pick up and triangulate). It was used for positioning in museums, and the phones where used for guiding information (so it wasn't a malicious hack) -- but it does illustrate that there are many possibilities.
Put a flash storage chip on there, and record all GSM traffic for example?
If indeed it is as simple to force a sim to run these malicious applets as using some sort of rainbow-table-powered replay attack, what would be the challenge? Or perhaps he was referring to the more lucrative aspect of breaking out of the sim sandbox...
Maybe creating the rainbow tables? [I'm not familiar with any of the details here FWIW, just guessing as that seems the most likely thing that could be estimated to take 6 months].
*Verizon did not specify why its SIMs were not vulnerable*
I was under the impression that Verizon phones don't use SIM cards because their network is CDMA instead of GSM.Most SIM cards are actually micro computers that communicate with the host system for certificates, encryption and some provider specific information, besides the common address stuff.
Usually the software is done in Assembly, C or JavaCard, with JavaCard use getting increased in the last years.
The JavaCard exploits are related to the VMs running the system, which are usually coded in a mix of Assembly and C. JavaCard VMs don't have a JIT due to memory constraints.
> The way this works is somewhat complex, but Nohl’s virus essentially gave the infected Java software a command it could not understand or complete – eg. asking for the 12th item in a 10-item list, leading the software to forgo basic security checks and granting the virus full memory access, or “root,” in cyber security parlance.
Can't stand Forbes and their over the top ads, tldr would be appreciated.
Right now, you are just leeching other people's time.
I'm not leeching other people's time more than any other comment. If you're not interested proceed with the next post.
You just wasted my time with your pointless comment. Well you didn't, I could have chosen to ignore it.
It is very hard to take someone's time without their permission.
Now give me back the time I spent responding to you.
"The two-part flaw, based on an old security standard and badly configured code, could allow hackers to remotely infect a SIM with a virus that sends premium text messages (draining a mobile phone bill), surreptitiously re-direct and record calls, and —with the right combination of bugs —carry out payment system fraud."
Just trying to figure out the scope of this problem. Journos seem to care more about sensation than facts.
I'm asking just in case someone has a better source.
This is basically all the detail about the actual flaw in the article:
"In his study, Nohl says just under a quarter of all the SIM cards he tested could be hacked, but given that encryption standards vary widely between countries, he estimates an eighth of the world’s SIM cards could be vulnerable, or about half a billion mobile devices."
"his team tested close to 1,000 SIM cards for vulnerabilities, exploited by simply sending a hidden SMS. The two-part flaw, based on an old security standard and badly configured code, could allow hackers to remotely infect a SIM with a virus that sends premium text messages (draining a mobile phone bill), surreptitiously re-direct and record calls, and — with the right combination of bugs — carry out payment system fraud."
Seems like it would only affect a very specific subset of mobile phones.