Chip and skim

We recently built an EMV transaction interceptor to aid us in understanding the viciously complex EMV protocol suite. A useful byproduct is that we can now give demonstrations of interception and relay attacks on Chip and PIN — topics discussed in our paper Chip and Spin. Since German TV picked up on our interceptor experiments, there has been some discussion about whether these attacks really work, and what it means for Chip and PIN security.

First off, intercepting smartcard communications is not rocket science; EMV is built on the ISO 7816 standard for smartcards. Interceptor hardware necessarily exists for test purposes (Micropross is a well known test rig manufacturer) but it doesn’t come cheap. Not willing to cough up a grand, we decided to do it on the cheap: we wrote a very basic microcontroller program which samples the smartcard I/O data line as fast as it can, and passes the data back via USB for decoding on a laptop.

EMV Interceptor picture

This prototype is a useful price point for the cost of a smartcard interceptor: for example, we bought a suitable microcontroller development board from Siphec for about $60. Our Chip and PIN (EMV) Point-of-Sale Terminal Interceptor page describes both this device and claims that sufficient information can be captured from a trace of an EMV transaction to recover the customer PIN, and to produce a magnetic stripe counterfeit of the card.

That we built a working interceptor is not under dispute, but is the above claim true? Would it actually work in practice? For this goal, a number of extrapolations must hold true:

  • The PIN must travel in the clear across the wires to the smartcard. UK cards are SDA cards, so the PIN is not encrypted. In theory the PIN could be routed for verification at the bank rather than by the card, but the UK also opted for local verification only.
  • The customer PAN and CVV1 must be sent by the smartcard. More generally, all the information required to reconstruct the magnetic stripe must be present. The PAN is clearly sent as it is required for the EMV transaction itself. In the half dozen or so UK cards we have examined, the same CVV1 appeared to present in the chip data as on the magstripe, though we were aware of some suggestions that the CVV1 was blanked out on the chip equivalent data. The EMV specification says that all records stored on the chip are read out during a transaction, and the traces appear to confirm this.
  • There must be no further secret authentication mechanisms for the card or magstripe. In Germany, magstripe cards carry a hidden “MM-code” which is correlated with a copy encoded on the magstripe; the method to read the MM-code is kept secret. In the USA there is some use of automated counterfeit hologram detection. It seems no such methods are in use in the UK; journalist Jonathan Maitland from Tonight with Trevor MacDonald successfully produced and used a counterfeit white card produced purely from a dump of track 1 and 2 magstripe data.
  • A suitable target ATM must be found at which to use the counterfeit card. Clearly there are plenty of ATMs in foreign countries which do not support Chip and PIN, so targets do exist. Within the UK there are three ways for an ATM to be vulnerable. First, if it has not been upgraded to support chip cards, it must necessarily use the magstripe. Second, if the chip-enabled ATM cannot tell with certainty that a card is supposed to be a chip card, then it may assume it is a magstripe card. Seeing as practically all UK ATMs are online the issuing bank can always be queried, so this second vulnerability mode is unlikely. Third, if the ATM supports fallback to magstripe, for instance in the case of damaged chips, then it will work. Conditions under which ATMs permit fallback actually appear to be quite complex, dependent for example on time of day and fraud history on that machine. There was certainly no problem finding viable ATMs in the UK when the Trevor MacDonald program aired, this time last year.
  • It must be possible to adequately miniaturise and camouflage the interceptor. Miniaturisation of the circuitry is not the bottleneck here, very small form-factor microcontrollers can be found, and few other discrete components are needed. The real miniaturisation challenge comes in gaining physical access to the electrical contacts covertly. The reader slot is wide enough to admit a thin second item, such as a flexible PCB, or maybe some other sort of plastic sheet with conductive ink, but the space is of the order of 0.1 mm, a typical card being about 0.8 mm thick. The alternative is not to go for a miniature solution per se, but a well camouflaged fake slot which sits outside the main slot. Different form-factor terminals would clearly have different optimal designs for cheap interceptors.
  • The POS terminal must not be able to detect the presence of an interceptor. Some modernised ATMs are able to detect unauthorised attachments designed to directly skim PIN and magstripe, there is no fundamental reason why such technology could not be applied to POS terminals as well. However we have found that there definitely are UK POS terminals which do not detect such attachments, for reasons of cost, we suspect.

Is there missing piece to this jigsaw that we have overlooked in our investigations, or are banks simply reluctant to admit that POS terminals are at least equally vulnerable to the same sorts of magstripe skimming attacks as ATMs? I’m eager to find out.

13 thoughts on “Chip and skim

  1. Is point-of-sale equipment usually tamper-proof enough to prevent an insider from installing the skimmer within the enclosure itself, rather than in the slot between contacts and card?

  2. @Chris Lightfoot

    We bought the terminal pictured in the article off Ebay, and it did not have any tamper resistance, but we are not sure of which country it came from. In the UK I believe that terminals do have tamper detection, but I am not sure what they do when tampering is detected, and what extra security this adds.

    The traditional action to perform when tampering is detected is to wipe keys, but my understanding is that keys are stored in SAMs which are removable smartcards with the same form factor as SIMs. So the worst a tamper detector could do is wipe the firmware, potentially requiring a reload. This might be possible to do over the phone-line, or might require an engineer to come out. In the latter case, the manufacturer could have a policy of replacing the terminal completely, but this would be expensive to do each time a battery fails.

    But even if the tamper detection is perfect (it won’t be), and the attacker wants to put the skimmer inside the enclosure, an alternative is to replace the entire terminal, by putting custom electronics into a real shell. Driving the screen and printer is non-trivial, but still feasible. If the attacker still wants transactions to go through, the fake terminal could be connected to a real terminal, and the PIN pad controlled through electronic or mechanical actuators.

  3. Well it’s hard to generalize on POS design, but at least in the EU POS terminals are generally required to have physical security measures. Additionally for many markets they are required to be evaluated against standards such as PCI. Keys need to be stored in volatile memory so that when a tamper alarm is generated power is cut from this memory. As is usually the case some manufactures of POS terminals are VERY physically secure, and some are not. Additionally one of the design requirements of a good POS terminal is to make it difficult to tap any lines running from the PIN pad to the ‘secure area’ of the terminal.

  4. There is (or perhaps was) a chip & pin terminal in the M&S Simply Food shop at Cambridge Station which has a thoroughly busted case “repaired” with sticky tape, which appers to work fine. I refuse to us it…

  5. Nick Murray 8th May 2006

    We are seeking a major joint venture manufacturing partner to work with us in the development of a new biometrics chip + pin card system for reducing identity theft and High Street card fraud at the sales terminal.

    This is a unique biometrics opportunity and not another finger print device.

    The Royal Bank of Scotland has expressed interest in marketing the finished product but they don’t want to be involved in development projects.

    I look forward to receiving contacts from any of the major players, IBM etc.

    Best Regards,

    nickmurray1@aol.com

  6. Any relevent information for EFTPOS systems down under in Oz?

    Thanks for any lnks / refs …..

    D.

Leave a Reply

Your email address will not be published. Required fields are marked *