Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

international journal of critical infrastructure protection 26 (2019) 100302

Available online at www.sciencedirect.com

journal homepage: www.elsevier.com/locate/IJCIP

“Internet of Smart Cards”: A pocket attacks


scenario

Luigi Sportiello1
European Commission, Joint Research Centre (JRC), Ispra, Italy

a r t i c l e i n f o a b s t r a c t

Article history: Smart cards are secure devices used to store people sensitive data and to regulate impor-
Received 18 October 2018 tant operations like identity proofs and payment transactions. For years people have been
Accepted 15 May 2019 used to contact smart cards but in the last decade we have seen the massive introduction
Available online 22 May 2019 of contactless smart cards. At the same time we have seen a growing number of mobile
phones equipped with a NFC interface in circulation, which are capable of interacting with
Keywords: contactless smart cards.
Contactless Smart Card Under different circumstances the user’s contactless cards and mobile phone are kept close
NFC together at a distance that should enable them to interact each other, for instance in pock-
Relay Attack ets and bags. We describe an architecture to attack the contactless cards of a user through
Smart Cards Botnet his NFC-equipped mobile phone. The user’s mobile phone, here defined as smart-mole, is
ePassport infected and connected to the NFC-equipped one of the attacker, the proxy. The victim’s
EMV Payment Card phone capabilities are exploited to run local attacks against a contactless card in its range,
for instance to recover the card PIN that is then sent back to the attacker. Subsequently the
attacker remotely uses the victim’s card through a relay attack putting his phone in front of
a reader and providing the PIN of the victim card when needed, basically impersonating the
cardholder. Infecting several phones an attacker could have under his control a large set of
cards, a sort of “Internet of Smart Cards”.

We show that surveying a decade of research and development in the contactless cards field
such attacks look feasible according the current social context and the level of technology.
We also discuss how they could be methodologically applied by an attacker to defeat the
different measures currently adopted to secure contactless cards.

© 2019 The Author. Published by Elsevier B.V.


