Vulnerability in Slovak and Czech Mifare cards
![]()
Mifare Classic cards are used, for example, by Bratislava’s public transport company, SAD bus operators and student cards (ISIC). Pavol Lupták and Norbert Szetei of Nethemba have published several attacks on these cards and released the first open-source implementation of an offline attack on the keys.
These attacks can be used to clone cards once the keys have been obtained (the keys are the same for all cards belonging to a given company, such as DPB or SAD). A cloned card can provide, for example, two valid travel passes instead of one — provided an attacker can also make the card look like an official transport company card. This is not particularly difficult, since the card contains almost no physical security features. It is also possible to save the contents of a card and write them back later (this could be abused, for example, by saving the card’s contents when it has a higher credit balance and restoring them after the credit has been spent).

Once the keys have been obtained, personal information can also be retrieved from the cards — a name or, in the case of ISIC and university cards, a student number. With the right antenna, this attack is also possible without contact: a standard antenna works at a distance of 5 cm, but a solution using a powerful antenna has allowed hackers to read this card from up to ten metres away. For example, you could walk through a bus and obtain a list of the people on board who hold monthly travel passes.
More information, including a technical presentation and tools for carrying out the attack in practice, is available at https://www.nethemba.com/research#zranitelnosti_v_mifare_kartach.
We spoke about this attack with its co-author, Pavol Lupták.
An interview with Pavol Lupták about the security of Slovak Mifare cards
ITN: Could you describe the attack in more detail? How are Mifare Classic cards protected, and what makes them vulnerable?
PL: The security of Mifare Classic cards is based primarily on:
– a unique identifier (UID), stored in block zero of sector zero, which is the only part of the card that cannot be modified (although it can be emulated using a special emulator such as the Proxmark 3)
– mutual challenge-response authentication between the RFID reader and the card, and fully encrypted communication (using the proprietary CRYPTO1 cipher)
Mifare cards contain numerous implementation vulnerabilities that can be exploited for various types of attack. To mention the most important: the cryptographically weak proprietary CRYPTO1 cipher, a weak random number generator that allows challenge-response authentication to be broken, the ability to obtain the keystream for parity bits, and so on. There are many flaws, and more are still being discovered.
We implemented the nested offline attack documented academically in section 4.4 of http://www.cs.ru.nl/~petervr/papers/grvw_2009_pickpocket.pdf. We therefore did not invent this attack; we implemented it in practice and were the first to publish the implementation.
ITN: It looks as though someone once again cobbled together their own cipher and thought that keeping it secret would make it secure…
PL: Yes, unfortunately that is the case. The company behind it is NXP, which implemented the CRYPTO1 cipher specifically in hardware. So, if you were a manufacturer of Mifare readers, for example, you had to buy a special chip from NXP that supported CRYPTO1 in order to use CRYPTO1 encryption. Until fairly recently, there was no software implementation of this cipher. One now exists — for security reasons, it was published completely anonymously: http://code.google.com/p/crapto1/.
The attack on Mifare Classic is a good demonstration of why inventing and implementing your own ciphers is not a good idea. NXP learned from this, and the newer, more secure Mifare DESFire cards use 3DES and AES.
ITN: Was anyone informed about this vulnerability before it was made public?
PL: Yes. The main supplier of this solution, EMTEST, a. s., was informed directly two months ago, on 24 August 2009, to be precise.
ITN: Is there any way to protect against these attacks?
PL: Of course. The only truly secure solution is to withdraw the vulnerable cards completely and replace them with newer, more secure ones (such as Mifare DESFire), whose vulnerabilities we do not yet know about. Since this is a very costly solution — in addition to replacing all the cards, the readers need new software or the old readers may need to be replaced — we proposed temporary security measures: linking the card UID to the passenger, checking the validity of the card UID, digitally signing the contents, and a decrement-counter solution. These protect the cards at least against unauthorized modification. They do not, however, protect against the keys being obtained and the entire contents being read; more secure cards are needed for that.
ITN: What could a potential attacker in Slovakia and the Czech Republic achieve by exploiting these attacks?
PL: They can read the entire card. When physically close to passengers on public transport, it is possible to obtain a complete copy of any passenger’s smart card — meaning all information stored about them on the card, including their first name, surname, student number and so on.
They can modify any sector on the card (except the read-only sector zero), and thus change any credit balance on the card, the owner’s name or other sensitive information. They can create a 99.6% clone of the card (excluding block zero in sector zero). They can create a 100% clone of the card (including block zero in sector zero) by fully emulating all sectors using a Proxmark III device.
ITN: You are also looking into the security of Slovak biometric passports. What stage has this project reached? Should we start to worry? 🙂
PL: We are currently looking for an official RFID reader for Slovak biometric passports so that we can check how thoroughly it verifies biometric passport security and whether this verification can be bypassed in some way.
Slovak biometric passports are among the more secure ones: they use Active Authentication, so certain information, such as a fingerprint, cannot simply be read, and a key held only by the issuer is required. In theory, this key could be obtained through a side-channel attack. Similarly, an imperfect clone of a passport could be created without this information; the question is how official readers would respond to it.
In any case, all the other personal information also printed in the passport can be read in full from the closed passport (for example, a JPEG photograph, the date of issue and so on). All that is needed is an inexpensive ISO14443A RFID reader costing EUR 30 and knowledge of the MRZ code, which is either physically printed on the second-to-last page of the passport or can be calculated if the passport number, the holder’s date of birth and the passport expiry date are known.
ITN: You make your living from penetration testing. What is your view of the state of security in Slovakia?
PL: As you can see, it is poor. For ordinary Slovak companies, security usually takes second place. Preventive security does not work very well: most companies only start addressing security after information has been leaked and misused, or when they are directly affected. This also applies to Mifare Classic smart cards. Their vulnerabilities have been known for more than two years, yet nobody in Slovakia — or elsewhere in the world — is dealing with them. Exactly this type of card was compromised in London over a year ago (Oyster travel cards). Nevertheless, nobody in Slovakia learned from it, and the same vulnerable cards used in London continue to be used here. For this reason, I believe that practical proof-of-concept implementations of these attacks should be published. Very often they provide the only strong incentive to replace a vulnerable technology with a more secure one.
27 October 2009 / Interview for ITNEWS.SK: J. Bednar
Technical presentation on Mifare Classic vulnerabilities (in English)
A video demonstration of an attack on an access control system (our own, in fact!)
Cloning a card costs just a few euros
BRATISLAVA. An expert needs equipment costing only a few euros to break smart-card security. The flaw opens the way to the data of thousands of people and allows fraudsters to travel for free.
Cloning or modifying a smart card requires only a reader for these cards. It is legal and can be bought from online shops for as little as thirty euros. The software for cracking the keys that protect the card was made available by P. Lupták and can be downloaded for free.
These keys can then be used with the same reader to make copies of the card or alter the data stored on it.










