Emv 2011
Emv 2011
Emv 2011
Andrea Barisani
<[email protected]>
Daniele Bianco
<[email protected]>
Adam Laurie
<[email protected]>
Copyright2011InversePathS.r.l.
Zac Franken
<[email protected]>
Chip&PINisdefinitelybrokenv1.3
What is EMV?
EMV stands for Europay, MasterCard and VISA, the global standard for inter-operation of integrated circuit cards (IC cards or "chip cards") and IC card capable point of sale (POS) terminals and automated teller machines (ATMs), for authenticating credit and debit card transactions. IC card systems based on EMV are being phased in across the world, under names such as "IC Credit" and "Chip and PIN".
Source: Wikipedia
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
Why EMV?
ICC / smartcard improved security over existing magnetic stripe technology offline card verification and transaction approval multiple applications on one card
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
Liability shift
liability shifts away from the merchant to the bank in most cases (though if merchant does not roll EMV then liability explicitly shifts to it) however the cardholder is assumed to be liable unless they can unquestionably prove they were not present for the transaction, did not authorize the transaction, and did not inadvertently assist the transaction through PIN disclosure PIN verification, with the help of EMV, increasingly becomes proof of cardholder presence
Chip&PINisdefinitelybrokenv1.3
Copyright2011InversePathS.r.l.
Liability shift
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
Liability shift
Canadian Imperial Bank of Commerce (CIBC) spokesman Rob McLeod said in relation to a $81,276 fraud case: our records show that this was a chip-and-PIN transaction. This means [the customer] personal card and personal PIN number were used in carrying out this transaction. As a result, [the customer] is liable for the transaction. The Globe and Mail, 14 Jun 2011
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
EMV adoption
03/2006 EPC Card Fraud Prevention Task Force presentation: Ban of magstripe fallback foreseen (date to be decided) as of 03/2011 magstripe fallback is still accepted pretty much everywhere
Chip&PINisdefinitelybrokenv1.3
Copyright2011InversePathS.r.l.
EMV is broken
S. J. Murdoch, S. Drimer, R. Anderson, M. Bond, Chip and PIN is Broken - University of Cambridge the excellent group of researchers from Cambridge proved that stolen cards can be successfully used without knowing the PIN the industry claims difficult practicality of the attacks, at least one bank rolled out detection/blocking procedures
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
skimmer: hidden electronic device that intercepts card <> terminal communication and collects available data we analyze the practicality of credit card information skimming, cloning and PIN harvesting on POS terminals we intentionally ignore magstripe skimming (which is still effective and widely used) and focus on the chip interface
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
ATM skimmers
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
EMV skimmers
we predict that skimming the chip will become an extremely appealing target to fraudsters the chip interface is inherently accessible it becomes impossible for the user to verify if the terminal has been tampered as the chip interface is not visible (unlike most magstripe one for POS terminals) an EMV skimmer could go undetected for a very long time and requires little installation effort
Chip&PINisdefinitelybrokenv1.3
Copyright2011InversePathS.r.l.
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
EMV skimmer
trivial installation by hooking with a special card powered by the POS itself data can be downloaded with a special card recognized by the skimmer little development effort + cheap
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
EMV smartcards
information is stored on a filesystem organized in applications, files and records the terminal talks to the card via APDU messages for reading records and issuing commands
Examples: 00A404000E315041592E5359532E4444463031 <- Select '1PAY.SYS.DDF01' 0020008008246666FFFFFFFFFF <- Verify PIN ('6666')
the EMV skimmer can intercept, read, man-in-the middle every part of the terminal <> ICC exchange
Chip&PINisdefinitelybrokenv1.3
Copyright2011InversePathS.r.l.
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
stored with BER-TLV templates and read by the terminal, some examples:
tag name ----|---------------------------------------4f Application Identifier (VISA) 5f2d Language Preference (itenfrde) 9f1f Track 1 Discretionary Data 57 Track 2 Equivalent Data 5f25 Application Effective Date 5f24 Application Expiration Date 5a Application PAN (credit card number) 8e Cardholder Verification Method (CVM) List 5f20 Cardholder Name 9f36 Application Transaction Counter (ATC) 9f17 PIN Try Counter
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
The CVV (228) matches the magstripe one only for cards that do not use iCVV (a different stored value to protect against this attack, introduced in January 2008 but not present on all cards)
Copyright2011InversePathS.r.l. Chip&PINisdefinitelybrokenv1.3
while the service code on the magstripe might indicate that the chip must be used, inserting a card without a readable chip will trigger magstripe fallback on all tested terminals EMV skimmers cannot clone successfully to magstripe if iCVV is used however it is fair to say that the possibility of massive harvesting + being protected by a 3 digits code is not a comforting scenario
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
application data can be used to perform Card Not Present transactions (online, phone, ...) with parties that do not check Card Security Code (CVV, CVV2, ...) and do not employ 3-D secure (Verified by Visa, MasterCard SecureCode also known as phishing heaven) if you think that the amount of websites that do not check the security code is negligible...think again ironically one of the authors has been defrauded on such sites while this presentation was being written...
Chip&PINisdefinitelybrokenv1.3
Copyright2011InversePathS.r.l.
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
depending on the chip technology three methods are available: Static Data Authentication (SDA), Dynamic Data Authentication (DDA), Combined Data Authentication (CDA) used by the terminal to validate the authenticity of the card enables offline transactions where supported never used by ATM (always online) Visa and MasterCard mandate all cards issued after 2011 to use DDA
Chip&PINisdefinitelybrokenv1.3
Copyright2011InversePathS.r.l.
cheapest and most widely used technology selected records (advertised by the card and customized by the issuer) are signed with a static signature symmetric key is used for online transactions offline PIN verification is always cleartext
8f: 90: 9f32: 92: 93: Certificate Authority Public Key Index (PKI) Issuer PK Certificate Issuer PK Exponent Issuer PK Remainder Signed Static Application Data
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
chip is more expensive, rare usage as of 2011 static data validation (against hash within certificate) dynamic data validation, terminal asks the card to sign data + random number with ICC PK ICC PK embeds PAN (limiting private key usage to this card) offline PIN verification can be cleartext or enciphered
8f: Certificate Authority Public Key Index (PKI) 90: Issuer PK Certificate 9f32: Issuer PK Exponent 92: Issuer PK Remainder 9f46: ICC PK Certificate 9f47: ICC PK Exponent 9f48: ICC PK Remainder
Chip cloning
SDA cards can be cloned and used without PIN for offline transactions only (Yes card) DDA cards clone ineffective for offline and online transactions, however a valid DDA card can be used to pass offline authentication and perform fake offline transaction (not tied to the authentication) offline transactions are rare in EU
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
Threats
data stealing: we discussed EMV skimming usage for magstripe cloning and online usage card stealing: Cambridge research shows that stolen cards can be used without PIN, hopefully this attack will be fixed does state of the art EMV usage really protect against PIN harvesting and therefore the use of stolen cards?
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
Cardholder verification
the card advertises to the terminal the cardholder verification method preference via the CVM List (tag 8E)
Cardholder Verification Method (CVM) Condition Codes
----------------------------------------------------------------------------------------------------------------------------Bits 8 7 6 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 1 Meaning 5 4 3 2 1 RFU Fail cardholder verification if this CVM is unsuccessful Apply succeeding CV rule if this CVM is unsuccessful Fail CVM processing Plaintext PIN verification performed by ICC Enciphered PIN verified online Plaintext PIN verification by ICC and signature (paper) Enciphered PIN verification by ICC Enciphered PIN verification by ICC and signature (paper) Enciphered PIN verification by ICC and signature (paper) Values in range 000110 011101 reserved for future use Signature (paper) No CVM required Values in range 100000 101111 reserved for future use Values in range 110000 111110 reserved for future use Not available Value N/A N/A N/A 00 or 40 01 or 41 02 or 42 03 or 43 04 or 44 05 or 45 05 or 45 06-1D/16-5D 1E or 5E 1F or 5F 20-2F/60-6F 30-3E/70-7E 3F or 7F
0 0 0 0 0 0 0 x 1 1 0 1 1
0 0 0 0 0 0 0 x 1 1 x x 1
0 0 0 0 1 1 1 x 1 1 x x 1
0 0 1 1 0 0 0 x 1 1 x x 1
0 1 0 1 0 1 1 x 0 1 x x 1
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
CVM List
the CVM List is nowadays signed on all cards, therefore it is believed to be tamper proof if the preferred authentication method is Signature (paper), Enciphered PIN verified online or Enciphered PIN verification by ICC then the PIN is not sent by the terminal to the card it is believed that only when Plaintext PIN verification performed by ICC is present and selected from the CVM List the PIN can be harvested by the EMV skimmer
Chip&PINisdefinitelybrokenv1.3
Copyright2011InversePathS.r.l.
Action Codes
assuming a scenario with DDA only cards and a secure CVM List can we still harvest the PIN ? Issuer Action Codes (card) and Terminal Action Codes (terminal) specify policies for accepting or rejecting transactions (using TVR specifications) Issuer Action Codes and Terminal Action Codes are OR'ed three kinds: Denial, Online, Default; the Online Action Codes specify which failure conditions trigger online transactions
Chip&PINisdefinitelybrokenv1.3
Copyright2011InversePathS.r.l.
translation: do not deny a transaction without attempting to go online, if offline SDA fails transmit the transaction online in all tested terminals / cards we were able to manipulate the action codes (when necessary) so that tampering with the CVM List would not result in offline rejection
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
the modified CVM List is honoured by the terminal which means that Plaintext PIN verification performed by ICC can be presented enabling PIN harvesting for SDA/DDA cards
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
Copyright2011InversePathS.r.l.
Backend detection
the attack execution might be detected by the backend (via the TVR, CVM Results and CVR advertising failed data authentication and cleartext CVM) but blocking a card solely on this information does not feel like a realistic solution a downgraded CVM List with offline PIN + fallback to online PIN might be used to hide cleartext CVM Results and CVR by answering incorrect PIN offline verification to the terminal (without passing the command to the card), customer would be prompted twice for the PIN
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
Backend detection
(untested) it would be also possible for the skimmer to advertise relevant offline authentication records from a stored valid SDA card with a convenient CVM List for the authentication phase, and use the real card for the transaction, this would result in clean TVR, CVM Results and CVR Terminal Capabilities (9f33), when requested by the card via CDOL1/CDOL2 and sent by the terminal via GENERATE AC, can be intercepted and rewritten to advertise only SDA capability in case of DDA card skimming CDA is designed to protect against this but it should still be possible for the skimmer to force usage as an SDA card
Chip&PINisdefinitelybrokenv1.3
Copyright2011InversePathS.r.l.
Summary
an EMV skimmer poses a serious threat due to ease of installation and difficult detection EMV data allows fraudulent usage on websites that perform insufficient validation (as well as magstripe clone for cards that do not use iCVV) the PIN can be always intercepted despite card type (SDA or DDA) and CVM / Issuer Action Codes configuration stealing an EMV chip & pin card that was previously skimmed enables full usage and raises serious liability considerations
Chip&PINisdefinitelybrokenv1.3
Copyright2011InversePathS.r.l.
Vendor Response
EMVCo announced that the hole will not be fixed saying that when the full payment process is taken into account, suitable countermeasures are available MasterCard spokesman Jan Lundequist (head of chip product management) said in an interview that the EMV system is simply too complex for an easy fix In the Netherlands the hole has been reportedly closed by updating POS firmware with a version which apparently disables plaintext PIN verification for domestic cards (believed to be 100% DDA)
Chip&PINisdefinitelybrokenv1.3
Copyright2011InversePathS.r.l.
Recommendations
despite industry claims about reduced fraud levels in our opinion EMV is inadequate and overly complex, it should be replaced with a simpler and cleaner solution correctly implemented crypto should be performed between card <> backend (online) or card <> terminal (offline) for double authentication and preventing interception/man-inthe-middle attacks for every single step of the transaction terminals cannot be trusted, PIN input and verification should be confined on the card itself (e-ink scrambled touchpad)
Chip&PINisdefinitelybrokenv1.3
Copyright2011InversePathS.r.l.
Recommendations
patching EMV is possible by disabling plaintext PIN verification on POS and ATM firmwares preventing the downgrade attack despite some vendor response claiming otherwise this would play nicely with every card type as on-line PIN verification can be used for SDA actually on-line PIN verification could be used all the time, both North America and European banks have reportedly little use for the whole off-line verification mess pushed by EMV and could do everything on-line...
Chip&PINisdefinitelybrokenv1.3
Copyright2011InversePathS.r.l.
chip skimmer installations dated 2008 have been reported in the wild by law enforcement authorities after this presentation was made available
Copyright2011InversePathS.r.l.
Chip&PINisdefinitelybrokenv1.3
http://www.integra-group.it
Copyright2011InversePathS.r.l. Chip&PINisdefinitelybrokenv1.3