This is an open access article under the CC BY license.
(http://creativecommons.org/licenses/by/4.0/)

ized with user-specific data stored in the chip. The card is then
1. Introduction presented to the system to be identified and to be granted the
relevant rights and operations. For years people have used the
Starting from the 80s people have got used to running differ-
so-called contact smart cards. They are featured by a visible
ent operations of their life through a smart card, a plastic sup-
chip on the card surface and have to be physically inserted
port with a chip embedded in it. In the context of a system
each user can be provided with a unique smart card personal-

E-mail address: luigi.sportiello@ec.europa.eu


1
This research did not receive any specific grant from funding agencies in the public, commercial, or not-for-profit sectors.

https://doi.org/10.1016/j.ijcip.2019.05.005
1874-5482/© 2019 The Author. Published by Elsevier B.V. This is an open access article under the CC BY license.
(http://creativecommons.org/licenses/by/4.0/)
2 international journal of critical infrastructure protection 26 (2019) 100302

attack against a contactless card consists in deceiving a reader


into believing that it is in proximity of such a card when in fact
it is not. Two devices are needed, a proxy and a mole: the proxy
is nearby the reader while the mole has to be in proximity of
the victim card. The devices have to be equipped with a con-
tactless card compliant interface, respectively to interact with
Fig. 1 – Relay attack against a contactless smart card. the reader and with the card, and a communication channel
has to be established between them. The commands sent by
the reader are forwarded to the card through the proxy-mole
link and vice versa for the card responses. The attacker who
in a card reader incorporated in the system to be operated. presents the proxy to the reader can pretend to be the card-
This allows to establish a physical contact between the sys- holder of the victim card enjoying the rights granted by such
tem and the pins of the chip, to power it and to start a commu- a card.
nication between them. Such a gesture is become famous in The concept of relay attack was introduced in the “Grand-
particular for the use of debit/credit cards in payment termi- master Chess Attack” scenario [6]. An attacker can win a chess
nals at the points of sale, where the card is used to authorize match against a grandmaster without even knowing the rules
payment transactions for the goods purchased by the relative of the game. The attacker starts an epistolary chess game
cardholder. against two grandmasters, exchanging moves with them by
In the last decade we have seen the progressive introduc- mail and playing white with the first grandmaster and black
tion of contactless smart cards. For such a card the chip is con- with the second, or vice versa. The attacker forwards the
nected to a coil and both elements are completely immersed moves of a grandmaster to the other. The two grandmasters
in the card plastic support, making them invisible. The card are deceived into playing together even if they both believe to
is operated placing it in the range of 0–10 cm from a reader play against the attacker, who, at the end, wins a game. The
that emits a RF field. The field is used to power the chip by in- relay attack architecture specifically presented in Fig. 1, with
duction through the coil and to communicate with it modulat- two malicious entities (i.e., proxy and mole) interacting in the
ing commands and responses [1]. Such cards are also simply middle of two honest parties, was first introduced in [7] and it
known as contactless cards, or as RFID cards for their commu- is also known as “mafia fraud”.
nication nature similar to that of RFID tags [5], or as NFC cards Different real relay attacks against smart cards have been
for their capability to interact with devices equipped with a presented in the literature, highlighting how the threat for
Near Field Communication (NFC) interface [3]. such devices has been brought to a practical level. A relay
Contactless cards are observing a growing interest in the attack against contact smart cards is described in [8], but
market as they enable fast and easy operations, given that the many more are the experiments presented against contact-
card has to be just waved in proximity of the reader, in sev- less cards, which are unfortunately particularly suitable for
eral cases without even the need to pull it out of the wallet or this kind of attacks. The attacks differ for the equipment used
pocket. In addition, their contactless communication nature for the proxy and mole roles and for the communication chan-
eliminates the common wear and tear effect that affects con- nel established between them.
tact smart cards. Contactless cards are becoming more and First studies for the implementation feasibility of relay at-
more widespread and used, among others, as tokens for ac- tacks against a contactless smart card are carried out in [9].
cess control of protected facilities and environments, as elec- One of the first complete attacks is presented in [10], where
tronic identity documents, as payment cards and as electronic two specific pieces of hardware are designed to implement
tickets. both the proxy and the mole, which communicate over a ded-
Due to their over-the-air communication, contactless cards icated RF channel achieving a relay distance of 50 m. Other
are prone to security issues. In particular the messages ex- implementations using custom-made proxy and mole are pre-
changed between card and reader could be eavesdropped, or sented in [11,12]. The introduction on the market of mobile
the card content could be stealthily skimmed establishing phones equipped with a NFC interface, and so capable of inter-
a contactless communication with its chip. If accessed, the acting with contactless cards and readers, has favored a sort
card content could be also used to create a card clone. As of boom in the implementation of such attacks [13]. The au-
countermeasures contactless card communications are typ- thors of [14–17] propose a hybrid solution, with the mole rep-
ically encrypted and access control mechanisms are adopted resented by a mobile phone whereas a specific programmable
to access the chip content and its functionalities, for instance device is used as proxy, with the two devices that communi-
requesting that the cardholder provides a code (e.g., PIN) cate together through a Bluetooth connection, getting a re-
via the system the card is interacting with. To prevent the lay distance of some meters. A solution based on two mo-
card cloning challenge-response mechanisms are typically bile phones has been presented in different researches and
adopted: the reader sends a random number that is combined this is reasonable considering that the adoption of off-the-
by the card with a secret cryptographic key, which is unique shelf devices frees the developer from the design of custom-
for the card and securely stored in its memory, to generate a made components. In [16,18,39,41,42] the authors use either
response. a Bluetooth connection or a Wi-Fi network (WLAN) to con-
Nonetheless, even if attacks countermeasures are adopted, nect together the two mobile phones acting as proxy and
a powerful solution could still be available to malicious guys mole, reaching a relay distance of a few tens of meters. The
to attack contactless smart cards: relay attacks (Fig. 1). A relay authors of [19] rely on the mobile phone operator Internet
international journal of critical infrastructure protection 26 (2019) 100302 3

connection of the two phones to build a communication chan- • an attack analysis is given, discussing how the presented
nel between them, relaying the communication over kilome- architecture can be methodologically leveraged to defeat
ters on a geographical scale, finally proving that the attack is all possible cards security measures;
nowadays practical and effective. • in light of the threat posed by the presented contactless
In a relay attack scenario the reader directly interacts with cards attacks a vision on the possible upcoming scenarios
the original card. This allows to circumvent some of the tech- is given.
niques used to secure contactless smart cards. For instance
in case of encrypted communications the secure channel set The paper is organized in the following way. Section 2 is
up and management is directly handled by the two original devoted to the presentation of the communication technol-
parties, with the attacker that does not have to play any role ogy used by contactless cards and the mechanisms adopted
in this. It is analogous if challenge-response mechanisms are to secure their use. In Section 3 we present the architecture to
adopted to guarantee the card genuineness. Access control remotely attack contactless cards and in Section 4 we discuss
mechanisms can be an effective countermeasure against re- its possible application against electronic passports and pay-
lay attacks, since if the attacker handling the proxy does not ment cards. In Section 5 we give an analysis about the attack
know the card code to be inserted in the system (e.g. PIN) he application, discussing how the presented architecture can be
is prevented from carrying out the transaction. Anyhow this methodologically exploited to attack the different kind of con-
works if access control mechanisms are well designed and im- tactless cards in circulation. In Section 6 we analyze the possi-
plemented, that is not always the case, indeed we discuss how ble impact of such an attack architecture taking into consider-
some possibilities could have been left open to attackers. ation current trends in contactless cards and mobile phones,
In this paper we show that there is the potential for prac- discussing also possible countermeasures, while Section 7 is
tical and powerful frauds against contactless cards relying on for conclusions.
relay attacks extended with some logic. The frauds could be
basically realized through an extensive survey and collage of
what has already been proposed in the literature. In particu-
2. Contactless cards technology
lar we discuss an architecture that enables an attacker to re-
motely attack a contactless card exploiting an infected NFC-
Here, we summarize the protocol used for the communication
enabled mobile phone in its vicinity. The phone could be for
between contactless cards and readers, as well as the counter-
instance used to extract card data like its PIN, which is then
measures adopted to tackle the security issues that can gen-
sent back to the attacker. Afterwards the victim card is re-
erally affect these cards.
motely used by the attacker through a relay attack, with the in-
fected phone used as mole and connected to a NFC-equipped
attacker’s phone employed as proxy. The attacker can use the 2.1. Communication protocol
recovered data, e.g., the PIN, when needed during the relayed
transaction. In this way the attacker impersonates the card- At the base of the protocol stack for contactless card-reader
holder and can for instance carry out identity thefts and finan- communications the ISO/IEC 14443 [1] standard is one of
cial frauds. The attack could be extended to potentially affect the most used. It details the physical characteristics of the
several mobile phones with diverse contactless cards in their card and specifies the features of the RF field, operating at
range, making all such cards potentially available to the at- 13.56 MHz, used to power the card along with its modulation
tacker, like a sort of smart cards botnet or “Internet of Smart for the card-reader communication. Upon this physical layer
Cards”. We discuss the applicability of such an attack architec- the standard specifies the anticollision procedures to man-
ture to two popular contactless card applications, electronic age the possible presence of multiple cards in proximity of
passports and payment cards, which have raised much inter- a reader, the format of the frames used in the communica-
est in media and in the academic world in the last decade. The tion and the half-duplex protocol used to exchange frames
paper contribution can be summarized as follows: between card and reader.
Contactless cards have to be put in a range of maximum
10 cm from the reader to be operated, so a physical prox-
• the security measures that can be adopted to protect con- imity is required to establish an interaction. Once the card
tactless cards are recapitulated; has been put in the field of the reader, the two devices set
• a practical architecture for remote attacks against contact- up a communication exchanging first initialization and anti-
less cards is discussed, which is substantially an extension collision frames. The communication is then organized in a
of the long distance relay attack of [19] with an empha- master-slave mode: the reader sends a request and the card
sis on the role of the mole, here re-defined as smart-mole, replies with a response. This process is iterated throughout
showing that the attack looks feasible on the base of what the entire card-reader interaction.
has been already published in the literature and highlight- The standard sets some time constraints for the request-
ing possible scenarios; response exchange. Specifically, the response has to be re-
• the possible application of the discussed attack archi- turned to the reader within a maximum time fixed before-
tecture against two popular contactless card applications hand. If during the communication the reader does not receive
like electronic passports and payment cards is discussed, any response for a sent request within the specified maximum
showing again the possible feasibility on the base of the time, after a recovery attempt, it aborts the communication, as
available literature; probably something has disrupted the interaction. This time
4 international journal of critical infrastructure protection 26 (2019) 100302

limit is fixed by the card at the beginning of the communica- during all the messages exchanged before the access to the
tion through a parameter called Frame Waiting Integer (FWI), card data, so as to prevent any tracking possibilities. Since a
which allows the setting of a maximum response time of at contactless card is used in the context of a system to provide
most ∼ 4.95 s. The FWI is typically used by the card to inform an identity and to be granted operations and services, it is also
the reader that a certain amount of time will be needed to re- important to guarantee the authenticity of its content and to
turn some responses, which is the case of responses that re- prevent the cloning of the card, as well as to restrict its usage
quire time consuming operations to be elaborated (e.g., cryp- to the legitimate cardholder only, so as to prevent someone
tographic computations). This mechanism avoids erroneous else to impersonate the cardholder and to enjoy undeserved
abortions of communication, but on the other hand facilitates rights.
relay attacks, as we remark in Section 3. To satisfy the security measures discussed above, all or part
The card-reader interaction is encoded through Applica- of the following mechanisms are adopted in contactless cards,
tion Protocol Data Unit (APDU) messages, which are speci- according to their application domain:
fied in the ISO/IEC 7816-4 standard [2]. Such APDUs define secure communication channel – the card-reader messages
several operations, like read/write data from/to the card chip can be encrypted and the integrity of the communication can
and reader/card authentication requests. The APDUs are en- be protected, e.g., applying a message authentication code
capsulated into ISO/IEC 14443 request-response frames dur- (MAC) to the exchanged messages. This allows not only to pre-
ing the communication: specifically the reader sends APDU vent eavesdropping and tampering, but it is also a first mea-
commands and the chip replies with APDU responses. APDUs sure against the card cloning as the card content transmitted
are byte strings featured by the following format in the messages is inaccessible. In addition the encryption is
usually randomized preventing replay attacks.
reader authentication – the reader, or in general the system
behind it, could be authenticated to verify its rights to ac-
cess the card data and its functionalities. The reader-side sys-
tem could be equipped with a cryptographic public/private
key pair linked to a digital certificate verifiable by the card. A
challenge-response authentication is carried out at the begin-
where CLA are class bytes, INS denotes the command the
ning of the interaction: the card retrieves the certificate and
chip has to run, P1 and P2 are command parameters, Lc is
sends towards the reader a random number, returned digi-
the length of the data sent by the reader and contained in
tally signed by the system. The signature is finally verified by
the Data field, Le represents the expected length of Data
the card and, if successful, specific rights are granted to the
in the response, and SW1-SW2 are status bytes returning
reader-side system according to its identity as specified by the
information regarding the launched command (e.g., suc-
certificate.
cessful/unsuccessful operation). The received command is
card genuineness verification – the card content can be dig-
typically parsed by the card chip, the identified command
itally signed by the card issuer, so as to prevent third par-
executed and the relative response returned.
ties from the preparation of cards then used with the system.
This obviously does not hinder the card cloning, which can be
2.2. Security mechanisms prevented equipping the card with a public/private key pair
and running a challenge-response authentication towards the
Contactless cards are usually security-certified products. To card. Alternatively, the card can be equipped with a symmetric
get such a certification the whole development and testing key shared with the system: the card applies message authen-
life cycle of a contactless card has to be carried out according tication codes to the exchanged information, which are then
to the rules of a security certification scheme (e.g., Common verified by the system. In case of failure the card is rejected.
Criteria [4] is one of the most used schemes for smart cards). The effectiveness of these anti-cloning measures depends on
As the result of the certification, the hardware and software of the capability to protect the private/symmetric key stored
the card should be able to withstand publicly known attacks in the card from software/hardware attacks, which is typi-
in the field, as for instance side channel attacks to extract cally assured by the security certification. Note that thanks to
secret cryptographic material stored in the card chip. the strict card-reader vicinity required by the communication
Taking into consideration the over-the-air nature of the standard in conjunction with the anti-cloning measures de-
card-reader communication and the usual private nature scribed here, it is necessary that the original card is in physical
of the data transmitted, like cardholder’s personal data or proximity of the reader to authorize an operation.
bank account details, the messages exchanged by the parties card access control – an access control code can be used to be
should be protected against tampering and eavesdropping. sure that the card is operated only in the presence of the legit-
Additionally, having in mind the sensitiveness of these data, it imate cardholder. The code is typically a secret piece of infor-
can be also required to verify whether the reader is authorized mation known only by the card owner and stored in the card.
to read them out from the card, as the access could have been At the time that the card interacts with the reader and the sys-
restricted to a subset of entities. This access limitation to the tem behind it the user is instructed to provide the code, e.g.,
card data, which are usually potential unique identifiers, also typing it through a keyboard (Fig. 2), or the code is introduced
helps to prevent the possible tracking of people movements before the interaction is started, according to the application
reading out their cards content at different locations. For this specifications. The provided code can be either sent to the card
reason the use of any unique identifier should be avoided even that compares it with the one stored in its memory (e.g., a
international journal of critical infrastructure protection 26 (2019) 100302 5

Fig. 3 – The NFC-equipped mobile phone and contactless


cards of a user may be kept close together in different
Fig. 2 – As security mechanism a confidential access code circumstances.
associated to the card has to be provided to the reading
system that is going to access the card content and its
functionalities.
wallet and the phone may be kept together, for instance one
above the other on a desk. When these scenarios are featured
by NFC-equipped mobile phones and contactless smart cards,
PIN), or used for instance as parameter to generate a symmet- the short distance between a phone and the relative cards
ric cryptographic key used in the protocol between card and might allow a contactless interaction between them.
reader (i.e., the provided code is used reader-side while the When the conditions depicted above are met, there is room
card relies on the stored one). The insertion of a wrong code for attacks. Indeed, the architecture presented in Fig. 4 could
makes the card to abort the transaction. A threshold can be be used to run attacks against those people, the victims, who
set on the number of wrong codes that can be presented in a own and keep together some contactless cards and a NFC-
row, after that the card is blocked or the interaction is delayed equipped mobile phone, which can be leveraged as contact-
so as to prevent brute-force attacks. less attack platform [20]. Specifically the victim’s phone, that
In light of the measures mentioned above contactless cards we call smart-mole, has to be infected with a malicious appli-
are considered smart secure devices used to regulate the exe- cation developed by the attacker and has to be connected to
cution of important operations and to store sensitive data that the Internet, which is nowadays common for almost all mo-
are selectively disclosed. bile phones in circulation, usually linked to the data network
offered by the mobile phone operator. The attacker needs a
NFC-equipped mobile phone connected to the Internet, called
3. Remote contactless cards attack proxy, with another specific application developed by the at-
tacker himself installed on it. The mole and proxy applica-
Many modern mobile phones are featured by good com- tions establish an Internet connection to interact each other.
putation capabilities and are equipped with a Near Field The mole application uses the NFC interface of the phone to
Communication (NFC) interface that allows them to interact act as reader and to interact with the cards in its vicinity. The
with contactless readers and contactless cards [3]. When proxy application, instead, can put the phone in card emula-
interacting with contactless readers the phone is put in card tion mode using its NFC interface to interact with a reader in
emulation mode, receiving reader APDU commands and its proximity. Such an architecture enables the attacker for the
replying with APDU responses on top of an ISO/IEC 14443 following malicious operations:
channel. Vice versa, when in front of contactless cards the interaction with the victim’s cards – the mole application can
phone acts as reader sending commands and waiting for instruct the phone to scan the cards in its vicinity returning
responses. Such a phone behavior is typically controlled by the list of detected cards to the proxy. If not protected, the
installing applications on the device, which turn it into card cards content can be read out and returned to the attacker
emulator or reader according to the desired functionality (e.g., phone. The proxy could be also used by the attacker as “re-
installing a ticketing application on the phone, it can be used mote terminal”, to remotely send APDU commands via the
to pay public transportation in front of appropriate readers). proxy-mole link towards the victim cards, receiving the rela-
The APDU commands parsing and execution as well as the tive responses. In case a secure communication is adopted for
APDU responses generation are managed at the application the card-reader communication, the mole could be leveraged
layer. In general software developers can program their own to run pre-play attacks, making the card to generate messages
phone applications, exploiting the NFC interface for their afterwards presented by the attacker to reader. The mole can
purposes, simply relying on the software development kit of be also leveraged to run denial of service attacks, for instance
the phone [41]. launching commands that can block the card (e.g., series of
It can happen under many circumstances that a person wrong PIN in a row).
keeps his smart cards and his mobile phone close together attacks the victim’s cards access control mechanism – if some
(Fig. 3). This is for instance the case of smart cards put in a access control measures are adopted to protect the content of
wallet, which is in turn kept close to the mobile phone for a card or its functionalities, which can be based on a secret
instance in a pocket, in a handbag, in a shoulder bag or in a code used as PIN or as shared secret between card and reader
bum bag. Additionally mobile phone covers featured by some as explained in the previous section, the mole with its com-
slots to store cards along with the phone itself are also par- putation capabilities and its NFC interface could be exploited
ticularly widespread nowadays. Also at home or at work the to run an attack against the card, for instance to recover such
6 international journal of critical infrastructure protection 26 (2019) 100302

Fig. 4 – Attack architecture: the victim card is reached by the attacker through his NFC-equipped mobile phone connected to
a NFC-equipped mobile phone in proximity of the card. The phone close to the victim card can be instructed to run local
attacks, e.g., to extract and return the card access code, and the entire architecture can serve for relay attacks.

a secret code. The retrieved code could be used to access the tions or standards the attack may not be applicable in practice
card content and functionalities or could be sent back to the (e.g., if only delays shorter than 0.5 s are allowed).
attacker for later uses. Note that it may be possible to run this It has been also noted that mobile phone network opera-
kind of attacks in chunks instead of all at once. For instance tors can assign to their phones IP addresses that do not al-
a brute-force attack could be carried on only when the victim low to accept incoming connections at the device level. This
card is in the phone proximity and paused otherwise. means for instance that the proxy could not be instructed to
remote usage of the victim’s cards – the entire architecture can listen on a port waiting for incoming connections from in-
be used to run relay attacks against a victim’s card. The at- fected moles. Similarly it could be hard for the phones to ac-
tacker put its proxy in front of a reader pretending to be the cept incoming connections when they are connected to the In-
victim. The reader APDU commands received by the proxy ap- ternet through a Wi-Fi network. In addition it can also happen
plication are forwarded to the card through the proxy-mole that the phones are interfaced to the Internet via dynamic IPs,
link and vice versa for the card APDU responses. In case an making the connection to a specific device harder. All these
access control code is needed to use the card, the attacker problems are circumvented opening connections from the
could have got it in advance attacking the card with the mole. mole and from the proxy towards a dedicated server placed
Note also that depending on the context, the relay architec- between them and instructed to forward their communica-
ture could be also exploited to run man-in-the-middle (MITM) tion [19]. Some experiments results are presented exploiting
attacks between card and reader. such an architecture, achieving an APDUs relay distance that
The exploitation of such an architecture to run relay at- is over 40 km with the phones accessing the Internet through
tacks on a geographical scale has already been shown in [19]. the data network of their mobile phone network operators,
In the presented experiments it is highlighted that the mole and over 500 km with the two phones relying on Wi-Fi connec-
manages a local ISO/IEC 14443 communication with the card, tions to access the Internet. This highlights that such attacks
while the proxy manages another independent ISO/IEC 14443 can be run on a geographical scale.
communication with the reader. The APDU bytes repre- Differently from traditional relay attacks we call the device
senting a reader command are extracted from the relative in proximity of the victim’s cards smart-mole instead of sim-
ISO/IEC 14443 frame and forwarded by the proxy application ply mole. This is motivated by the idea that in our architec-
towards the mole application, which in turn sends them to the ture such a device is not only a mere APDUs forwarder, but
card through its ISO/IEC 14443 established communication. it is also featured by some capabilities to interact with the
The APDU responses are managed in reverse order. The only surrounding cards. For instance it could be instructed to scan
possible issue for the relayed communication is represented the cards in its range distinguishing their roles (e.g., ID cards,
by the delay introduced for the APDUs forwarding along the payment cards) and returning an educated list to the attacker.
network. Anyhow it has been shown that the round trip time The smart-mole could understand if the card content access is
at the proxy level to forward a command and to receive a re- protected or not, directly reading it out and returning it to the
sponse is in the order of ∼ 0.5 s, by far below the maximum attacker in the latter case. Note that it would not be manda-
delay allowed by the standard to return a response ( ∼ 4.95 s). It tory to send such a content to the proxy, it could be also sent to
has to be noted that for cards compliant with other specifica- the attacker via other means, like emails. Additionally, and in-
international journal of critical infrastructure protection 26 (2019) 100302 7

terestingly, the smart-mole could be used to run local attacks are used by the reader as seed to derive a couple of symmetric
towards a card in its range, as for instance to unlock some keys KENC and KMAC , respectively used to encrypt BAC mes-
access control mechanisms. We will discuss some examples sages and generate MACs on them. The same keys are already
in the next section. stored chip-side or are generated starting from the MRZ infor-
Note that such an architecture is potentially capable of de- mation presents in its memory.
feating all security measures that are nowadays in use for con- The BAC allows to mutually authenticate the reader and
tactless cards. Indeed, during a relay attacks all the crypto- the ePassport chip in the following way
graphic operations to protect the communication channel and
to authenticate the two parties are directly run by the original Reader ePassport
devices. Such an attack also nullifies the mandatory require- PC = chal l enge
ment of the card physical presence in front of the reader. Addi- PC
←−−−−
tionally, as already remarked, in case of access control mech- RC = chal l enge
anisms the smart-mole could be leveraged to attempt some CR = ENC(RC, PC )
MR = MAC(CR )
attacks.
CR , MR
The application of such an architecture requires the in- −−−−→
Check MR
stallation of a malicious application on the victim’s phone.
DEC(CR ), extract PC
This could be stealthily achieved through social engineering Check if PC is correct
techniques, for instance inducing the victim to click on web CP = ENC(PC, RC )
links in emails or social networks, or hiding the malware in MP = MAC(CP )
other applications or games distributed through phone soft- CP , MP
←−−−−
ware repositories [21]. Note that the inclusion of a malware Check MP
in another application could make the application itself to DEC(CP ), extract RC
Check if RC is correct
request extra credentials (e.g., access to the NFC functional-
ity), which depending on the phone operating system could be if a check fails, for instance the wrong MAC or challenge is
listed at installation time. This should ring a bell in the user returned, the communication is aborted preventing the access
head, but in practice the great majority of users do not pay any to the chip.
attentions to the credentials asked by the applications, quickly The natural usage of ePassport is for automated border
accepting any proposed condition. control at airports, where gates equipped with a contactless
reader and a scanner for reading the MRZ are able to extract
ePassport data for users identification. Usually a camera in-
4. Attack application examples stalled at the gate takes a photograph of the face of the person
who is passing through to compare it with an image stored in
Here, we discuss the possible application of the presented at- the document chip. Since ePassports are protected against the
tack architecture against two popular contactless card appli- cloning through challenge-response protocols [22,23], there
cations, electronic passports and payment cards. are also proposals to use them as strong authentication token
for online services [24], in a manner similar to that of some
4.1. ePassports case national electronic ID cards [54].
The proposed attack architecture could be used to attack
Nowadays several countries issue electronic passports (ePass- the BAC of an ePassport to read out part of its content and to
ports) to their citizens, an electronic version of the traditional run a relay attack. In particular the smart-mole could apply
passport used for people identification [22]. A contactless chip one of the following techniques when it is in proximity of the
storing personal data of the document holder is embedded in victim’s ePassport:
the ePassport cover. A mechanism to protect the access to the educated brute-force attacks – it has been shown that the
chip and the communication with it has been introduced, the MRZ of ePassports issued by different countries is featured by
Basic Access Control (BAC). The BAC is a mutual authentica- low entropy [25–29]. Basically it means that given a country,
tion protocol between chip and reader. Each ePassport is fea- there is a reduced set of values representing all the MRZs
tured by a private string called Machine Readable Zone (MRZ), in circulation, for instance encodable on 40–50 bits. The
that has to be known by the reader to successfully run the BAC smart-mole could interact with the ePassport to discover first
with the document chip and establish a communication with its nationality, achieved for instance analyzing the chip APDU
it. The BAC prevents unauthorized readings of the ePassport responses to some specific APDU commands [30], and then to
chip content and sets up a secure communication. run a brute-force attack against the BAC trying the different
The MRZ is printed in an internal data page of the ePass- MRZs. Even worse, different chip versions could be adopted
port booklet. The idea is that only the ePassport holder can for the ePassports issued in a specific country over time. It
authorize the access to the chip of his document, for instance has been shown that the different versions of the chip reply
explicitly showing such a page to an officer or providing the with different APDU responses to certain commands and
MRZ by himself: the string can be optically scanned or man- this can be used reader-side to infer the version of a target
ually typed to be passed to the reader. The MRZ encodes sev- chip. The set of chips of a specific version can be featured by
eral information, among which the passport number, the doc- a limited set of passport number and document expiration
ument holder’s date of birth and the document expiration date date values, resulting in a MRZ space for the entire set that is
that are relevant in the BAC. These three pieces of information representable with even less than 40 bits [29]. That being said
8 international journal of critical infrastructure protection 26 (2019) 100302

the smart-mole could first detect the chip version and then still relies on shared private information between reader and
run an educated brute-force BAC attack against it. chip, which can be, among others, again the MRZ. Similarly
context-aware attacks – the MRZ information used in the BAC to BAC, PACE could be potentially broken through a context-
protocol is represented by data that may be stored in the vic- aware attack.
tim’s phone memory. For instance it is common nowadays to Another electronic document that could be affected by the
store on mobile phones personal documents, boarding passes presented attack architecture is the electronic Driving Licence
or hotel reservations. The smart-mole application could be (eDL). Similarly to ePassports a chip can be embedded in the
programmed to extract documents or other data from the vic- document. Whether a contactless chip is adopted (also con-
tim’s phone, sending them back to the attacker. All or part of tact chips are possible) the access to its data is protected by
the MRZ information used for the BAC, passport number, doc- the Basic Access Protection (BAP) [33]. The BAP can be con-
ument holder’s date of birth and document expiration date figured to act exactly as the BAC, relying again on a machine
could be found by the attacker in the received material. If only readable string shared by the two interacting parties, and this
a portion of the needed information is found, this can be sent is exactly the approach adopted for the European eDL [34]. In
to the smart-mole that will use it to run a brute-force attack principle the attack methodology presented above can be also
on the remaining part of the MRZ. The retrieved information applied against such devices. In such a case, if for instance
can be of course combined with the techniques described in eDLs are used to prevent young or inexperienced people from
the previous point (e.g., chip versioning) to further reduce the using high-powered cars electronically restricting the ignition,
brute-force research space. The smart-mole could also extract this limitation could be circumvented through relay attacks.
part of the needed information from other cards in its vicinity,
as for instance a loyalty card storing the victim’s date of birth 4.2. EMV payment cards case
in a non-protected manner.
side channel attacks – it has been shown the possibility to Payment cards are largely widespread. When a bank account
attack some specific implementations of the BAC through the is subscribed, a debit and/or a credit card are usually contex-
analysis of side channels [31]. In particular analyzing the re- tually issued to the user. For years and still now most of the
sponse times of a target chip triggered with a set of specific payment cards in circulation are featured by a magnetic stripe
commands it is possible to assemble a (message, MAC) pair (mag-stripe) placed on their back side: swiping the card in a
where the MAC is a valid authentication code for the chip, as Point of Sale reader (POS) the bank information stored in the
if the right KMAC has been used to generate it. It is leveraged magnetic stripe is read out and the purchase is charged on
the fact that the chip behavior during MAC checks depends on the cardholder’s account. In the course of time in many coun-
the number of correct bytes of the authentication code, so for tries smart cards have been introduced to be used as payment
a given message the relative MAC can be reconstructed query- cards, with the bank information stored in the secure chip and
ing the chip with several (message, MAC) pairs varying the MAC accessed through a dedicated POS reader. Smart cards used for
bytes value and analyzing the response times. Leveraging the payments are historically contact cards, but in the last decade
low MRZ entropy the obtained pair can be sent to a cracking contactless cards have also been introduced. Note that it is
machine that recovers and returns the relative MRZ [27], or possible to have on a single payment card both the contact
having chosen the message beforehand a look up table with a and the contactless interface along with the mag-stripe, so of-
list of MACs generated on it with all possible MRZs can be pre- fering different way to run a payment transaction.
pared [31]. The attack has been shown using a desktop com- Each payment card is usually associated with a unique ac-
puter connected to a contactless reader, but if the attack is cess control code, the Personal Identification Number (PIN),
ported on mobile phone platforms it could be used by a smart- known only by the legitimate cardholder. At the time of a
mole. payment transaction the user can be asked to type the PIN
Once the smart-mole has broken the BAC of the victim’s through a POS keypad to authorize the transaction. The in-
ePassport, the holder personal details and a photograph of his serted PIN can be checked either sending it to the card through
face are retrieved. Such data could be used by the attacker for an APDU command, or forwarding it to the card issuer net-
scams providing the victim identity. When the BAC is broken work, with the POS waiting for the response. Usually if a wrong
the MRZ information is known by the attacker that can di- PIN is provided a few times in a row (e.g., 3 times), the card is
rectly use the original ePassport through relay attacks, circum- blocked. Contactless payment cards are generally designed to
venting the anti-cloning measures. At automatic gates the skip the PIN request for small amount transactions (e.g., be-
attacked ePassport could be used for fraudulent identity dec- low 30 Euros), even if the PIN could be requested in case the
larations, even if the attacker could be spotted by officer while accumulated amount of PIN-less transactions exceeds a cer-
using his phone or the face comparison phase should raise tain threshold.
some problems. However, if a victim with a face that resembles EMV is a well known and widespread global standard for
that of the attacker is found, the cheat may take place consid- smart card-based payment cards, both contact and contact-
ering that the face comparison systems commit errors [32]. A less [35]. The data stored in the chip of EMV contactless cards
relay attack could be particularly effective in case ePassports comprise a digital version of the information printed on the
are used as authentication token for online services, allowing card surface, like card number, cardholder name and expiry
the attacker to enjoy the victim’s rights on the web. date [38]. The contactless cards that adhere to the EMV spec-
In the last few years a new protocol called PACE [22] has ifications can offer different modes of operation to proceed
been proposed as access control mechanism to protect ePass- with a payment transaction when in front of a POS [36], among
ports. It is based on a different cryptographic protocol, but it which two main classes can be identified, mag-stripe mode
international journal of critical infrastructure protection 26 (2019) 100302 9

and full EMV mode. During a payment transaction in mag- received by the device, the corresponding cryptogram and ATC
stripe mode the card returns data similar to those stored in are retrieved from the memory and are returned to the POS.
magnetic stripes appending a dynamically generated cryp- Note that if the legitimate cardholder uses the card between
togram. Such a mode allows the use of the existing magnetic the collection phase and the attacker payment operation the
stripe infrastructures that are interfaced with the POS in circu- collected data are useless, as they are featured by ATCs that
lation. In mag-stripe mode each card relies on a unique secret are previous the last one used by the original card. Anyhow
key KCARD , known only by the card itself and its issuer, and on the data collection takes about only one minute [43], so the at-
a transaction counter (ATC). The scheme adopted to authorize tacker could ask the smart-mole to run a fresh collection just
a payment transaction is the following before his payment operation receiving the ready-to-use data
on his proxy. Even worse some obsolete cards exchange only
Reader EMV payment card static data during the payment transaction [44]. If the smart-
MagSt ripeDat a mole detects the presence of such a card it can emulate and
←−−−−−−−−−−−−
UN = random record a payment transaction with the card. The collected data
UN would be used by the attacker to emulate the original card in
−−−−−−−−−−−−→
ATC = ATC + 1 front of a reader.
Cryptogram = relay attacks – the original victim card can be directly used
f (CardData, UN, by the attacker exploiting the relay attack capability of the
ATC, KCARD ) presented architecture. Note that differently from pre-play at-
Cryptogram, ATC
←−−−−−−−−−−−− tacks the relay attack is not hindered by the ATC mechanism
Cryptogram, ATC and it works well even in case of transactions in full EMV
checked by card issuer
mode [42], which is usually adopted when available both for
with UN, Cryptogram and ATC sent to the card issuer network the reader and for the card. Nonetheless during a relay attack a
by the POS. The card issuer checks the received cryptogram card and a reader that are able to run a full EMV mode transac-
with the secret key and verifies that the ATC is monotoni- tion could be forced to fall down in mag-stripe mode. Indeed at
cally increasing. The ATC prevents replay attacks, while the the beginning of the transaction the card returns the list of its
so called unpredictable number (UN) should avoid that cryp- available modes of operation. The proxy-mole infrastructure
tograms are generated in advance with the real card for later can play a MITM attack eliminating the full EMV mode pos-
uses. In full EMV mode a payment protocol similar to the one sibility from the returned list [43], so forcing the mag-stripe
used for EMV contact payment cards is used. Such a protocol mode. The mag-stripe mode could be preferable as it entails
is a bit more complex than the one of mag-stripe mode and less operations and less exchanged data when compared to
each card is equipped with a public/private key pair to digi- the full EMV mode [36], resulting in a shorter transaction. This
tally sign the transaction data and to authorize the payment limits the likelihood of attack failures due to sudden disrup-
operation. tions of the mole-card interaction or of the phones Internet
The possible security issues of contactless payment cards connectivity.
have raised the interest of the academic sector since their in- PIN attacks – some EMV contactless cards make available an
troduction [37]. We show how the results of several researches APDU command to verify the card PIN [39], which replies pos-
could be exploited in the proposed attack architecture to at- itively if the command is provided with the correct PIN. The
tempt to commit frauds. In particular an attacker could apply smart-mole could leverage such a command to run an attack
the following techniques: to get the card PIN, which would be useful in other attacks
card data extraction – data like card number, cardholder when the PIN-less conditions are no more met and the PIN
name and expiry date stored in EMV credit card chips can has to be inserted (e.g., relay attacks for purchases over 30 Eu-
be freely accessible without any protection [38]. Such data ros). The smart-mole could adopt a brute-force approach pay-
could be read by the smart-mole sending them back to the ing attention to the number of PIN attempts left before the
attacker. The retrieved data could be for instance used for card is blocked: for each possible PIN value the smart-mole
fraudulent online payment transactions. Indeed on some web- first checks through a command if at least two PIN attempts
sites (e.g., Amazon) the 3 digits Card Verification Value (CVV) are left and then tests the value through the verify PIN com-
printed on the card back side is not required, making the mand [40]. The check avoids the card blocking that could raise
retrieved information sufficient to carry out payments [45]. suspicions in the cardholder. Note that when the card is used
On top of this it has to be noted that the missing card data by the cardholder with the correct PIN the attempts counter is
like the CVV may be also recovered with online guessing reset, so re-opening new possibilities for the attacker. Accord-
attacks [46]. ing to some studies several cardholders set the PIN for their
pre-play attacks – it has been found out that the range of payment card deriving it from their date of birth or other im-
possible values for the UN in the mag-stripe mode protocol portant dates in their lives [47]. As for context-aware attacks
of some EMV credit cards is quite small (e.g., 3 digits), leaving against ePassports, the data and documents stored in the vic-
open the possibility of pre-play attacks [43]. In such a case the tim’s phone could be inspected to retrieve relevant informa-
smart-mole could interrogate the victim card with all possible tion that can be used to perform an educated PIN guessing.
UN values collecting the cryptograms and ATCs received as To prevent problems due to a forgotten PIN, some users also
responses. The collected data can be stored by the attacker in tend to store their PIN as number in the phone address book,
its proxy, or in another contactless card, that is then waived in which is another source of information potentially available to
front of a POS for a payment: when the UN sent by the reader is the smart-mole application. In addition if a cardholder adopts
10 international journal of critical infrastructure protection 26 (2019) 100302

reader interaction and to access a first set of data, but then


Table 1 – Mapping of the actions offered by the attack ar-
the reader authenticate itself to access other card data like
chitecture to be undertaken by an attacker to fraudulently
use a contactless card according to the measures adopted fingerprints [23].
to secure it (the brackets indicate that the action depend When the card has to authenticate itself towards the reader
on the specific card design). to prove its genuineness, the check can be circumvented by
the attacker with a relay attack, with the authentication di-
rectly run by card and reader. In case the only measure to pro-
tect the card is an access control mechanism, it is sufficient to
break it in order to access the card content and functionalities.
Note that in general when more than one of the four se-
curity measures listed in Table 1 are adopted, the attacker ac-
tions ticked in the different rows have to be summed. For in-
stance if card and reader are only both authenticated a relay
the same PIN for different cards, which is probably not an attack is sufficient, on the other hand if the genuineness of
uncommon scenario, the smart-mole could run the verify PIN a card is verified and also an access control code is adopted,
attack against all the cards in its range, maximizing the num- both the access control attack and the relay attack have to be
ber of available attempts. Obviously such an attack may also undertaken.
require quite a long time. Along with the methodological identification of the actions
The discussed attacks may allow to carry out payment required an attack, we also classify hereunder the downsides
transactions at the victim expense. For small amount trans- and upsides offered by the application of the remote attack
actions the task is made easy by the PIN-less nature of the architecture discussed in this paper.
operation, but when the PIN is required some attacks can be
run to get it beforehand. On the contrary, there are not amount
Attacker costs:
limits, apart from the card plafond, for online payment trans-
actions carried out with data recovered from the memory of Attack implementation Off-the-shelf devices with software
contactless cards. developed with standard development
kits

Attack dissemination Malware hidden in other apps or spread


5. Attack application analysis through social engineering

Vulnerabilities analysis Different cards weaknesses already


Having summarized the possible security measures for con-
published
tactless cards in Section 2.2 and having in mind the possible
operations with the architecture presented in Section 3, now Attacker benefits:
we logically analyze the necessary actions to be undertaken
by a fraudster who intends to attack a specif type of card. The Number of victims Potentially all users having a
attacker methodology is recapitulated in Table 1. Given the ca- NFC-equipped mobile phone and a
contactless card
pability of the attacker to install the malware in the victim’s
phone, when no security measures are adopted the card con- Remote interactions Only remote activities victim-side, only
tent can be easily read out and used at own discretion. This the proxy is presented in some
is for instance the case of some payment cards that offer free circumstances
access to their data.
Stealth activities Attack run silently in the victim’s pocket,
In case a secure channel is established between the card
in some circumstances the proxy is
and the reader, or even with the system behind it, the at- presented instead of a card in front of an
tacker strategy depends on the specific security measures operator
adopted and on the available vulnerabilities. For instance the
card could be simply remotely interrogated to run pre-play at-
tacks, which is for instance possible for some credit cards in The implementation costs are quite low, as it is possible
order to circumvent their cryptogram mechanism. Such a se- to rely on commercial standard phones without the design
curity mechanisms can be also eluded by the attacker relaying of custom devices. The needed malware is developed through
the communication between card and reader. For ePassports, standard development kits, relying on comfortable and effec-
where the communication can be relayed but it is necessary to tive means to largely spread it. In some situations it is neces-
break the BAC first, the relay attack has to be associated with sary to exploit vulnerabilities in the card security mechanisms
an attack to break the card access control. or their implementations, but as surveyed in this paper some
If the card is constrained to interact only with authorized are already available and probably others will be published. If
readers, the only option for the attacker is to remotely use the a specific vulnerability for a target card has to be found out,
card through a relay attack. Anyhow, if the card is also featured this would raise the attack cost.
by an access control measure and the system prompt the user In view of a limited effort the attacker can potentially reach
to insert a code before any card-reader interaction, an access a huge number of victims, without physically meeting them
control attack has to be carried out beforehand. An example is and operating silently with their phone, so acting comfort-
given by ePassports, which require the MRZ to start the card- ably and going basically undetected. The only physical action
international journal of critical infrastructure protection 26 (2019) 100302 11

Table 2 – Worldwide shipments of smart secure devices and NFC phones in the past years and future forecasts [48,50].
Almost all smart secure devices are represented by chips used in smart cards.

Shipments (millions) 2009 2010 2011 2012 2013 2014 2015f 2016f

Smart secure devices 4520 5520 6295 6970 7140 8220 9200 9805
of which contactless 265 370 480 660 1020 1360 1645 1850

(% of contactless) 5.9% 6.7% 7.6% 9.5% 14.3% 16.5% 17.9% 18.9%

NFC-equipped phones - - - - - 444 756 -

Note: for years 201Xf the figures are forecasts.

is represented by the proxy put in the reader proximity. The large set of infected mobile phones turned into smart-moles
presence of a phone instead of a card may raise suspicions if in also mitigates the problems dictated by those circumstances
presence of an operator (e.g., at a POS), but the legitimate form where the victim does not have any contactless card, or in
factor of a phone make it acceptable in such contexts [20], in case a card needed at a certain moment is not currently in the
particular considering that nowadays many card functional- smart-mole range: the attacker could simply rely on other in-
ities are also offered through phone applications. Differently fected phones with cards available in their range. In addition a
the possible presence of cameras pointing at the reader should potential large variety of services could be enjoyed by the at-
be well evaluated by the attacker, as the recordings combined tacker according to the different typologies of available cards
with the system logs could bring to the identification of the at- (e.g., payment cards, ID cards, electronic tickets, badges to ac-
tacker. If the card is not remotely used relaying its messages cess restricted areas). Obviously the potential interest in at-
but its content is simply read out and used for other malicious tacking some of these specific card application could be dis-
activities, so there is not any physical interaction, the attacker puted, but we remark that the presented architecture for at-
has anyhow to pay attention to avoid any tracking possibility. tacks can be potentially applied against any new contactless
For instance if a credit card number is used for online trans- card application introduced in the field, which could represent
actions, the purchased good should not be directly shipped to more interesting opportunities for an attacker, and that it can
the attacker address [53]. basically operate on a worldwide scale, so the number of vic-
tims can be anyhow quite high.
The possible attack architecture application is made quite
6. Possible future perspective easy by a combination of factors. No custom-made devices
have to be developed, but only off-the-shelf equipment has to
As shown in Table 2 there has been an increase of the num- be employed. In general the development of smart-mole and
ber of contactless cards and NFC-equipped mobile phones in proxy applications can be simply done relying on the stan-
circulation. The trend suggests that the percentage of smart dard development kits and libraries available for commercial
cards featured by a chip with a contactless interface is grow- phones [41]. For the installation of the smart-mole applica-
ing, highlighting that more and more card applications are tion it is possible to rely on several ways already adopted to-
moving towards this technology. This huge set of devices, day to infect phones. For instance social engineering tech-
which is considered secure and thus suitable to store sensi- niques or malware hidden in other applications proposed via
tive data and to manage people’s rights, is the potential tar- phone software repositories could be adopted to operate on a
get of the presented attack architecture. Along with this, the global scale, whereas vulnerabilities through the phone Blue-
likelihood to see real implementations of attacks based on tooth interface could be for instance exploited for targeted in-
such an architecture is getting higher given the parallel signif- fections [51]. Upon this the time taken by relay attacks con-
icant increase of NFC-equipped phones in circulation, which ducted with the attacker’s proxy should not raise particular
are all potential smart-moles. Such phones are heavily pene- suspicions. If for instance the relay timings of [19], concern-
trating the market with shipments that have roughly doubled ing two phones connected to the Internet through the mobile
in the last year and with a 2.2 billions forecast for the year phone operator data network, are combined with the APDUs
2020 [50]. NFC-equipped phones are basically becoming a de sequence of an EMV mag-stripe transaction [43], a payment
facto standard in the mobile phones sector, with roughly 350 operation would last in the order of 3–4 s, a time that would
NFC-equipped mobile phones already available on the mar- not alert a merchant at his POS. Additionally throughout the
ket [49]. entire malicious activity the attacker operates in quite relaxed
The large availability of potential victim devices may make conditions, as he acts stealthily and undetected in the victim’s
the attack appeal and effectiveness higher. Indeed an attacker pocket or bag. This easiness vs potential payoff could moti-
could scale the application of the attack architecture infect- vate fraudsters to start the development of attacks based on
ing several phones, which in turn may make a potential large the concepts presented in this paper, and this would not be
set of cards available to him (Fig. 5). In this way the attacker the first time that attackers take inspiration from scientific re-
may have at his disposal a sort of “Internet of Smart Cards”, searches [52].
that is a large botnet of smart cards connected to its proxy The figures presented in Table 2 suggest that many smart
and controlled or used as needed. The great disposal of a card-based applications may embrace the contactless tech-
12 international journal of critical infrastructure protection 26 (2019) 100302

Fig. 5 – Controlling the NFC-equipped mobile phone of several victims the attacker can potentially have at his disposal a
large number of contactless cards, like a sort of “Internet of Smart Cards”.

nology. For instance in the government sector, following the the attackers would start devising new cheats, as for instance
example of ePassports, some countries have already adopted relay attacks against phone applications [58]. However we
electronic identity cards (eID) featured by a contactless think that a complete migration from contactless cards
chip [54–56], with some of them explicitly designed to be used towards the NFC system it is unlikely. Indeed all users would
as authentication tokens with an associated PIN for online be forced to have a NFC-equipped phone, which is probably
services. Following the model already in place for some an unfair and unpopular requirement, and all of them should
contact bank cards [57], we can imagine that also contactless be used to modern smart phones, which is not always the
bank cards could be used in the future as authentication case. On the contrary operations with cards are well settled
tokens for online banking operations, relying for instance on in people’s mind and it is probable that entities issuing con-
the contactless readers already embedded in many laptops in tactless cards will offer analogous phone applications just as
circulations. It has to be noted that all smart card applications alternatives.
migrated to the contactless technology become the poten- To defeat any attack each user could wrap up his contact-
tial target of attacks. On the other hand, it is also possible less cards with a piece of aluminium foil. This would pre-
to imagine that different contactless card services may be vent the reader-card inductive coupling blocking any contact-
migrated on the growing number of NFC-equipped mobile less interaction. Although it is a simple action, this modus
phones of the users, in the form of phone applications. This operandi is not part of the common people culture and in ad-
would impair the attack scenario described in this paper but dition this would nullify the “wave and go” concept behind
international journal of critical infrastructure protection 26 (2019) 100302 13

contactless cards, forcing the cardholder to extract and un- success to skip the PIN check of contact payment cards alter-
wrap the card before each usage. So it is duty of engineers, reg- ing some of the messages exchanged with the reader [64]. A
ulators and researchers to put in circulations contactless cards similar technique may be adopted through the discussed ar-
able to withstand attacks like the ones discussed in this paper. chitecture, which support MITM attacks, in case weaknesses
For instance part of the MRZ content of ePassports depends similar to those of contact payment cards are found out in
on local administrations decisions. It would be advisable to contactless payment cards.
adopt MRZs featured by high entropy. Similarly user-chosen In case we will not be able to face these threats, the conse-
PINs should be avoided, simply forcing random PIN values at quences may have a considerable impact on users. Indeed it
the issuing stage. Note that, even in these cases, the smart- would be quite hard for them to prove their non-involvement
mole could still be used to extract useful data from the victim’s in operations conducted with their cards or with data col-
phone memory to run smart attacks, like boarding passes re- lected from them. Think of a payment through a relay attack:
porting the MRZ or a note file containing a PIN. in the bank logs the transaction would look like to be carried
To prevent, even educated, brute-force attacks the card re- out with the genuine card. Even worse if a recovered PIN is
sponses could be delayed when a series of unsuccessful ac- used, as it is supposed to be known only by the legitimate card
cess control attempts have been carried out. Such a measure owner [65]. As justification for the cardholder his geographi-
has been for instance adopted in some BAC implementations cal position at the fraud time could be compared with that of
of ePassports [29]. Also the card blocking after a certain num- the payment operation, but in particular the former may not
ber of consecutive erroneous PINs represents a good deterrent, be available and anyhow the cardholder could be blamed to
but it can be also used by an attacker to run denial of service have loaned his card. A forensic analysis of the victim’s phone
attacks remotely blocking the cards under his control [39]. could be carried out to detect the malware, but only if the de-
It would be strongly advisable to protect contactless cards vice is suspected, which is not always the case as the attacker
against relay attacks. This could be for instance achieved run- has acted silently with it. If for some reason the phone is ana-
ning a challenge-response session with a precise time mea- lyzed and the malware discovered the link towards the proxy
surement of the transmitted commands and responses, as al- could be leveraged to find the attacker, but he could make
ready done in some commercial products [59], so as to detect the task harder adopting anonymization techniques for the
any possible delay introduced by an attacker in the middle of proxy-mole communication.
the communication. Another alternative is represented by dis-
tance bounding protocols, which are able to infer an upper
bound for the distance between reader and contactless card
7. Conclusion
from the fact that no information can propagate faster than at
the speed of light [60], but further research is needed to bring
Nowadays there is a combined growing number of contact-
them in commercial products [61]. It would be also interesting
less smart cards and NFC-equipped mobile phones in circu-
to develop techniques to discern if a real contactless card or a
lation. Under different circumstances a user keep its contact-
phone in card emulation mode is in front of a reader, maybe
less cards and phone close together in pockets and bags, at a
relying on some features of the contactless communication
distance that may allow them to interact each other. We have
physical layer [62].
shown that this aspect combined with some contactless cards
Other more general countermeasures would be an activa-
weaknesses known in the literature could be leveraged by an
tion button on the card to be kept pushed by the user during
attacker to carry out malicious operations, like identity thefts
the card usage, or an onboard fingerprint reader used by the
or fraudulent payment transactions. This could be accom-
card to check if the genuine cardholder is physically using the
plished using the victim’s cards remotely, reached through the
card [63]. In both cases the card can not be operated when it
victim’s phone infected by the attacker and under his control.
is simply kept in the cardholder’s pocket or bag, so preventing
There is no evidence whatsoever that such kinds of attack
any attacker interaction with it. Along with cards countermea-
are already applied in practice, but we would not be surprised
sures our mobile phones should be make more secure limiting
to see them in the future considering their relative easiness,
their possibility to be infected by malware. This is not needed
the possible large scale applicability and the potential payoff.
only to prevent contactless cards attacks, but more generally
Such attacks can have serious implications for the victims, as
to protect all those user’s data and operations nowadays man-
the malicious operations would mostly go undetected, with
aged with these devices.
poor possibilities to prove the non-involvement of the legit-
Obviously we do not have to forgot that the attacker “re-
imate cardholders. It is fundamental that engineers, regula-
search” will also progress, and new methods to leverage the
tors and researchers keep working on the security of contact-
presented attack architecture could be found out. First we put
less cards, which are apparently going to be more and more
on the attacker research side the investigation of problems
widespread and are daily used to regulate many sensitive op-
concerning a communication between an NFC phone and a
erations of our life.
contactless card that are maybe in a not perfect and aligned
position in a bag or in a pocket, as this could be a limiting fac-
tor for the presented attack architecture. A smart-mole could references
be also exploited in the future to extract the authentication
private key used by a card to prove its genuineness, allow-
ing an attacker to produce fully working copies of the card. A [1] ISO/IEC 14443, “Identification cards – Contactless Integrated
MITM attack between card and reader has been adopted with Circuit Cards – Proximity Cards”, 2014.
14 international journal of critical infrastructure protection 26 (2019) 100302

[2] ISO/IEC 7816-4, “Identification Cards – Integrated Circuit Technology and Secured Transactions - ICITST 2009, pp. 1–8,
Cards – Part 4: Organization, Security and Commands for 2009.
Interchange”, 2013. [21] “Google yanks 21 malicious apps from android market”,
[3] ISO/IEC 21481, “Information technology – http://www.pcworld.com/article/221137/Google_Yanks_21_
Telecommunications and Information Exchange Between Malicious_Apps_From_Android_Market_Phones.html 2011.
Systems – Near Field Communication Interface and [22] International Civil Aviation Organization ICAO, “Machine
Protocol-2 NFCIP-2”, 2012. Readable Travel Documents”, Seventh Edition, 2015.
[4] Common Criteria, https://www.commoncriteriaportal.org/ [23] BSI, “Advanced Security Mechanisms for Machine Readable
2016. Travel Documents and eIDAS Token – Part 1”, Ver. 2.20, 2015.
[5] A. Juels, “RFID security and privacy: a research survey” IEEE [24] D.J. van Dijk, M. Oostdijk, “Using the ePassport for online
Journal on Selected Areas in Communications, Vol. 24, No. 2, authentication”, Technical Report TI/RS/2009/002,
pp. 381-394, 2006. Telematica Instituut, pp. 1-22 2008.
[6] J.H. Conway, “On numbers and games”, London Academic [25] A. Juels, D. Molnar, D. Wagner, “Security and privacy issues in
Press, Vol. 6, 1976. e-Passports”, in proceedings of the IEEE 1st International
[7] Y. Desmedt, C. Goutier, S. Bengio, “Special uses and abuses of Conference on Security and Privacy for Emerging Areas in
the Fiat-Shamir passport protocol”, in proceedings of Communications Networks - SecureComm2005, pp. 74–88,
Advances in Cryptology - CRYPTO 87, LNCS 293, pp. 21-39, 2005.
1987. [26] J.H. Hoepman, E. Hubbers, B. Jacobs, M. Oostdijk, R. Schreur,
[8] S. Drimer, S.J. Murdoch, “Keep your enemies close: distance “Crossing borders: security and privacy issues of the
bounding against smartcard relay attacks”, in proceedings of European e-Passport”, in proceedings of Advances in
the 16th USENIX Security Symposium, pp. 87-102 2007. Information and Computer Security, LNCS 4266, pp. 152–167,
[9] Z. Kfir, A. Wool, “Picking virtual pockets using relay attacks 2006.
on contactless smartcard”, in proceedings of the First [27] Y. Liu, T. Kasper, K. Lemke-Rust, C. Paar, “E-passport: cracking
International Conference on Security and Privacy for basic access control keys”, in proceedings of On the Move to
Emerging Areas in Communications Networks - Meaningful Internet Systems 2007: CoopIS, DOA, ODBASE,
SecureComm2005, pp. 47–58, 2005. GADA, and IS, LNCS 4804, pp. 1531–1547, 2007.
[10] G.P. Hancke, “A practical relay attack on ISO 14443 proximity [28] G. Avoine, K. Kalach, J.J. Quisquater, “ePassport: securing
cards”, Technical Report, University of Cambridge, Computer international contacts with contactless chips”, in
Laboratory, UK, pp. 1–13, 2005. proceedings of the 12th International Conference on
[11] G.P. Hancke, K. Mayes, K. Markantonakis, “Confidence in Financial Cryptograpy and Data Security, LNCS 5143,
smart token proximity: relay attacks revisited”, Computers & pp. 141–155, 2008.
Security, Vol. 28, No. 7, pp. 615-627, 2009. [29] L. Sportiello, “Weakening ePassports through bad
[12] P. Thevenon, O. Savry, S. Tedjini, “On the weakness of implementations”, in proceedings of Radio Frequency
contactless systems under relay attacks”, in proceedings of Identification-Security and Privacy Issues - RFIDsec2012,
the 19th International Conference on Software, LNCS 7739, pp. 123–136, 2013.
Telecommunications and Computer Networks - [30] H. Richter, W. Mostowski, E. Poll, “Fingerprinting passports”,
SoftCOM2011, pp. 1–5, 2011. in NLUUG Spring Conference on Security, pp. 21–30, 2008.
[13] R. Anderson, “Position statement in RFID S&P panel: RFID [31] L. Sportiello, “ePassport: side channel in the Basic Access
and the middleman”, in proceedings of the 11th Control”, in proceedings of Radio Frequency
International Conference on Financial Cryptography, Identification-Security and Privacy Issues - RFIDsec2014,
pp. 46-49, 2007. LNCS 8651, pp. 173–184, 2014.
[14] W. Issovits, M. Hutter, “Weaknesses of the ISO/IEC 14443 [32] A.M. Oostveen, M. Kaufmann, E. Krempel, G. Grasemann,
protocol regarding relay attacks”, in proceedings of the “Automated border control: a comparative usability study at
International Conference on RFID-Technologies and two European airports”, in proceedings of the 8th
Applications - RFID-TA2011, pp. 335–342, 2011. International Conference on Interfaces and Human
[15] R. Silberschneider, T. Korak, M. Hutter, “Access without Computer Interaction - IHCI2014, pp. 1-8 2014.
permission: a practical RFID relay attack”, in proceedings of [33] ISO/IEC 18013, “Information Technology – Personal
the 21st Austrian Workshop on Microelectronics - Identification – ISO-Compliant Driving Licence – Part 3:
Austrochip, Vol. 10, pp. 59-64, 2013. Access Control, Authentication and Integrity Validation”,
[16] T. Korak, M. Hutter, “On the power of active relay attacks 2009.
using custom-made proxies”, in proceedings of the 2014 IEEE [34] Commission Regulation EU No. 383/2012, “laying down
International Conference on RFID, pp. 126-133, 2014. technical requirements with regard to driving licences which
[17] M. WeiB: “Performing relay attacks on ISO 14443 contactless include a storage medium microchip”, 4 May 2012.
smart cards using NFC mobile equipment”, Master Thesis, [35] EMVCo, https://www.emvco.com/ 2016.
Der Technischen Universitat Munchen, Germany, pp. 1-89 [36] EMVCo, “EMV Contactless Specifications for Payment
2010. Systems”, Books A-D, 2015.
[18] L. Francis, G. Hancke, K. Mayes, K. Markantonakis, “Practical [37] T.S. Heydt-Benjamin, D.V. Bailey, K. Fu, A. Juels, T. Oare,
relay attack on contactless transactions by using NFC mobile “Vulnerabilities in first-generation RFID-enabled credit
phones”, in proceedings of Radio Frequency Identification cards”, in proceedings of Financial Cryptography and Data
System Security - RFIDsec2012 Asia, pp. 21–32, 2012. Security, LNCS 4886, pp. 2-14, 2007.
[19] L. Sportiello, A. Ciardulli, “Long distance relay attack”, in [38] M. Emms, A. van Moorsel, “Practical attack on contactless
proceedings of Radio Frequency Identification-Security and payment cards”, in HCI2011 Workshop - Heath, Wealth and
Privacy Issues - RFIDsec2013, LNCS 8262, pp. 69–85, Identity Theft, pp. 1-2, 2011.
2013. [39] M. Emms, B. Arief, T. Defty, J. Hannon, F. Hao, A. van Moorsel,
[20] L. Francis, G. Hancke, K. Mayes, K. Markantonakis, “Potential “The dangers of verify PIN on contactless cards”, Technical
misuse of NFC enabled mobile phones with embedded Report, Newcastle University, UK, No. CS-TR-1332, pp. 1–10,
security elements as contactless attack platforms”, in 2012.
proceedings of International Conference for Internet
international journal of critical infrastructure protection 26 (2019) 100302 15

[40] M. Emms, B. Arief, N. Little, A. van Moorsel, “Risks of offline reshipping mule scams”, in proceedings of the 22nd
verify PIN on contactless cards”, in proceedings of Financial Conference on Computer and Communications Security -
Cryptography and Data Security, LNCS 7859, pp. 313-321 SIGSAC, pp. 1081-1092, 2015.
2013. [54] BSI, “The electronic ID card”, https://www.bsi.bund.de/EN/
[41] J. Vila, R.J. Rodriguez, “Practical experiences on NFC relay Topics/ElectrIDDocuments/eIDcard/eIDcard_node.html 2016.
attacks with Android”, in proceedings of Radio Frequency [55] J.P. Degabriele, V. Fehr, M. Fischlin, T. Gagliardoni, F. Gunther,
Identification-Security and Privacy Issues - RFIDsec2015, G.A. Marson, A. Mittelbach, K.G. Paterson, “Unpicking PLAID -
LNCS 9440, pp. 87-103, 2015. A cryptographic analysis of an ISO-standards-track
[42] T. Chothia, F.D. Garcia, J. de Ruiter, J. van den Breekel, M. authentication protocol”, in proceedings of the 1st
Thompson, “Relay cost bounding for contactless EMV International Conference on Research in Security
payments”, in proceedings of Financial Cryptography and Standardisation - SSR2014, Vol. 8893, pp. 1-25, 2014.
Data Security, LNCS 8975, pp. 189-206, 2015 [56] National Registration Department of Malaysia, Ministry of
[43] M. Roland, J. Langer, “Cloning credit cards: a combined Home Affairs, “Introduction To MyKad”, http://www.jpn.gov.
pre-play and downgrade attack on EMV contactless”, in my/en/informasi/pengenalan- kepada- mykad/ 2016.
proceedings of the 7th USENIX Conference on Offensive [57] S. Drimer, S.J. Murdoch, R. Anderson, “Optimised to fail: card
Technologies, pp. 1-12 2013. readers for online banking”, in proceedings of Financial
[44] P. Fillmore, “Crash & pay: how to own and clone contactless Cryptography and Data Security, LNCS 5628, pp. 184-200,
payment devices”, Black Hat USA 2015, https://www. 2009.
blackhat.com/docs/us- 15/materials/us- 15- Fillmore- Crash- [58] M. Roland, J. Langer, J. Scharinger, “Applying relay attacks to
Pay-How-To-Own-And-Clone-Contactless-Payment-Devices. Google Wallet”, in 5th IEEE International Workshop on Near
pdf 2015. Field Communication, pp. 1-6, 2013.
[45] A. Barisani, A. Laurie, Z. Franken, D. Bianco, “Chip & PIN is [59] NXP, “MF1PLUSx0y1 - Mainstream Contactless Smart Card IC
definitely broken”, DEFCON 19, https://dev.inversepath.com/ for Fast and Easy Solution Development”, Product Short Data
download/emv/emv_2011.pdf 2011 Sheet, Rev. 3.2, 2011.
[46] M.A. Ali, B. Arief, M. Emms, A. van Moorsel, “Does The Online [60] G.P. Hancke, M.G. Kuhn, “An RFID distance bounding
Card Payment Landscape Unwittingly Facilitate Fraud?”, in protocol”, in proceedings of the First International
IEEE Symposium on Security and Privacy, pp. 1-8, 2017. Conference on Security and Privacy for Emerging Areas in
[47] J. Bonneau, P. Soren, R. Anderson, “A birthday present every Communications Networks - SecureComm2005, pp. 67-73,
eleven wallets? The security of customer-chosen banking 2005.
PINs”, in proceedings of Financial Cryptography and Data [61] H. Jannati, “Analysis of relay, terrorist fraud and distance
Security, LNCS 7397, pp. 25-40, 2012. fraud attacks on RFID systems”, International Journal of
[48] Eurosmart - The voice of the smart security industry, Critical Infrastructure Protection, Vol. 11, pp. 51-61, 2015.
http://www.eurosmart.com/ 2015. [62] B. Danev, T.S. Heydt-Benjamin, S. Capkun, “Physical-layer
[49] “NFC phones: the definitive list”, http://www.nfcworld.com/ identification of RFID devices”, in proceedings of the 18th
nfc- phones- list/ 2016. Conference on USENIX Security Symposium, pp. 199-214,
[50] IHS, “NFC-enabled handset shipments to reach three- 2009.
quarters of a billion in 2015”, https://technology.ihs.com/ [63] C. Swedberg, “Zwipe offers fingerprint-authenticated RFID
533599/nfc-enabled-handset-shipments-to-reach-three access-control card”, RFID Journal,
- quarters- of- a- billion- in- 2015 2015. http://www.rfidjournal.com/articles/view?11288/ 2013.
[51] K. Dunham. “Mobile malware attacks and defense”, Syngress [64] S.J. Murdoch, S. Drimer, R. Anderson, M. Bond, “Chip and PIN
Publishing, 2008. is Broken”, in IEEE Symposium on Security and Privacy,
[52] H. Ferradi, R. Geraud, D. Naccache, A. Tria, “When organized pp. 433-446, 2010.
crime applies academic results: a forensic analysis of an [65] S.J. Murdoch, “Reliability of chip & PIN evidence in banking
in-card listening device”, Journal of Cryptographic disputes”, Digital Evidence & Electronic Signature Law
Engineering, Vol. 5, pp. 1-11, 2015. Review, Vol. 6, pp. 98-115, 2009.
[53] S. Hao, K. Borgolte, N. Nikiforakis, G. Stringhini, M. Egele, M.
Eubanks, B. Krebs, G. Vigna, “Drops for stuff: an analysis of

You might also like