WO2016051059A1 - Method of protecting a mobile terminal against attacks - Google Patents

Method of protecting a mobile terminal against attacks Download PDF

Info

Publication number
WO2016051059A1
WO2016051059A1 PCT/FR2015/052579 FR2015052579W WO2016051059A1 WO 2016051059 A1 WO2016051059 A1 WO 2016051059A1 FR 2015052579 W FR2015052579 W FR 2015052579W WO 2016051059 A1 WO2016051059 A1 WO 2016051059A1
Authority
WO
WIPO (PCT)
Prior art keywords
security element
execution environment
secure execution
received
command
Prior art date
Application number
PCT/FR2015/052579
Other languages
French (fr)
Inventor
Mohamed SABT
Mohammed Achemlal
Original Assignee
Orange
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Orange filed Critical Orange
Publication of WO2016051059A1 publication Critical patent/WO2016051059A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/10Integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/12Detection or prevention of fraud
    • H04W12/121Wireless intrusion detection systems [WIDS]; Wireless intrusion prevention systems [WIPS]
    • H04W12/122Counter-measures against attacks; Protection against rogue devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/40Security arrangements using identity modules
    • H04W12/45Security arrangements using identity modules using multiple identity modules
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
    • H04W88/02Terminal devices

Definitions

  • the present invention relates to a method of protecting a mobile terminal against attacks, more precisely against attacks of the relay type.
  • An intelligent smartphone-type mobile terminal in English adapted to execute sensitive contactless services, such as a "Near Field Communication” (NFC) type payment service, conventionally security (or “SE” of the English “Secure Element"), for example a "SIM” card (Subscriber Identity Module) and an NFC controller.
  • NFC Near Field Communication
  • SE Electronic Security
  • SIM Subscriber Identity Module
  • the NFC controller is arranged to communicate with a connected NFC reader, as part of a payment transaction, to a merchant terminal.
  • the security element is suitable for storing sensitive data and applications.
  • the security element stores cryptographic data of secret key types or private keys, sensitive applications; access to sensitive operations of the application, or even access to the payment application itself, is conditioned by the user entering a personal identification code (usually referred to as code " PIN ", of the English" Personal Identification Number ").
  • PIN personal identification code
  • the user wishes to initiate a payment transaction at a merchant, he approaches his mobile terminal of the NFC reader located at the merchant and the payment application located in the security element runs between the terminal and the server by the user. the intermediary of the reader and the NFC controller, the transaction information being exchanged between the payment application and the NFC reader using "Application Protocol Data Unit” (APDU) frames.
  • APDU Application Protocol Data Unit
  • the user's account is debited with the amount of the transaction.
  • Such an architecture is however sensitive to relay type attacks.
  • an attacker installs malicious software on the mobile terminal of the victimized user to redirect data to the attacker's mobile terminal.
  • This installation is performed for example by means of a Trojan horse, apparently legitimate software from the point of view of the mobile terminal of the victim and which includes malicious software.
  • the malware is arranged to listen and record data exchanged with the security element during legitimate payment transactions.
  • sensitive data such as the personal identification code entered by the legitimate user to validate a payment transaction can thus be accessible to the malicious software.
  • the personal identification code may be requested at the user when executing a security function such as a signature function that requires access to a signature private key stored in the security module.
  • the attacker also installs control software on his own mobile terminal.
  • the control software is arranged to control the actions of the malicious software installed on the victim's terminal and cleverly relay, via the Internet, information from the victim's terminal to the attacker's terminal or the terminal of the victim. attacker to the victim's terminal.
  • the attacker initiates a payment transaction at a merchant.
  • the exchanges between the security element of the attacker's terminal and the payment terminal, via the reader and the NFC controller, are relayed by the attacker's terminal control software to the malicious software installed on the terminal of the attacker. the victim.
  • the malware controls the execution of the payment application of the victim's mobile terminal.
  • the malware transmits it without the victim being requested.
  • the responses of the security element of the victim are thus relayed by the malware to the terminal of the attacker who transmits them to the merchant's payment terminal via the NFC controller.
  • the victim's account is debited instead of the attacker's account.
  • Such a relay attack thus allows the attacker to buy goods by debiting the victim's account.
  • the attacker steals loyalty point data intended for the victim, specifically intended to be stored in the security element of the victim.
  • it is the victim who initiates a transaction with a merchant through a contactless reader.
  • Loyalty points that are transmitted at the end of the transaction by the merchant to the victim's terminal via the reader and the NFC controller are relayed, via the Internet, by the malware installed on the victim's terminal to the mobile terminal of the victim. the attacker to be registered in the attacker's security element.
  • One of the aims of the invention is to remedy the shortcomings / disadvantages of the state of the art and / or to make improvements thereto.
  • the invention proposes a method for detecting an attack on a mobile terminal, the terminal comprising a security element, a contactless controller adapted to communicate with a contactless reader and a secure execution environment, in which which : any command from the contactless reader received by the contactless controller is sent to the secure execution environment and the security module, and
  • the method comprising a verification step, implemented by the secure execution environment, during which it is verified that a command received from the contactless controller corresponds to the same command received from the security element, in if not, a relay-type software attack is detected.
  • the described method thus makes it possible to detect relay-type software attacks. Indeed, it is verified that a command received from the NFC controller by the secure execution environment corresponds to the receipt by the secure execution environment of the same command from the security element.
  • the attacker initiates a payment transaction with his own mobile terminal via his NFC controller. It relays commands received from the NFC player via its own controller to the victim's mobile terminal through the control software and malicious software installed on the victim's terminal. It is the payment application of the victim's mobile terminal that is executed that is thus executed.
  • the security element transmits the command relayed by the attacker's mobile terminal control software to the secure execution environment of the victim's terminal.
  • the secure execution environment does not receive the same command from the NFC controller. Indeed, the NFC controller of the victim is not involved in the transaction since it is the attacker who communicates with the NFC player in the context of the current transaction. The attack is therefore detected by the secure execution environment of the victim's terminal.
  • the victim In a second attack scenario, the victim is executing a transaction during which loyalty points will be transmitted to the security element via the NFC controller of the victim's terminal.
  • the malicious software controlled by the attacker terminal control software relays the commands relating to this transmission of loyalty points to the attacker's terminal.
  • a command received by the NFC controller of the victim's mobile terminal is sent to the secure execution environment of the victim's terminal.
  • this same command is not received from the victim's security element since it is processed by the attacker's security element.
  • the non-reception by the secure execution environment of the same command by two different channels in this case the secure execution environment / security element channel and the execution environment channel. secure / NFC controller, indicates that a relay-type software attack is in progress.
  • the security element and the secure execution environment share the knowledge of a secret key, the method further comprising the following steps:
  • the calculation of the first control value by the security element, a function of the secret key K and the C-APDU command received from the contactless controller, and the sending of this value to the secure execution environment ensures that the command sent by the security element to the secure execution environment is the one that is received by this environment.
  • the control value makes it possible to check the integrity of the communication channel that separates the security element from the secure execution environment which, by construction, is not secure.
  • this link is not secure because the security module can in some cases be removable.
  • This additional control provides an additional level of security in detection. Thus, it is ensured that it is the security element that shares the private key with the secure execution environment and is therefore in the same mobile terminal that sends the command.
  • the security element and the secure execution environment share knowledge of a secret key, the method further comprising the steps of:
  • the first control value is calculated based on the private key and the response determined by the security element.
  • This example is an alternative to the example described above.
  • which calculates the first control value by the security element is also a function of a response to said command determined by the security element and that the method comprises the following steps:
  • the first control value is calculated from the command and the response determined by the security element.
  • the level of security is therefore higher than when the control relates to a single type of frame.
  • the method comprises, when no relay-type software attack has been detected:
  • the process steps described here make it possible to detect particular attacks, in this case, hardware attacks of the relay type.
  • This type of attack is more complicated to implement for an attacker because it requires to install a probe in the mobile terminal of a potential victim.
  • This probe is intended to relay to or from the attacker's terminal information that passes over a communication link that connects the NFC controller to the secure execution environment.
  • it is ensured that it is the secure execution environment that is in the mobile terminal that communicates with the NFC controller.
  • the invention also relates to a mobile terminal comprising a security element, a contactless controller adapted to communicate with a contactless reader, and a secure execution environment, and:
  • first sending means arranged to send any command from the contactless reader and received by the contactless controller to the secure execution environment and the security module
  • first verification means arranged to verify that to a command received from the contactless controller corresponds the same command received from the security element, a relay-type software attack is detected in the event of a negative verification.
  • the security element and the secure execution environment share the knowledge of a secret key, the terminal further comprising:
  • means for calculating and sending arranged so that the security element calculates a first control value, a function of the command received from the contactless controller and the secret key, and to send said first control value to the secure execution environment,
  • second verification means arranged so that the secure execution environment checks the consistency between the first control value and the command received from the security element, a relay-type software attack being detected in the event of an inconsistency .
  • the mobile terminal further comprises:
  • a geolocation module arranged to provide the secure execution environment with the geographical coordinates of the mobile terminal
  • comparison means arranged for, when no relay attack has been detected, comparing the coordinates of the mobile terminal with the geographic coordinates of the reader, a hardware attack being detected when the coordinates of the terminal and the reader differ from a value greater than a given threshold value.
  • the invention also relates to a computer program on a data carrier and loadable in the memory of a mobile terminal, the program comprising instructions for code for performing the steps of the attack detection method according to the invention, when the program is executed on said computer.
  • the invention also relates to a data carrier in which the program according to the invention is recorded.
  • FIG. 1 is a schematic representation of an architecture adapted to implement the steps of an attack detection method, according to a first embodiment of the invention
  • FIG. 2a presents the steps of a method of detecting software attacks of relay type, according to a first embodiment of the invention
  • FIG. 2b presents the steps of a method for detecting hardware attacks, according to an embodiment of the invention
  • FIG. 3 is a functional schematic representation of a mobile terminal, according to an exemplary embodiment of the invention.
  • a mobile terminal 10 conforms to the specifications proposed by the GlobalPlatform association, or conforms to similar approaches.
  • the GlobalPlatform specifications define a mobile terminal architecture where two execution environments coexist: a secure execution environment 11, or "TEE” (Trusted Execution Environment ") and an unsecured execution environment, or "REE” (of the English “Rich Execution Environment”) (not shown in Figure 1).
  • the secure execution environment 11 is independent of the unsecured execution environment. It is intended to provide a software and hardware environment for secure applications. It is considered trusted and relies on its own resources: a secure operating system, secure software modules and secure hardware resources, such as security features such as secure storage, communication interfaces with components security, etc.
  • the secure execution environment 11 is arranged to provide security services to the unsecured execution environment through predefined interfaces. It is known from the GlobalPlatform specifications that the operating system of the secure runtime environment 11 is run from a trusted firmware (we speak of "firmware" in English) which is authenticated and isolated from the unsecured operating system during the boot process (we speak of "boot” in English). Once the firmware is authenticated, the secure operating system 11 is executed and the secure execution environment 11 is established. During this establishment, the secure runtime environment 11 initializes the firmware, imports cryptographic data such as keys, certificates, signatures, and configures certain devices to ensure security during communications between the runtime environment. secure 11 and these devices. After the establishment of the secure execution environment 11, the control is transmitted to the unsecured execution environment.
  • Terminal startup then continues with an unsecured operating system run and an establishment during this execution of the unsecured execution environment. If the user next selects a secure application, the system switches to the secure runtime environment and runs the application in that secure environment. Upon completion of the application execution, the system switches back to the unsecured execution environment.
  • the mobile terminal 10 also comprises a security element 12.
  • the security element 12 is for example a "UICC” card (for “Universal Integrated Circuit Card”), such as a subscriber identity card or “SIM” card. (“Subscriber Identity Module”), removable or welded (so called “embedded SIM”).
  • the security element is a microSD-type removable component ("SD” for Sandisk®).
  • the security element is a secure software zone.
  • the security element 12 is designed to store sensitive applications or functions, for example a payment application, functions and cryptographic data such as signature functions, secret keys, etc.
  • the payment application includes code instructions for implementing some of the steps of the attack detection method.
  • the payment application is stored in the secure execution environment 11 and uses one or more sensitive functions stored in the security element 12, for example a signature function which requires, for unlock access to a private key signature, the entry by the user of a correct PIN.
  • the payment application is stored in the security element 12.
  • the mobile terminal 10 also comprises a contactless controller, for example an "NFC" controller 13 ("Near Field Communication" ) Arranged to allow contactless communication with a contactless reader, for example an NFC reader 20 connected to a remote server 21, for example the server of a merchant.
  • NFC controller 13 Near Field Communication
  • the NFC controller 13 comprises code instructions for implementing those steps of the attack detection method that are executed by the NFC controller 13.
  • the mobile terminal 10 also comprises a module for geolocation, for example a "GPS" module 16 (of the "Global Positioning System") intended to provide location coordinates of the mobile terminal.
  • the geographical coordinates provided by the geolocation module 16 are expressed for example by a pair (X, Y) where X represents the latitude in degrees, minutes, seconds and thousandths of seconds and Y the longitude in degrees, minutes, seconds and thousandths of seconds. second.
  • the geographic location technique used by the module 16 is differential; this technique is more accurate than a standard GPS location.
  • the secure execution environment 11 has configured the NFC controller 13 and the GPS module 16 if necessary, so as to guarantee the security of the communications that it establishes with these devices.
  • the exchanges between the secure execution environment 11 and the NFC controller 13 on the one hand, and between the secure execution environment 11 and the GPS module 16 on the other hand are supposedly secure.
  • the security element 12 and the secure execution environment 11 share the knowledge of a secret key K intended to guarantee that commands received from the NFC reader 13 and responses that are transmitted in response to the reader 20 come from the security module of the mobile terminal that is performing the transaction.
  • APDU Application Protocol
  • Data Unit Data Unit
  • a user equipped with a mobile terminal 10 wishes to execute a contactless application, such as an NFC payment application stored in the security element 12 of its terminal.
  • a secret key K shared by these two entities, has been installed in the security element 12 and in the secure execution environment 11 of the mobile terminal 10.
  • the installation was made in the factory, before the mobile terminal 10 is marketed.
  • the secret key K has been installed after the terminal 10 has been placed on the market. For example, it has been installed in the security element 12 by means of an "OTA" procedure. English “Over The Air”) and in the secure execution environment 11 through a similar procedure via the 3G or 4G Internet network.
  • the user equipped with his mobile terminal 10 approaches the NFC reader 20 to perform a transaction without contact.
  • the NFC reader 20 located in a station, allows the user to buy train tickets using his mobile terminal 10.
  • Approaching the mobile terminal 10 of the NFC reader 20 triggers the execution of a payment application stored in the security element 12 of the mobile terminal 10.
  • the user of the mobile terminal 10 triggers the execution of the payment application by selecting it in a menu , then approaches its mobile terminal 10 of the NFC reader 20.
  • the information exchanged during this dialogue in the form of commands and responses, are transported in "APDU" frames (" Application Protocol Data Unit ").
  • a C-APDU command is sent from the server 21 to the security element 12, more precisely to the payment application located in the security element 12, via the NFC reader 20. and the NFC controller 13.
  • the C-APDU is received by the NFC controller 13 in a receiving and retransmitting step E2, and then transmitted to the security element 12.
  • the C-APDU command is received by the security 12, more precisely by the payment application stored in the security element 12, in a receiving step E3.
  • the C-APDU command is for example a request for data: request for confirmation of the amount of the ticket, request for confirmation of the journey, request for validation of payment, etc.
  • This C-APDU command is processed by the security element 12 in a processing step E4.
  • the security element 12 determines an R-APDU response following this processing. For example, if the received C-APDU command is a path confirmation request, a message is displayed to the user who confirms the path or not. The response R-APDU then comprises the response of the user. If the C-APDU command is a message from payment validation, the user is asked to enter a service PIN. Entering a correct PIN triggers the execution of a security function, for example a signature of the payment information relating to the current transaction, by means of a signature private key stored in the security element 12. In this case, the R-APDU response determined by the security element 12 is a message that includes the signature of the payment information.
  • the security element 12 calculates a first control value a.
  • the first control value a is calculated by applying a cryptographic function f to the C-APDU command received from the NFC controller 13 during the receiving step E3, and to the R-APDU response determined by the security element 12.
  • the cryptographic function f is parameterized by the secret key K shared by the security element 12 and the secure execution environment 11.
  • the cryptographic function f is for example a "MAC” type authentication function. English “Message Authentication Code”), for example the "HMAC” (for "Keyed-Hashed MAC") function, or the "CMAC” (for "Cipher-based MAC”) function.
  • the first control value a is intended to enable the secure execution environment 11 to check the integrity of the C-APDU command and the R-APDU response that were processed by the security element 12. Control is justified by the fact that the communication link between the secure execution environment 11 and the security element 12 is, by construction, not secure. Such a control is therefore intended to ensure the integrity of the communication channel between the security element 12 and the secure execution environment 11.
  • a parameter sending step E6 the security element 12 sends to the secure execution environment 11 a set of parameters which comprises the first control value a, the C-APDU command received by the security element. security 12 during step E3 and the R-APDU response that it determined during the processing step E4. This set of parameters is received by the secure execution environment 11 in a receiving step E7.
  • a sending step E8 the determined R-APDU response is sent by the security element 12 to the NFC controller 13. It is received by the NFC controller 13 in a reception step E9.
  • the NFC controller 13 sends information about the current transaction to the secure execution environment 11.
  • the NFC controller 13 sends the C-APDU command that it received from the NFC reader 20 during the receiving step E2 and the R-APDU response to that command that it has. received from the security element 12 during the reception step E9.
  • the C-APDU command and the R-APDU response are received by the secure execution environment 11 in a receiving step El i.
  • the secure execution environment 11 checks the integrity of the C-APDU command and the R-APDU response received from the security element 12 during the step E7 reception. For this purpose, it calculates a second control value a 'by applying the same cryptographic function f as that applied by the security element 12 during the step E5 of calculating the first control value a to the command C- APDU and R-APDU response received from security module 12 during step E7.
  • the cryptographic function f is parameterized with the same secret key K. If the two control values are different, that is to say if a ⁇ a '(branch "nok" in FIG. 2), this means that the data sent by the security module 12 differ from those received by the secure execution environment 11.
  • the process ends in an end step E13, which terminates the current transaction.
  • an information message is displayed to the user and / or sent by the secure execution environment 11 to the NFC reader 20.
  • the secure execution environment 11 informs the NFC controller 13 in an information step E15.
  • the NFC controller 13 may send the R-APDU response to the server 21 via the NFC reader 20 in a response step E1 and a new command (not shown) may be received from the server 15 via the reader 14 and the controller 13 and processed. as previously described.
  • the steps described above make it possible to detect that no relay-type software attack is in progress. However, there is a risk that an attack that is more difficult to implement may be in progress. This attack is qualified as hardware attack because it requires to install a probe on a communication bus that connects the secure execution environment 11 to the security element 12.
  • the steps described in connection with FIG. 2b are implemented to detect a relay type hardware attack when no relay type software attack has been detected. They are implemented after the comparison step E14 and in the case where the comparison is positive (branch "ok" in FIG. 2).
  • a coordinate query step E17 implemented when the first and second control values a and a 'are identical
  • the secure execution environment 11 requests the module to GPS location 16 the geographical coordinates (X, Y) of the mobile terminal 10. This request is received by the GPS location module 16 in a step El 8 of reception.
  • the GPS location module 16 sends the geographical coordinates of the mobile terminal 10 in a step E19 sending geographical coordinates.
  • the geographical coordinates are received by the secure execution environment 11 in a receiving step E20.
  • the secure execution environment 12 compares the geographical coordinates (X, Y) of the mobile terminal 10 with the geographical coordinates ( ⁇ ', Y') of the NFC reader 20.
  • the geographical coordinates ( ⁇ ', Y') of the NFC reader 20 are provided by the reader 20 to the NFC controller 13 at the beginning of the execution of the payment application. They are transmitted from the NFC controller 13 to the secure execution environment 11 spontaneously, or on request from the secure execution environment 11 in a preliminary step not shown in FIG. 2.
  • the comparison between the coordinates (X, Y) of the mobile terminal and the coordinates ( ⁇ ', Y') of the NFC reader 20 is positive if the difference between the two sets of coordinates (X, X ') and (Y, Y' ) is below a predefined threshold. Below this threshold, it is considered that the geographic location data associated with the mobile terminal 10 and the geographical coordinates ( ⁇ ', Y') of the NFC reader 20 are sufficiently close to each other that the it is considered that the mobile terminal 10 and the NFC reader 14 are the two devices that are actually involved in the current transaction.
  • a predefined threshold may consist in allowing variations only of the order of ten thousandths of a second for latitude and longitude, which is about thirty centimeters.
  • the secure execution environment 11 informs the NFC controller 13 in the information step E15.
  • the NFC controller 13 may send the R-APDU response to the server 21 via the NFC reader 20 in a response step E1 and a new command (not shown) may be received from the server 15 via the reader 14 and the controller 13 and processed. as previously described.
  • a relay type hardware attack is considered to be in progress since the terminal 10 and the NFC reader 14 are too far away. from one another to execute the current payment transaction.
  • the process stops in the end step E13, which terminates the current transaction.
  • an information message is displayed to the user and / or sent by the secure execution environment 11 to the NFC reader 20.
  • the relay-type hardware attack is, however, complicated to implement.
  • the optional steps E17 to E21 thus make it possible to ensure that it is indeed the secure execution environment 11 of the mobile terminal 10 that compares the first and second control values and that provides the result of this comparison to the NFC controller.
  • the control performed by the secure execution environment 11 during the steps E12 and E14 relates only to the C-APDU command.
  • the first control value a is calculated by the security element 12 during the step E5 by applying the cryptographic function f to the secret key K and the C-APDU command received from the NFC controller 13.
  • the second control value a ' is calculated by the secure execution environment 11 by applying the cryptographic function f to the secret key K and the C-APDU command received from the NFC controller.
  • step E14 only the C-APDUs commands received by the secure execution environment 11 on the one hand from the NFC controller 13 during the step El i and on the other hand of the security element 12 during the step E7 are compared.
  • the method is here lighter to implement in that only C-APDU commands are compared.
  • the control is similar to that described in this example except that it concerns the R-APDU response instead of the C-APDU command.
  • a minimal control is implemented by the secure execution environment 11 in order to detect a relay attack. This check consists in ensuring that any C-APDU command received from the security controller 13 by the secure execution environment 11 corresponds to the same C-APDU command received from the security element 12 by the security environment. 11.
  • the step E5 for calculating the first control value a is not executed and the step E6 for sending parameters consists in sending the command C-APDU of the security element 12 to the secure execution environment 11.
  • the NFC controller 13 sends the secure execution environment 11 in step E10 the C-APDU command.
  • the C-APDU command may be sent by the NFC controller 13 to the secure execution environment 11 during the step E3, at the same time that it sends it to security element 12.
  • the step E12 is not executed and the step E14 consists for the secure execution environment 11 to compare the C-APDU commands received respectively from the security element 12 and the NFC controller 13.
  • the mobile terminal 10 is a smart terminal type smartphone in English. It conforms to GlobalPlatform specifications. It thus comprises a secure execution environment 101, or TEE, and an insecure execution environment (not shown in FIG. 3). It also includes: a security element 12, adapted to host applications and / or sensitive functions. In an exemplary embodiment, it hosts a contactless payment application;
  • an NFC controller 11 adapted to communicate with the NFC contactless reader 20 (not shown in FIG. 3), the security element 12 and the secure execution environment 11, and to exchange information in the form of APDU frames;
  • a geolocation module 16 adapted to provide the geographical coordinates of the mobile terminal 10.
  • the secure execution environment 11 is an environment that operates in parallel with the unsecured execution environment. Security-sensitive applications are then executed either in the security element or in the secure execution environment.
  • the secure execution environment provides security features such as secure storage space, secure application execution space, and secure management of input / output interfaces. Some communication channels are then natively secured by the secure execution environment 11, such as the TEE link / NFC controller 13, or the TEE / touch screen link (the touch screen is not shown in Fig. 3). On the other hand, the link TEE / element of security is, by construction not secured.
  • the mobile terminal 10 also comprises a set of resources described here in a simplified manner as being distributed between the different elements of the mobile terminal 10. This simplified description is consistent with the description of the method in which it is considered that the steps are implemented in the mobile terminal.
  • the mobile terminal 10 comprises:
  • a processing unit 101 or "CPU” for "Central Processing Unit", 101-1, a set of memories, including a volatile memory 102 and a storage memory 103.
  • the volatile memory 102 is arranged to execute code instructions , store variables, etc.
  • the storage memory 103 is arranged to store security data such as keys, signatures, etc., where appropriate the secret key K, and a secure program comprising code instructions for implementing the steps. the method of detecting attacks as described above.
  • the secret key K shared between the security element 12 and the secure execution environment 11 is stored in a first secure memory area specific to the security element 12 and a second memory zone secure, specific to the secure runtime environment 11.
  • the mobile terminal 10 also comprises:
  • first sending means 104 arranged to send any C-APDU command from the NFC reader 20 and received by the NFC controller 13 to the secure execution environment 11 and the security element 12;
  • second sending means 105 arranged to send any order C-
  • first verification means 106 arranged to verify that a C-APDU command received from the NFC controller 13 corresponds to the same C-APDU command received from the security element 12, a relay-type software attack being detected in the case of negative verification.
  • the mobile terminal 10 also comprises the following modules, in dashed lines in FIG. 3:
  • means 107 for calculating and sending arranged so that the security element 12 calculates a first control value, a function of the C-APDU command received from the NFC controller 13 and the secret key K shared between the environment of the secure execution and the security element 12, and to send the calculated control value to the secure execution environment,
  • second verification means 108 arranged so that the secure execution environment 11 checks the coherence between the first control value and the command received from the security element 12, a relay-type software attack being detected in the event of 'inconsistency.
  • the mobile terminal 10 also comprises:
  • comparison means 110 arranged to compare, when no relay-type software attack has been detected, the coordinates of the mobile terminal 10 with the geographical coordinates of the reader 20, a hardware attack being detected when the coordinates of the mobile terminal 10 and the reader 20 differ by a value greater than a given threshold value.
  • the first sending means 104, the second sending means 105, the first checking means 106, the calculating and sending means 107, the second checking means 108, the geographic coordinate receiving means 109 and comparison means 110 are preferably software modules which comprise code instructions for executing the steps of the attack detection method as described previously.
  • the software modules can be stored in, or transmitted by, a data carrier. This may be a hardware storage medium, for example a CD-ROM, a magnetic diskette or a hard disk, or a transmission medium, or a network.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

The invention relates to a method of detecting an attack aimed at a mobile terminal (10), the terminal comprising a security element (12), a contactless controller (13) suitable for dialoguing with a contactless reader (20) and a secure execution environment (11), in which: - any command (C-APDU) originating from the contactless reader and received by the contactless controller is dispatched to the secure execution environment and to the security module, and - any command (C-APDU) received by the security element is dispatched to the secure execution environment, the method comprising a step of verification (E14), implemented by the secure execution environment, in the course of which it is verified that to a command (C-APDU) received from the contactless controller there corresponds a same command (C-APDU) received from the security element, in the converse case a software attack of relay type is detected.

Description

Procédé de protection d'un terminal mobile contre des attaques  Method of protecting a mobile terminal against attacks
La présente invention concerne un procédé de protection d'un terminal mobile contre des attaques, plus précisément contre des attaques de type relais. The present invention relates to a method of protecting a mobile terminal against attacks, more precisely against attacks of the relay type.
Elle trouve une application particulièrement intéressante dans la sécurisation de services sensibles, tels que des services de paiement sur terminaux mobiles intelligents.  It finds a particularly interesting application in securing sensitive services, such as payment services on smart mobile terminals.
Un terminal mobile intelligent de type smartphone en anglais, adapté pour exécuter des services sans contact sensibles, tels qu'un service de paiement de type « NFC » (de l'anglais « Near Field Communication »), comprend de manière classique un élément de sécurité (ou « SE », de l'anglais « Secure Elément »), par exemple une carte « SIM » (de l'anglais « Subscriber Identity Module ») et un contrôleur NFC. Le contrôleur NFC est agencé pour communiquer avec un lecteur NFC relié, dans le cadre d'une transaction de paiement, à un terminal marchand. L'élément de sécurité est adapté pour mémoriser des données et applications sensibles. Dans le cas de transactions de paiement, l'élément de sécurité mémorise des données cryptographiques de types clés secrètes ou clés privées, des applications sensibles ; l'accès à des opérations sensibles de l'application, voire l'accès à l'application de paiement elle- même, est conditionné par la saisie par l'utilisateur d'un code personnel d'identification (on parle habituellement de code « PIN », de l'anglais « Personal Identification Number »). Lorsque l'utilisateur souhaite initier une transaction de paiement chez un marchand, il approche son terminal mobile du lecteur NFC situé chez le marchand et l'application de paiement localisée dans l'élément de sécurité s'exécute entre le terminal et le serveur par l'intermédiaire du lecteur et du contrôleur NFC, les informations relatives à la transaction étant échangées entre l'application de paiement et le lecteur NFC au moyen de trames « APDU » (de l'anglais « Application Protocol Data Unit »). Au terme de la transaction, le compte de l'utilisateur est débité du montant de la transaction.  An intelligent smartphone-type mobile terminal in English, adapted to execute sensitive contactless services, such as a "Near Field Communication" (NFC) type payment service, conventionally security (or "SE" of the English "Secure Element"), for example a "SIM" card (Subscriber Identity Module) and an NFC controller. The NFC controller is arranged to communicate with a connected NFC reader, as part of a payment transaction, to a merchant terminal. The security element is suitable for storing sensitive data and applications. In the case of payment transactions, the security element stores cryptographic data of secret key types or private keys, sensitive applications; access to sensitive operations of the application, or even access to the payment application itself, is conditioned by the user entering a personal identification code (usually referred to as code " PIN ", of the English" Personal Identification Number "). When the user wishes to initiate a payment transaction at a merchant, he approaches his mobile terminal of the NFC reader located at the merchant and the payment application located in the security element runs between the terminal and the server by the user. the intermediary of the reader and the NFC controller, the transaction information being exchanged between the payment application and the NFC reader using "Application Protocol Data Unit" (APDU) frames. At the end of the transaction, the user's account is debited with the amount of the transaction.
Une telle architecture est cependant sensible à des attaques de type relais. Pour mettre en place une telle attaque, une personne malveillante installe sur le terminal mobile de l'utilisateur victime de l'attaque un logiciel malveillant destiné à rediriger des données vers le terminal mobile de l'attaquant. Cette installation est réalisée par exemple au moyen d'un cheval de Troie, logiciel apparemment légitime du point de vue du terminal mobile de la victime et qui comprend le logiciel malveillant. Le logiciel malveillant est agencé pour écouter et enregistrer des données échangées avec l'élément de sécurité lors de transactions de paiement légitimes. En particulier, des données sensibles telles que le code d'identification personnel, saisi par l'utilisateur légitime pour valider une transaction de paiement peuvent ainsi être accessibles au logiciel malveillant. Par exemple, le code d'identification personnel peut être demandé à l'utilisateur lors de l'exécution d'une fonction de sécurité telle qu'une fonction de signature qui nécessite d' accéder à une clé privée de signature mémorisée dans le module de sécurité. Such an architecture is however sensitive to relay type attacks. To set up such an attack, an attacker installs malicious software on the mobile terminal of the victimized user to redirect data to the attacker's mobile terminal. This installation is performed for example by means of a Trojan horse, apparently legitimate software from the point of view of the mobile terminal of the victim and which includes malicious software. The malware is arranged to listen and record data exchanged with the security element during legitimate payment transactions. In particular, sensitive data such as the personal identification code entered by the legitimate user to validate a payment transaction can thus be accessible to the malicious software. For example, the personal identification code may be requested at the user when executing a security function such as a signature function that requires access to a signature private key stored in the security module.
L'attaquant installe également un logiciel de contrôle sur son propre terminal mobile. Le logiciel de contrôle est agencé pour contrôler les actions du logiciel malveillant installé sur le terminal de la victime et pour relayer astucieusement, via le réseau Internet, des informations du terminal de la victime vers le terminal de l'attaquant ou du terminal de l'attaquant vers le terminal de la victime.  The attacker also installs control software on his own mobile terminal. The control software is arranged to control the actions of the malicious software installed on the victim's terminal and cleverly relay, via the Internet, information from the victim's terminal to the attacker's terminal or the terminal of the victim. attacker to the victim's terminal.
Ainsi, dans un premier exemple d'attaque, l'attaquant initie une transaction de paiement chez un marchand. Les échanges entre l'élément de sécurité du terminal de l'attaquant et le terminal de paiement, via le lecteur et le contrôleur NFC, sont relayés par le logiciel de contrôle du terminal de l'attaquant vers le logiciel malveillant installé sur le terminal de la victime. Le logiciel malveillant commande l'exécution de l'application de paiement du terminal mobile de la victime. Lorsque le code d'identification personnel nécessaire pour accéder à une fonction sensible de l'élément de sécurité de la victime est demandé lors de la transaction, le logiciel malveillant le transmet sans que la victime ne soit sollicitée. Les réponses de l'élément de sécurité de la victime sont ainsi relayées par le logiciel malveillant vers le terminal de l'attaquant qui les transmet au terminal de paiement du marchand via le contrôleur NFC. Ni le marchand, ni la victime ne se rendent compte qu'une attaque a lieu. Cependant, c'est le compte de la victime qui est débité à la place de celui de l'attaquant. Une telle attaque par relais permet ainsi à l'attaquant d'acheter des biens en débitant le compte de la victime.  Thus, in a first example of attack, the attacker initiates a payment transaction at a merchant. The exchanges between the security element of the attacker's terminal and the payment terminal, via the reader and the NFC controller, are relayed by the attacker's terminal control software to the malicious software installed on the terminal of the attacker. the victim. The malware controls the execution of the payment application of the victim's mobile terminal. When the personal identification code needed to access a sensitive function of the security element of the victim is requested during the transaction, the malware transmits it without the victim being requested. The responses of the security element of the victim are thus relayed by the malware to the terminal of the attacker who transmits them to the merchant's payment terminal via the NFC controller. Neither the merchant nor the victim realize that an attack is taking place. However, the victim's account is debited instead of the attacker's account. Such a relay attack thus allows the attacker to buy goods by debiting the victim's account.
Dans un deuxième exemple d'attaque, l'attaquant vole des données de type points de fidélité destinés à la victime, plus précisément destinés à être mémorisées dans l'élément de sécurité de la victime. Dans ce cas, c'est la victime qui initie une transaction chez un marchand à travers un lecteur sans contact. Des points de fidélité qui sont transmis en fin de transaction par le marchand au terminal de la victime via le lecteur et le contrôleur NFC sont relayés, via le réseau Internet, par le logiciel malveillant installé sur le terminal de la victime vers le terminal mobile de l'attaquant de manière à être enregistrés dans l'élément de sécurité de l'attaquant.  In a second example of an attack, the attacker steals loyalty point data intended for the victim, specifically intended to be stored in the security element of the victim. In this case, it is the victim who initiates a transaction with a merchant through a contactless reader. Loyalty points that are transmitted at the end of the transaction by the merchant to the victim's terminal via the reader and the NFC controller are relayed, via the Internet, by the malware installed on the victim's terminal to the mobile terminal of the victim. the attacker to be registered in the attacker's security element.
Ces attaques sont possibles du fait de la connectivité Internet des terminaux intelligents. Un des buts de l'invention est de remédier à des insuffisances/inconvénients de l'état de la technique et/ou d'y apporter des améliorations.  These attacks are possible because of the Internet connectivity of smart terminals. One of the aims of the invention is to remedy the shortcomings / disadvantages of the state of the art and / or to make improvements thereto.
A cette fin, l'invention propose un procédé de détection d'une attaque visant un terminal mobile, le terminal comprenant un élément de sécurité, un contrôleur sans contact adapté pour dialoguer avec un lecteur sans contact et un environnement d'exécution sécurisée, dans lequel : - toute commande en provenance du lecteur sans contact et reçue par le contrôleur sans contact est envoyée à l'environnement d'exécution sécurisée et au module de sécurité, et To this end, the invention proposes a method for detecting an attack on a mobile terminal, the terminal comprising a security element, a contactless controller adapted to communicate with a contactless reader and a secure execution environment, in which which : any command from the contactless reader received by the contactless controller is sent to the secure execution environment and the security module, and
- toute commande reçue par l'élément de sécurité est envoyée à l'environnement d'exécution sécurisée,  - any command received by the security element is sent to the secure execution environment,
le procédé comprenant une étape de vérification, mise en œuvre par l'environnement d'exécution sécurisée, au cours de laquelle il est vérifié qu'à une commande reçue du contrôleur sans contact correspond une même commande reçue de l'élément de sécurité, dans le cas contraire une attaque logicielle de type relais est détectée.  the method comprising a verification step, implemented by the secure execution environment, during which it is verified that a command received from the contactless controller corresponds to the same command received from the security element, in if not, a relay-type software attack is detected.
Le procédé décrit permet ainsi de détecter des attaques logicielles de type relais. En effet, il est vérifié qu'à une commande reçue du contrôleur NFC par l'environnement d'exécution sécurisée correspond la réception par l'environnement d'exécution sécurisée de la même commande en provenance de l'élément de sécurité.  The described method thus makes it possible to detect relay-type software attacks. Indeed, it is verified that a command received from the NFC controller by the secure execution environment corresponds to the receipt by the secure execution environment of the same command from the security element.
Il est habituel qu'un attaquant qui souhaite mettre en œuvre une attaque logicielle de type relais installe sur le terminal mobile d'une victime un logiciel malveillant, et sur son propre terminal mobile un logiciel de contrôle adapté pour contrôler le logiciel malveillant. Dans un premier scénario d'attaque, l'attaquant initie une transaction de paiement avec son propre terminal mobile via son contrôleur NFC. Il relaie les commandes reçues du lecteur NFC via son propre contrôleur au terminal mobile de la victime grâce au logiciel de contrôle et au logiciel malveillant installé sur le terminal de la victime. C'est l'application de paiement du terminal mobile de la victime qui est exécutée qui est ainsi exécutée. Ainsi, l'élément de sécurité transmet la commande relayée par le logiciel de contrôle du terminal mobile de l'attaquant à l'environnement d'exécution sécurisée du terminal de la victime. L'environnement d'exécution sécurisée ne reçoit cependant pas la même commande en provenance contrôleur NFC. En effet, le contrôleur NFC de la victime n'est pas impliqué dans la transaction puisque c'est celui de l'attaquant qui communique avec le lecteur NFC dans le cadre de la transaction en cours. L'attaque est donc détectée par l'environnement d'exécution sécurisée du terminal de la victime.  It is usual for an attacker who wishes to implement a relay-type software attack to install malicious software on the mobile terminal of a victim, and on his own mobile terminal adapted control software to control the malware. In a first attack scenario, the attacker initiates a payment transaction with his own mobile terminal via his NFC controller. It relays commands received from the NFC player via its own controller to the victim's mobile terminal through the control software and malicious software installed on the victim's terminal. It is the payment application of the victim's mobile terminal that is executed that is thus executed. Thus, the security element transmits the command relayed by the attacker's mobile terminal control software to the secure execution environment of the victim's terminal. However, the secure execution environment does not receive the same command from the NFC controller. Indeed, the NFC controller of the victim is not involved in the transaction since it is the attacker who communicates with the NFC player in the context of the current transaction. The attack is therefore detected by the secure execution environment of the victim's terminal.
Dans un deuxième scénario d'attaque, la victime est en train d'exécuter une transaction au cours de laquelle des points de fidélité vont être transmis à l'élément de sécurité via le contrôleur NFC du terminal de la victime. Le logiciel malveillant commandé par le logiciel de contrôle du terminal de attaquant relaie les commandes relatives à cette transmission de points de fidélité vers le terminal de l'attaquant. Une commande reçue par le contrôleur NFC du terminal mobile de la victime est donc envoyée à l'environnement d'exécution sécurisée du terminal de la victime. Cependant, cette même commande n'est pas reçue de l'élément de sécurité de la victime puisqu'elle est traitée par l'élément de sécurité de l'attaquant. Ainsi, dans ces deux scénarios, la non réception par l'environnement d'exécution sécurisée d'une même commande par deux canaux différents, en l'espèce le canal environnement d'exécution sécurisée/élément de sécurité et le canal environnement d'exécution sécurisée/contrôleur NFC, indique qu'une attaque logicielle de type relais est en cours. In a second attack scenario, the victim is executing a transaction during which loyalty points will be transmitted to the security element via the NFC controller of the victim's terminal. The malicious software controlled by the attacker terminal control software relays the commands relating to this transmission of loyalty points to the attacker's terminal. A command received by the NFC controller of the victim's mobile terminal is sent to the secure execution environment of the victim's terminal. However, this same command is not received from the victim's security element since it is processed by the attacker's security element. Thus, in these two scenarios, the non-reception by the secure execution environment of the same command by two different channels, in this case the secure execution environment / security element channel and the execution environment channel. secure / NFC controller, indicates that a relay-type software attack is in progress.
Dans un exemple de réalisation, l'élément de sécurité et l'environnement d'exécution sécurisée partagent la connaissance d'une clé secrète, le procédé comprenant en outre les étapes suivantes :  In an exemplary embodiment, the security element and the secure execution environment share the knowledge of a secret key, the method further comprising the following steps:
- calcul par l'élément de sécurité d'une première valeur de contrôle, fonction de la commande reçue du contrôleur sans contact et de la clé secrète, et envoi de ladite première valeur de contrôle à l'environnement d'exécution sécurisée,  - calculation by the security element of a first control value, a function of the command received from the contactless controller and the secret key, and sending said first control value to the secure execution environment,
- vérification par l'environnement d'exécution sécurisée de la cohérence entre la première valeur de contrôle et la commande reçue de l'élément de sécurité, une attaque logicielle de type relais étant détectée en cas d'incohérence.  verification by the secure execution environment of the consistency between the first control value and the command received from the security element, a relay-type software attack being detected in the event of an inconsistency.
Dans cet exemple de réalisation, le calcul de la première valeur de contrôle par l'élément de sécurité, fonction de la clé secrète K et de la commande C-APDU reçue du contrôleur sans contact, et l'envoi de cette valeur à l'environnement d'exécution sécurisée, permet de s'assurer que la commande transmise par l'élément de sécurité à l'environnement d'exécution sécurisée est bien celle qui est reçue par cet environnement. En d'autres termes, la valeur de contrôle permet de vérifier l'intégrité du canal de communication qui sépare l'élément de sécurité de l'environnement d'exécution sécurisée qui, par construction, n'est pas sécurisé. On rappelle que ce lien n'est pas sécurisé car le module de sécurité peut dans certains cas être amovible. Ce contrôle supplémentaire procure un niveau de sécurité supplémentaire dans détection. Ainsi, on s'assure que c'est bien l'élément de sécurité qui partage la clé privée avec l'environnement d'exécution sécurisée et qui est donc dans le même terminal mobile qui envoie la commande.  In this exemplary embodiment, the calculation of the first control value by the security element, a function of the secret key K and the C-APDU command received from the contactless controller, and the sending of this value to the secure execution environment, ensures that the command sent by the security element to the secure execution environment is the one that is received by this environment. In other words, the control value makes it possible to check the integrity of the communication channel that separates the security element from the secure execution environment which, by construction, is not secure. Remember that this link is not secure because the security module can in some cases be removable. This additional control provides an additional level of security in detection. Thus, it is ensured that it is the security element that shares the private key with the secure execution environment and is therefore in the same mobile terminal that sends the command.
Dans variante de réalisation, lequel l'élément de sécurité et l'environnement d'exécution sécurisée partagent la connaissance d'une clé secrète, le procédé comprenant en outre les étapes suivantes :  In an alternative embodiment, the security element and the secure execution environment share knowledge of a secret key, the method further comprising the steps of:
- réception par l'environnement d'exécution sécurisée, en provenance de l'élément de sécurité de la réponse,  - reception by the secure execution environment from the security element of the response,
- réception par l'environnement d'exécution sécurisée, en provenance du contrôleur sans contact de la réponse à la commande reçue de l'élément de sécurité par le contrôleur,  reception by the secure execution environment from the contactless controller of the response to the command received from the security element by the controller,
- calcul par l'élément de sécurité d'une première valeur de contrôle, fonction de la réponse reçue du contrôleur sans contact et de la clé secrète et envoi de ladite première valeur de contrôle à l'environnement d'exécution sécurisée, - vérification par l'environnement d'exécution sécurisée de la cohérence entre la première valeur de contrôle et la réponse reçue de l'élément de sécurité, une attaque logicielle de type relais étant détectée en cas d'incohérence. - calculation by the security element of a first control value, a function of the response received from the contactless controller and the secret key and sending said first control value to the secure execution environment, verification by the secure execution environment of the coherence between the first control value and the response received from the security element, a relay-type software attack being detected in the event of an inconsistency.
Dans cet exemple de réalisation, la première valeur de contrôle est calculée en fonction de la clé privée et de la réponse déterminée par l'élément de sécurité. Cet exemple est une alternative à l'exemple décrit précédemment.  In this exemplary embodiment, the first control value is calculated based on the private key and the response determined by the security element. This example is an alternative to the example described above.
Dans un autre exemple de réalisation, lequel le calcul de la première valeur de contrôle par l'élément de sécurité est également fonction d'une réponse à ladite commande déterminée par l'élément de sécurité et que le procédé comprend les étapes suivantes :  In another exemplary embodiment, which calculates the first control value by the security element is also a function of a response to said command determined by the security element and that the method comprises the following steps:
- réception par l'environnement d'exécution sécurisée, en provenance de l'élément de sécurité de la réponse,  - reception by the secure execution environment from the security element of the response,
- réception par l'environnement d'exécution sécurisée, en provenance du contrôleur sans contact de la réponse à la commande reçue de l'élément de sécurité par le contrôleur, reception by the secure execution environment from the contactless controller of the response to the command received from the security element by the controller,
- vérification de la cohérence entre la première valeur de contrôle et les commande et réponse reçues de l'élément de sécurité, checking the consistency between the first control value and the commands and responses received from the security element,
- si la vérification est positive, comparaison de la réponse reçue de l'élément de sécurité avec la réponse reçus du contrôleur sans contact, une attaque logicielle de type relais étant détectée si la vérification est négative ou si la comparaison est négative.  if the verification is positive, comparing the response received from the security element with the response received from the contactless controller, a relay-type software attack being detected if the verification is negative or if the comparison is negative.
Dans cet exemple, la première valeur de contrôle est calculée à partir de la commande et de la réponse déterminée par l'élément de sécurité. Le niveau de sécurité est donc plus élevé que lorsque le contrôle porte sur un seul type de trame.  In this example, the first control value is calculated from the command and the response determined by the security element. The level of security is therefore higher than when the control relates to a single type of frame.
Avantageusement, le procédé comprend, lorsqu' aucune attaque logicielle de type relais n'a été détectée :  Advantageously, the method comprises, when no relay-type software attack has been detected:
- une étape d'obtention par l'environnement d'exécution sécurisée auprès d'un module de localisation du terminal, de coordonnées de localisation géographique du terminal mobile, a step of obtaining, by the secure execution environment from a terminal location module, geographic location coordinates of the mobile terminal,
- une étape de comparaison desdites coordonnées de localisation géographique du terminal avec des coordonnées de localisation géographique du lecteur, une attaque matérielle de type relais étant détectée lorsque les coordonnées du terminal et du lecteur diffèrent d'une valeur supérieure à une valeur seuil donnée. a step of comparing said geographical location coordinates of the terminal with geographical location coordinates of the reader, a relay-type hardware attack being detected when the coordinates of the terminal and the reader differ from a value greater than a given threshold value.
Les étapes du procédé décrites ici permettent de détecter des attaques particulières, en l'espèce, des attaques matérielles de type relais. Ce type d'attaque est plus compliqué à mettre en œuvre pour un attaquant car il nécessite d'installer une sonde dans le terminal mobile d'une victime potentielle. Cette sonde est destinée à relayer vers, ou depuis le terminal de l'attaquant des informations qui transitent sur un lien de communication qui relie le contrôleur NFC à l'environnement d'exécution sécurisée. Avec les étapes du procédé décrites ici, on s'assure que c'est bien l'environnement d'exécution sécurisée qui est dans le terminal mobile qui communique avec le contrôleur NFC. The process steps described here make it possible to detect particular attacks, in this case, hardware attacks of the relay type. This type of attack is more complicated to implement for an attacker because it requires to install a probe in the mobile terminal of a potential victim. This probe is intended to relay to or from the attacker's terminal information that passes over a communication link that connects the NFC controller to the secure execution environment. With the process steps described here, it is ensured that it is the secure execution environment that is in the mobile terminal that communicates with the NFC controller.
L'invention concerne également un terminal mobile comprenant un élément de sécurité, un contrôleur sans contact adapté pour dialoguer avec un lecteur sans contact, et un environnement d'exécution sécurisée, et :  The invention also relates to a mobile terminal comprising a security element, a contactless controller adapted to communicate with a contactless reader, and a secure execution environment, and:
- des premiers moyens d'envoi, agencés pour envoyer toute commande en provenance du lecteur sans contact et reçue par le contrôleur sans contact à l'environnement d'exécution sécurisée et au module de sécurité,  first sending means, arranged to send any command from the contactless reader and received by the contactless controller to the secure execution environment and the security module,
- des deuxièmes moyens d'envoi, agencés pour envoyer toute commande reçue par l'élément de sécurité à l'environnement d'exécution sécurisée,  second means of sending, arranged to send any command received by the security element to the secure execution environment,
- des premiers moyens de vérification, agencés pour vérifier qu' à une commande reçue du contrôleur sans contact correspond la même commande reçue de l'élément de sécurité, une attaque logicielle de type relais est détectée en cas de vérification négative.  first verification means, arranged to verify that to a command received from the contactless controller corresponds the same command received from the security element, a relay-type software attack is detected in the event of a negative verification.
Dans un autre exemple de réalisation du terminal mobile, l'élément de sécurité et l'environnement d'exécution sécurisée partagent la connaissance d'une clé secrète, le terminal comprenant en outre :  In another embodiment of the mobile terminal, the security element and the secure execution environment share the knowledge of a secret key, the terminal further comprising:
- des moyens de calcul et d'envoi, agencés pour que l'élément de sécurité calcule une première valeur de contrôle, fonction de la commande reçue du contrôleur sans contact et de la clé secrète, et pour envoyer ladite première valeur de contrôle à l'environnement d'exécution sécurisée,  means for calculating and sending, arranged so that the security element calculates a first control value, a function of the command received from the contactless controller and the secret key, and to send said first control value to the secure execution environment,
- des deuxièmes moyens de vérification, agencés pour que l'environnement d'exécution sécurisée vérifie la cohérence entre la première valeur de contrôle et la commande reçue de l'élément de sécurité, une attaque logicielle de type relais étant détectée en cas d'incohérence.  second verification means, arranged so that the secure execution environment checks the consistency between the first control value and the command received from the security element, a relay-type software attack being detected in the event of an inconsistency .
Dans un autre exemple de réalisation, le terminal mobile comprend en outre :  In another embodiment, the mobile terminal further comprises:
- un module de géolocalisation, agencé pour fournir à l'environnement d'exécution sécurisée des coordonnées géographiques du terminal mobile,  a geolocation module, arranged to provide the secure execution environment with the geographical coordinates of the mobile terminal,
- des moyens de réception de coordonnées géographiques du lecteur, agencés pour recevoir des coordonnées géographiques du lecteur,  means for receiving geographical coordinates of the reader, arranged to receive geographical coordinates of the reader,
- des moyens de comparaison, agencés pour, lorsqu' aucune attaque par relais n'a été détectée, comparer les coordonnées du terminal mobile avec les coordonnées géographiques du lecteur, une attaque matérielle étant détectée lorsque les coordonnées du terminal et du lecteur diffèrent d'une valeur supérieure à une valeur seuil donnée.  comparison means, arranged for, when no relay attack has been detected, comparing the coordinates of the mobile terminal with the geographic coordinates of the reader, a hardware attack being detected when the coordinates of the terminal and the reader differ from a value greater than a given threshold value.
L'invention concerne aussi un programme d'ordinateur sur un support de données et chargeable dans la mémoire d'un terminal mobile, le programme comprenant des instructions de code pour l'exécution des étapes du procédé de détection d'attaques selon l'invention, lorsque le programme est exécuté sur ledit ordinateur. The invention also relates to a computer program on a data carrier and loadable in the memory of a mobile terminal, the program comprising instructions for code for performing the steps of the attack detection method according to the invention, when the program is executed on said computer.
L'invention porte également sur un support de données dans lequel est enregistré le programme selon l'invention.  The invention also relates to a data carrier in which the program according to the invention is recorded.
D'autres caractéristiques et avantages de la présente invention seront mieux compris de la description et des dessins annexés parmi lesquels : Other features and advantages of the present invention will be better understood from the description and the appended drawings in which:
- la figure 1 est une représentation schématique d'une architecture adaptée pour mettre en œuvre les étapes d'un procédé de détection d'attaques, selon un premier exemple de réalisation de l'invention ;  FIG. 1 is a schematic representation of an architecture adapted to implement the steps of an attack detection method, according to a first embodiment of the invention;
- la figure 2a présente les étapes d'un procédé de détection d'attaques logicielle de type relais, selon un premier exemple de réalisation de l'invention ;  FIG. 2a presents the steps of a method of detecting software attacks of relay type, according to a first embodiment of the invention;
- la figure 2b présente les étapes d'un procédé de détection d'attaques matérielle, selon un exemple de réalisation de l'invention ;  FIG. 2b presents the steps of a method for detecting hardware attacks, according to an embodiment of the invention;
- la figure 3 est une représentation schématique fonctionnelle d'un terminal mobile, selon un exemple de réalisation de l'invention.  FIG. 3 is a functional schematic representation of a mobile terminal, according to an exemplary embodiment of the invention.
Une architecture adaptée pour mettre en œuvre les étapes du procédé de détection d'attaques, selon un premier exemple de réalisation de l'invention, va maintenant être décrite en relation avec la figure 1. An architecture adapted to implement the steps of the attack detection method, according to a first embodiment of the invention, will now be described in relation to FIG.
Dans cette architecture, un terminal mobile 10 est conforme aux spécifications proposées par l'association GlobalPlatform, ou conforme à des approches similaires. Les spécifications GlobalPlatform définissent une architecture de terminal mobile où coexistent deux environnements d'exécution : un environnement d'exécution sécurisée 11, ou « TEE » (de l'anglais « Trusted Execution Environment ») et un environnement d'exécution non sécurisée, ou « REE » (de l'anglais « Rich Execution Environment ») (non représenté sur la figure 1). L'environnement d'exécution sécurisée 11 est indépendant de l'environnement d'exécution non sécurisée. Il est destiné à offrir un environnement logiciel et matériel pour des applications sécurisées. Il est considéré de confiance et s'appuie sur ses propres ressources : un système d'exploitation sûr, des modules logiciels sûrs et des ressources matérielles sûres, comme des fonctions de sécurité telles qu'un stockage sûr, des interfaces de communication avec des composants de sécurité, etc. L'environnement d'exécution sécurisée 11 est agencé pour fournir des services de sécurité à l'environnement d'exécution non sécurisé au moyen d'interfaces prédéfinies. Il est connu des spécifications GlobalPlatform que le système d'exploitation de l'environnement d'exécution sécurisée 11 est exécuté à partir d'un microprogramme approuvé (on parle de « firmware » en anglais) qui est authentifié et isolé du système d'exploitation non sécurisé durant le processus de démarrage (on parle de « boot » en anglais). Une fois le microprogramme authentifié, le système d'exploitation sécurisée 11 est exécuté et l'environnement d'exécution sécurisée 11 est établi. Lors de cet établissement, l'environnement d'exécution sécurisée 11 initialise le microprogramme, importe des données cryptographiques telles que des clés, des certificats, des signatures et configure certains périphériques afin de garantir la sécurité lors de communications entre l'environnement d'exécution sécurisée 11 et ces périphériques. Au terme de l'établissement de l'environnement d'exécution sécurisée 11, le contrôle est transmis à l'environnement d'exécution non sécurisée. Le démarrage du terminal se poursuit alors avec une exécution du système d'exploitation non sécurisé et un établissement lors de cette exécution de l'environnement d'exécution non sécurisée. Si ensuite l'utilisateur sélectionne une application sécurisée, le système bascule vers l'environnement d'exécution sécurisée et exécute l'application dans cet environnement sûr. Dès la fin de l'exécution de l'application, le système bascule de nouveau vers l'environnement d'exécution non sécurisée. In this architecture, a mobile terminal 10 conforms to the specifications proposed by the GlobalPlatform association, or conforms to similar approaches. The GlobalPlatform specifications define a mobile terminal architecture where two execution environments coexist: a secure execution environment 11, or "TEE" (Trusted Execution Environment ") and an unsecured execution environment, or "REE" (of the English "Rich Execution Environment") (not shown in Figure 1). The secure execution environment 11 is independent of the unsecured execution environment. It is intended to provide a software and hardware environment for secure applications. It is considered trusted and relies on its own resources: a secure operating system, secure software modules and secure hardware resources, such as security features such as secure storage, communication interfaces with components security, etc. The secure execution environment 11 is arranged to provide security services to the unsecured execution environment through predefined interfaces. It is known from the GlobalPlatform specifications that the operating system of the secure runtime environment 11 is run from a trusted firmware (we speak of "firmware" in English) which is authenticated and isolated from the unsecured operating system during the boot process (we speak of "boot" in English). Once the firmware is authenticated, the secure operating system 11 is executed and the secure execution environment 11 is established. During this establishment, the secure runtime environment 11 initializes the firmware, imports cryptographic data such as keys, certificates, signatures, and configures certain devices to ensure security during communications between the runtime environment. secure 11 and these devices. After the establishment of the secure execution environment 11, the control is transmitted to the unsecured execution environment. Terminal startup then continues with an unsecured operating system run and an establishment during this execution of the unsecured execution environment. If the user next selects a secure application, the system switches to the secure runtime environment and runs the application in that secure environment. Upon completion of the application execution, the system switches back to the unsecured execution environment.
Le terminal mobile 10 comprend également un élément de sécurité 12. L'élément de sécurité 12 est par exemple une carte « UICC » (pour « Universal Integrated Circuit Card »), telle une carte d'identité d'abonné ou carte « SIM » (de l'anglais « Subscriber Identity Module »), amovible ou soudée (on parle alors « d'embedded SIM »). Dans un autre exemple de réalisation, l'élément de sécurité est un composant amovible de type microSD (« SD » pour Sandisk ®). Dans un autre exemple de réalisation, l'élément de sécurité est une zone logicielle sécurisée. L'élément de sécurité 12 est agencé pour mémoriser des applications ou fonctions sensibles, par exemple une application de paiement, des fonctions et des données cryptographiques telles que des fonctions de signature, des clés secrètes, etc. L'application de paiement comprend des instructions de code pour mettre en œuvre certaines des étapes du procédé de détection d'attaque. Dans un exemple de réalisation, l'application de paiement est mémorisée dans l'environnement d'exécution sécurisée 11 et fait appel à une ou plusieurs fonctions sensibles mémorisées dans l'élément de sécurité 12, par exemple une fonction de signature qui nécessite, pour débloquer l'accès à une clé privée de signature, la saisie par l'utilisateur d'un code PIN correct. Dans un autre exemple de réalisation, l'application de paiement est mémorisée dans l'élément de sécurité 12. Le terminal mobile 10 comprend également un contrôleur sans contact, par exemple un contrôleur « NFC » 13 (de l'anglais « Near Field Communication ») agencé pour permettre une communication sans contact avec un lecteur sans contact, par exemple un lecteur NFC 20 relié à un serveur 21 distant, par exemple le serveur d'un marchand. Lorsque l'application de paiement est exécutée, elle dialogue avec une application du marchand qui s'exécute dans le serveur 21 via le contrôleur NFC 13 et le lecteur NFC 20. Le contrôleur NFC 13 comprend des instructions de code pour mettre en œuvre celles des étapes du procédé de détection d'attaques qui sont exécutées par le contrôleur NFC 13. Dans un exemple de réalisation, le terminal mobile 10 comprend également un module de géolocalisation, par exemple un module « GPS » 16 (de l'anglais « Global Positioning System ») destiné à fournir des coordonnées de localisation du terminal mobile. Les coordonnées géographiques fournies par le module de géolocalisation 16 sont exprimées par exemple par un couple (X, Y) où X représente la latitude en degrés, minutes, secondes et millièmes de secondes et Y la longitude en degrés, minutes, secondes et millièmes de seconde. Dans un exemple de réalisation, la technique de localisation géographique utilisée par le module 16 est différentielle ; cette technique est plus précise qu'une localisation GPS standard. The mobile terminal 10 also comprises a security element 12. The security element 12 is for example a "UICC" card (for "Universal Integrated Circuit Card"), such as a subscriber identity card or "SIM" card. ("Subscriber Identity Module"), removable or welded (so called "embedded SIM"). In another embodiment, the security element is a microSD-type removable component ("SD" for Sandisk®). In another exemplary embodiment, the security element is a secure software zone. The security element 12 is designed to store sensitive applications or functions, for example a payment application, functions and cryptographic data such as signature functions, secret keys, etc. The payment application includes code instructions for implementing some of the steps of the attack detection method. In an exemplary embodiment, the payment application is stored in the secure execution environment 11 and uses one or more sensitive functions stored in the security element 12, for example a signature function which requires, for unlock access to a private key signature, the entry by the user of a correct PIN. In another exemplary embodiment, the payment application is stored in the security element 12. The mobile terminal 10 also comprises a contactless controller, for example an "NFC" controller 13 ("Near Field Communication" ) Arranged to allow contactless communication with a contactless reader, for example an NFC reader 20 connected to a remote server 21, for example the server of a merchant. When the payment application is executed, it dialogs with a merchant application that runs in the server 21 via the NFC controller 13 and the reader NFC 20. The NFC controller 13 comprises code instructions for implementing those steps of the attack detection method that are executed by the NFC controller 13. In an exemplary embodiment, the mobile terminal 10 also comprises a module for geolocation, for example a "GPS" module 16 (of the "Global Positioning System") intended to provide location coordinates of the mobile terminal. The geographical coordinates provided by the geolocation module 16 are expressed for example by a pair (X, Y) where X represents the latitude in degrees, minutes, seconds and thousandths of seconds and Y the longitude in degrees, minutes, seconds and thousandths of seconds. second. In an exemplary embodiment, the geographic location technique used by the module 16 is differential; this technique is more accurate than a standard GPS location.
On suppose que lors du démarrage de l'environnement d'exécution sécurisée 11, celui-ci a configuré le contrôleur NFC 13 et le module GPS 16 le cas échéant, de manière à garantir la sécurité des communications qu'il établit avec ces périphériques. Ainsi, d'un point de vue logiciel les échanges entre l'environnement d'exécution sécurisée 11 et le contrôleur NFC 13 d'une part, et entre l'environnement d'exécution sécurisée 11 et le module GPS 16 d'autre part sont supposés sécurisés.  It is assumed that when starting the secure execution environment 11, the latter has configured the NFC controller 13 and the GPS module 16 if necessary, so as to guarantee the security of the communications that it establishes with these devices. Thus, from a software point of view, the exchanges between the secure execution environment 11 and the NFC controller 13 on the one hand, and between the secure execution environment 11 and the GPS module 16 on the other hand are supposedly secure.
On suppose par ailleurs que dans un exemple de réalisation, l'élément de sécurité 12 et l'environnement d'exécution sécurisée 11 partagent la connaissance d'une clé secrète K destinée à garantir que des commandes reçues du lecteur NFC 13 et des réponses qui sont transmises en réponse au lecteur 20 proviennent bien du module de sécurité du terminal mobile qui est en train de réaliser la transaction.  It is furthermore assumed that in an exemplary embodiment, the security element 12 and the secure execution environment 11 share the knowledge of a secret key K intended to guarantee that commands received from the NFC reader 13 and responses that are transmitted in response to the reader 20 come from the security module of the mobile terminal that is performing the transaction.
Lors de l'exécution de l'application de paiement qui réside dans l'environnement d'exécution sécurisée 11 ou dans l'élément de sécurité 12, des informations relatives à la transaction sont transportées au format APDU (de l'anglais « Application Protocol Data Unit ») entre le lecteur NFC 20, l'environnement d'exécution sécurisée 11 et l'élément de sécurité 12, par l'intermédiaire du contrôleur NFC 13.  When executing the payment application that resides in the secure execution environment 11 or in the security element 12, information relating to the transaction is transported in APDU ("Application Protocol") format. Data Unit ") between the NFC reader 20, the secure execution environment 11 and the security element 12, via the NFC controller 13.
Les étapes d'un procédé de détection d'attaques sur un terminal mobile, selon un premier exemple de réalisation de l'invention, vont maintenant être décrites en relation avec la figure 2a. The steps of an attack detection method on a mobile terminal, according to a first embodiment of the invention, will now be described in relation with FIG. 2a.
Un utilisateur, équipé d'un terminal mobile 10 conforme à la description présentée dans l'architecture décrite en relation avec la figure 1 souhaite exécuter une application sans contact, telle une application de paiement NFC mémorisée dans l'élément de sécurité 12 de son terminal mobile 10. Dans une phase préalable de configuration, il a été installé dans l'élément de sécurité 12 et dans l'environnement d'exécution sécurisée 11 du terminal mobile 10 une clé secrète K, partagée par ces deux entités. Dans un exemple de réalisation, l'installation a été faite en usine, avant que le terminal mobile 10 ne soit commercialisé. Dans un autre exemple de réalisation, la clé secrète K a été installée après la mise sur le marché du terminal 10. Par exemple, elle a été installée dans l'élément de sécurité 12 au moyen d'une procédure « OTA » (de l'anglais « Over The Air ») et dans l'environnement d'exécution sécurisée 11 au moyen d'une procédure similaire, via le réseau Internet 3G ou 4G. A user equipped with a mobile terminal 10 according to the description presented in the architecture described in connection with FIG. 1 wishes to execute a contactless application, such as an NFC payment application stored in the security element 12 of its terminal. mobile 10. In a preliminary configuration phase, a secret key K, shared by these two entities, has been installed in the security element 12 and in the secure execution environment 11 of the mobile terminal 10. In an exemplary embodiment, the installation was made in the factory, before the mobile terminal 10 is marketed. In another embodiment, the secret key K has been installed after the terminal 10 has been placed on the market. For example, it has been installed in the security element 12 by means of an "OTA" procedure. English "Over The Air") and in the secure execution environment 11 through a similar procedure via the 3G or 4G Internet network.
Dans une étape initiale (non représentée), l'utilisateur, équipé de son terminal mobile 10 s'approche du lecteur NFC 20 afin de réaliser une transaction sans contact. Dans un exemple de réalisation, le lecteur NFC 20, situé dans une gare, permet à l'utilisateur d'acheter des billets de train au moyen de son terminal mobile 10. Approcher le terminal mobile 10 du lecteur NFC 20 déclenche l'exécution d'une application de paiement mémorisée dans l'élément de sécurité 12 du terminal mobile 10. Dans un autre exemple de réalisation, l'utilisateur du terminal mobile 10 déclenche l'exécution de l'application de paiement en sélectionnant celle-ci dans un menu, puis approche son terminal mobile 10 du lecteur NFC 20. Il s'établit alors un dialogue entre l'application de paiement mémorisée dans l'élément de sécurité 12 et un module de paiement (non représenté sur la figure 2) du marchand mémorisé dans le serveur distant 21, via le lecteur NFC 20 et le contrôleur NFC 13 du terminal 10. Les informations échangées lors de ce dialogue, sous forme de commandes et de réponses, sont transportées dans des trames « APDU » (de l'anglais « Application Protocol Data Unit »).  In an initial step (not shown), the user, equipped with his mobile terminal 10 approaches the NFC reader 20 to perform a transaction without contact. In an exemplary embodiment, the NFC reader 20, located in a station, allows the user to buy train tickets using his mobile terminal 10. Approaching the mobile terminal 10 of the NFC reader 20 triggers the execution of a payment application stored in the security element 12 of the mobile terminal 10. In another embodiment, the user of the mobile terminal 10 triggers the execution of the payment application by selecting it in a menu , then approaches its mobile terminal 10 of the NFC reader 20. There is then established a dialogue between the payment application stored in the security element 12 and a payment module (not shown in Figure 2) of the merchant stored in the remote server 21, via the NFC reader 20 and the NFC controller 13 of the terminal 10. The information exchanged during this dialogue, in the form of commands and responses, are transported in "APDU" frames (" Application Protocol Data Unit ").
Dans une étape El d'envoi de commande, une commande C-APDU est envoyée du serveur 21 à l'élément de sécurité 12, plus précisément à l'application de paiement située dans l'élément de sécurité 12, via le lecteur NFC 20 et le contrôleur NFC 13. La commande C-APDU est reçue par le contrôleur NFC 13 dans une étape E2 de réception et de retransmission, puis transmise à l'élément de sécurité 12. La commande C-APDU est reçue par l'élément de sécurité 12, plus précisément par l'application de paiement mémorisée dans l'élément de sécurité 12, dans une étape E3 de réception. La commande C-APDU est par exemple une demande de données : demande de confirmation du montant du billet, demande de confirmation du trajet, demande de validation de paiement, etc.  In a command sending step E1, a C-APDU command is sent from the server 21 to the security element 12, more precisely to the payment application located in the security element 12, via the NFC reader 20. and the NFC controller 13. The C-APDU is received by the NFC controller 13 in a receiving and retransmitting step E2, and then transmitted to the security element 12. The C-APDU command is received by the security 12, more precisely by the payment application stored in the security element 12, in a receiving step E3. The C-APDU command is for example a request for data: request for confirmation of the amount of the ticket, request for confirmation of the journey, request for validation of payment, etc.
Cette commande C-APDU est traitée par l'élément de sécurité 12 dans une étape E4 de traitement. L'élément de sécurité 12 détermine une réponse R-APDU suite à ce traitement. Par exemple, si la commande C-APDU reçue est une demande de confirmation de trajet, un message est affiché à l'attention de l'utilisateur qui confirme ou non le trajet. La réponse R- APDU comprend alors la réponse de l'utilisateur. Si la commande C-APDU est un message de validation du paiement, il est demandé à l'utilisateur de saisir un code PIN de service. La saisie d'un code PIN correct déclenche l'exécution d'une fonction de sécurité, par exemple une signature des informations de paiement relatives à la transaction en cours, au moyen d'une clé privée de signature mémorisée dans l'élément de sécurité 12. Dans ce cas, la réponse R-APDU déterminée par l'élément de sécurité 12 est un message qui comprend la signature des informations de paiement. This C-APDU command is processed by the security element 12 in a processing step E4. The security element 12 determines an R-APDU response following this processing. For example, if the received C-APDU command is a path confirmation request, a message is displayed to the user who confirms the path or not. The response R-APDU then comprises the response of the user. If the C-APDU command is a message from payment validation, the user is asked to enter a service PIN. Entering a correct PIN triggers the execution of a security function, for example a signature of the payment information relating to the current transaction, by means of a signature private key stored in the security element 12. In this case, the R-APDU response determined by the security element 12 is a message that includes the signature of the payment information.
Dans une étape E5 de calcul d'une première valeur de contrôle, l'élément de sécurité 12, plus précisément l'application de paiement, calcule une première valeur de contrôle a. La première valeur de contrôle a est calculée en appliquant une fonction cryptographique f à la commande C-APDU reçue du contrôleur NFC 13 au cours de l'étape E3 de réception, et à la réponse R-APDU déterminée par l'élément de sécurité 12. La fonction cryptographique f est paramétrée par la clé secrète K partagée par l'élément de sécurité 12 et l'environnement d'exécution sécurisée 11. La fonction cryptographique f est par exemple une fonction d' authentification de type « MAC » (de l'anglais « Message Authentication Code »), par exemple la fonction « HMAC » (pour « Keyed-Hashed MAC »), ou la fonction « CMAC » (pour « Cipher-based MAC »). La première valeur de contrôle a est destinée à permettre à l'environnement d'exécution sécurisée 11 de vérifier l'intégrité de la commande C-APDU et de la réponse R-APDU qui ont été traitées par l'élément de sécurité 12. Ce contrôle se justifie par le fait que le lien de communication entre l'environnement d'exécution sécurisée 11 et l'élément de sécurité 12 n'est, par construction, pas sécurisé. Un tel contrôle est donc destiné à s'assurer de l'intégrité du canal de communication entre l'élément de sécurité 12 et l'environnement d'exécution sécurisée 11.  In a step E5 of calculating a first control value, the security element 12, more precisely the payment application, calculates a first control value a. The first control value a is calculated by applying a cryptographic function f to the C-APDU command received from the NFC controller 13 during the receiving step E3, and to the R-APDU response determined by the security element 12. The cryptographic function f is parameterized by the secret key K shared by the security element 12 and the secure execution environment 11. The cryptographic function f is for example a "MAC" type authentication function. English "Message Authentication Code"), for example the "HMAC" (for "Keyed-Hashed MAC") function, or the "CMAC" (for "Cipher-based MAC") function. The first control value a is intended to enable the secure execution environment 11 to check the integrity of the C-APDU command and the R-APDU response that were processed by the security element 12. Control is justified by the fact that the communication link between the secure execution environment 11 and the security element 12 is, by construction, not secure. Such a control is therefore intended to ensure the integrity of the communication channel between the security element 12 and the secure execution environment 11.
Dans une étape E6 d'envoi de paramètres, l'élément de sécurité 12 envoie à l'environnement d'exécution sécurisée 11 un ensemble de paramètres qui comprend la première valeur de contrôle a, la commande C-APDU reçue par l'élément de sécurité 12 au cours de l'étape E3 et la réponse R-APDU qu'il a déterminée au cours de l'étape E4 de traitement. Cet ensemble de paramètres est reçu par l'environnement d'exécution sécurisée 11 dans une étape E7 de réception.  In a parameter sending step E6, the security element 12 sends to the secure execution environment 11 a set of parameters which comprises the first control value a, the C-APDU command received by the security element. security 12 during step E3 and the R-APDU response that it determined during the processing step E4. This set of parameters is received by the secure execution environment 11 in a receiving step E7.
Dans une étape E8 d'envoi, la réponse R-APDU déterminée est envoyée par l'élément de sécurité 12 au contrôleur NFC 13. Elle est reçue par le contrôleur NFC 13 dans une étape E9 de réception.  In a sending step E8, the determined R-APDU response is sent by the security element 12 to the NFC controller 13. It is received by the NFC controller 13 in a reception step E9.
Dans une étape E10 d'envoi d'informations de transaction, le contrôleur NFC 13 envoie à l'environnement d'exécution sécurisée 11 des informations relatives à la transaction en cours. Dans cet exemple, le contrôleur NFC 13 envoie la commande C-APDU qu'il a reçue du lecteur NFC 20 au cours de l'étape E2 de réception et la réponse R-APDU à cette commande qu'il a reçue de l'élément de sécurité 12 au cours de l'étape E9 de réception. La commande C-APDU et la réponse R-APDU sont reçues par l'environnement d'exécution sécurisée 11 dans une étape El i de réception. In a transaction information sending step E10, the NFC controller 13 sends information about the current transaction to the secure execution environment 11. In this example, the NFC controller 13 sends the C-APDU command that it received from the NFC reader 20 during the receiving step E2 and the R-APDU response to that command that it has. received from the security element 12 during the reception step E9. The C-APDU command and the R-APDU response are received by the secure execution environment 11 in a receiving step El i.
Dans une étape E12 de contrôle d'intégrité, l'environnement d'exécution sécurisée 11 vérifie l'intégrité de la commande C-APDU et de la réponse R-APDU reçues de l'élément de sécurité 12 au cours de l'étape E7 de réception. A cette fin il calcule une deuxième valeur de contrôle a' en appliquant la même fonction cryptographique f que celle appliquée par l'élément de sécurité 12 au cours de l'étape E5 de calcul de la première valeur de contrôle a à la commande C-APDU et à la réponse R-APDU reçues du module de sécurité 12 au cours de l'étape E7. La fonction cryptographique f est paramétrée avec la même clé secrète K. Si les deux valeurs de contrôle sont différentes, c'est-à-dire si a≠ a' (branche « nok » sur la figure 2), cela signifie que les données envoyées par le module de sécurité 12 diffèrent de celles reçues par l'environnement d'exécution sécurisée 11. Ce peut être le cas lorsque la première valeur de contrôle a a été calculée au moyen d'une clé secrète différente de celle utilisée par l'environnement d'exécution sécurisée 11 pour calculer la deuxième valeur de contrôle α' , ou lorsque les commande C-APDU et réponse R-APDU reçues de l'élément de sécurité 12 diffèrent de celles utilisées par l'élément de sécurité 12 pour calculer la première valeur de contrôle a. Cela peut signifier que ce n'est pas le module de sécurité 12 présent dans le terminal mobile 10 qui a calculé la première valeur de contrôle a. Dans ce cas le procédé se termine dans une étape E13 de fin, ce qui met fin à la transaction en cours. Dans une étape optionnelle suivante (non représentée sur la figure 2), un message d'information est affiché à l' attention de l'utilisateur et/ou envoyé par l'environnement d'exécution sécurisée 11 au lecteur NFC 20.  In an integrity checking step E12, the secure execution environment 11 checks the integrity of the C-APDU command and the R-APDU response received from the security element 12 during the step E7 reception. For this purpose, it calculates a second control value a 'by applying the same cryptographic function f as that applied by the security element 12 during the step E5 of calculating the first control value a to the command C- APDU and R-APDU response received from security module 12 during step E7. The cryptographic function f is parameterized with the same secret key K. If the two control values are different, that is to say if a ≠ a '(branch "nok" in FIG. 2), this means that the data sent by the security module 12 differ from those received by the secure execution environment 11. This may be the case when the first control value has been calculated by means of a secret key different from that used by the environment. 11 to calculate the second control value α ', or when the C-APDU and R-APDU commands received from the security element 12 differ from those used by the security element 12 to calculate the first control value a. This may mean that it is not the security module 12 present in the mobile terminal 10 that has calculated the first control value a. In this case, the process ends in an end step E13, which terminates the current transaction. In an optional next step (not shown in FIG. 2), an information message is displayed to the user and / or sent by the secure execution environment 11 to the NFC reader 20.
Dans un deuxième cas où les deux valeurs de contrôle sont identiques, c'est-à-dire où a = a' (branche « ok » sur la figure 2), cela signifie que la commande C-APDU et la réponse R- APDU envoyées par l'élément de sécurité 12 sont bien celles qui ont été reçues par l'environnement d'exécution sécurisée 11. Dans ce cas, dans une étape E14 de vérification, l'environnement d'exécution sécurisée 11 vérifie que les commandes C-APDUs et les réponses R-APDUs reçues d'une part de l'élément de sécurité 12 au cours de l'étape E7 et d' autre part du contrôleur NFC 13 au cours de l'étape El i sont identiques. Dans un premier cas où elles sont différentes (branche « nok » sur la figure 2), cela signifie que la commande C-APDU et/ou la réponse R-APDU reçues du contrôleur NFC 13 sont différentes de la commande C-APDU et/ou de la réponse R-APDU reçue et traitée par l'élément de sécurité 12. Dans ce cas, une attaque par relais est en cours. Le procédé se termine dans l'étape E13 de fin, ce qui met fin à la transaction en cours. Dans une étape optionnelle suivante (non représentée sur la figure 2), un message d'information est affiché à l'attention de l'utilisateur et/ou envoyé par l'environnement d'exécution sécurisée 11 au lecteur NFC 14. Dans un deuxième cas où les commandes C- APDUs et les réponses R-APDUs reçues respectivement du contrôleur NFC 13 et de l'élément de sécurité 12 sont identiques (branche « ok » sur la figure), on considère qu'il n'y a pas d'attaque logicielle par relais en cours sur le terminal mobile 10. La transaction peut continuer. L'environnement d'exécution sécurisée 11 en informe le contrôleur NFC 13 dans une étape E15 d'informations. Le contrôleur NFC 13 peut envoyer la réponse R-APDU au serveur 21 via le lecteur NFC 20 dans une étape El 6 de réponse et une nouvelle commande (non représentée) peut être reçue du serveur 15 via le lecteur 14 et le contrôleur 13 et traitée comme décrit précédemment. In a second case where the two control values are identical, that is to say where a = a '(branch "ok" in FIG. 2), this means that the C-APDU command and the R-APDU response sent by the security element 12 are those that have been received by the secure execution environment 11. In this case, in a verification step E14, the secure execution environment 11 verifies that the commands C- APDUs and the R-APDUs responses received on the one hand from the security element 12 during the step E7 and on the other hand from the NFC controller 13 during the step El i are identical. In a first case where they are different ("nok" branch in FIG. 2), this means that the C-APDU command and / or the R-APDU response received from the NFC controller 13 are different from the C-APDU command and / or the R-APDU response received and processed by the security element 12. In this case, a relay attack is in progress. The process ends in the end step E13, which terminates the current transaction. In an optional next step (not shown in FIG. 2), an information message is displayed to the user and / or sent by the environment. 11. In a second case where the C-APDUs and the R-APDUs respectively received from the NFC controller 13 and the security element 12 are identical (branch "ok" in FIG. ), it is considered that there is no relay software attack in progress on the mobile terminal 10. The transaction can continue. The secure execution environment 11 informs the NFC controller 13 in an information step E15. The NFC controller 13 may send the R-APDU response to the server 21 via the NFC reader 20 in a response step E1 and a new command (not shown) may be received from the server 15 via the reader 14 and the controller 13 and processed. as previously described.
Les étapes décrites précédemment permettent de détecter qu'aucune attaque logicielle de type relais n'est en cours. Il existe cependant un risque qu'une attaque plus difficile à mettre en œuvre soit en cours. Cette attaque est qualifiée d'attaque matérielle puisqu'elle nécessite d'installer une sonde sur un bus de communication qui relie l'environnement d'exécution sécurisée 11 à l'élément de sécurité 12. Les étapes décrites en relation avec la figure 2b, optionnelles, sont mises en œuvre pour détecter une attaque matérielle de type relais lorsqu' aucune attaque logicielle de type relais n'a été détectée. Elles sont mises en œuvre après l'étape E14 de comparaison et dans le cas où la comparaison est positive (branche « ok » sur la figure 2). The steps described above make it possible to detect that no relay-type software attack is in progress. However, there is a risk that an attack that is more difficult to implement may be in progress. This attack is qualified as hardware attack because it requires to install a probe on a communication bus that connects the secure execution environment 11 to the security element 12. The steps described in connection with FIG. 2b, optional, are implemented to detect a relay type hardware attack when no relay type software attack has been detected. They are implemented after the comparison step E14 and in the case where the comparison is positive (branch "ok" in FIG. 2).
Lorsque l'on souhaite détecter une telle attaque matérielle, dans une étape E17 de requête de coordonnées, mise en œuvre lorsque les première et deuxième valeurs de contrôle a et a' sont identiques, l'environnement d'exécution sécurisée 11 demande au module de localisation GPS 16 les coordonnées géographiques (X, Y) du terminal mobile 10. Cette requête est reçue par le module de localisation GPS 16 dans une étape El 8 de réception. Le module de localisation GPS 16 envoie les coordonnées géographiques du terminal mobile 10 dans une étape E19 d'envoi des coordonnées géographiques. Les coordonnées géographiques sont reçues par l'environnement d'exécution sécurisée 11 dans une étape E20 de réception.  When it is desired to detect such a hardware attack, in a coordinate query step E17, implemented when the first and second control values a and a 'are identical, the secure execution environment 11 requests the module to GPS location 16 the geographical coordinates (X, Y) of the mobile terminal 10. This request is received by the GPS location module 16 in a step El 8 of reception. The GPS location module 16 sends the geographical coordinates of the mobile terminal 10 in a step E19 sending geographical coordinates. The geographical coordinates are received by the secure execution environment 11 in a receiving step E20.
Dans une étape E21 de comparaison, l'environnement d'exécution sécurisée 12 compare les coordonnées géographiques (X, Y) du terminal mobile 10 avec les coordonnées géographiques (Χ' , Y') du lecteur NFC 20. Dans un exemple de réalisation, les coordonnées géographiques (Χ', Y') du lecteur NFC 20 sont fournies par le lecteur 20 au contrôleur NFC 13 au début de l'exécution de l'application de paiement. Elles sont transmises du contrôleur NFC 13 à l'environnement d'exécution sécurisée 11 spontanément, ou sur requête de l'environnement d'exécution sécurisée 11 dans une étape préalable non représentée sur la figure 2. La comparaison entre les coordonnées (X, Y) du terminal mobile et les coordonnées (Χ' , Y') du lecteur NFC 20 est positive si la différence entre les deux ensembles de coordonnées (X, X') et (Y, Y') est inférieure à un seuil prédéfini. Au-dessous de ce seuil, il est considéré que les données de localisation géographiques associées au terminal mobile 10 et les coordonnées géographiques (Χ' , Y') du lecteur NFC 20 sont suffisamment proches l'une de l'autre pour que l'on considère que le terminal mobile 10 et le lecteur NFC 14 sont les deux équipements qui sont effectivement impliqués dans la transaction en cours. Dans un système de localisation où les coordonnées comprennent une latitude et une longitude exprimées en degrés, minutes, secondes et millièmes de seconde, un seuil prédéfini peut consister à n'autoriser des variations que de l'ordre d'une dizaine de millièmes de secondes pour la latitude et la longitude, ce qui représente une trentaine de centimètres. In a comparison step E21, the secure execution environment 12 compares the geographical coordinates (X, Y) of the mobile terminal 10 with the geographical coordinates (Χ ', Y') of the NFC reader 20. In an exemplary embodiment, the geographical coordinates (Χ ', Y') of the NFC reader 20 are provided by the reader 20 to the NFC controller 13 at the beginning of the execution of the payment application. They are transmitted from the NFC controller 13 to the secure execution environment 11 spontaneously, or on request from the secure execution environment 11 in a preliminary step not shown in FIG. 2. The comparison between the coordinates (X, Y) of the mobile terminal and the coordinates (Χ ', Y') of the NFC reader 20 is positive if the difference between the two sets of coordinates (X, X ') and (Y, Y' ) is below a predefined threshold. Below this threshold, it is considered that the geographic location data associated with the mobile terminal 10 and the geographical coordinates (Χ ', Y') of the NFC reader 20 are sufficiently close to each other that the it is considered that the mobile terminal 10 and the NFC reader 14 are the two devices that are actually involved in the current transaction. In a location system where the coordinates include latitude and longitude expressed in degrees, minutes, seconds and thousandths of a second, a predefined threshold may consist in allowing variations only of the order of ten thousandths of a second for latitude and longitude, which is about thirty centimeters.
Dans un premier cas où la différence entre les deux ensembles de coordonnées est inférieure au seuil prédéfini (branche « ok » sur la figure 2), alors il est confirmé qu'aucune attaque par relais n'est en cours. L'environnement d'exécution sécurisée 11 en informe le contrôleur NFC 13 dans l'étape E15 d'informations. Le contrôleur NFC 13 peut envoyer la réponse R-APDU au serveur 21 via le lecteur NFC 20 dans une étape El 6 de réponse et une nouvelle commande (non représentée) peut être reçue du serveur 15 via le lecteur 14 et le contrôleur 13 et traitée comme décrit précédemment.  In a first case where the difference between the two sets of coordinates is less than the predefined threshold (branch "ok" in FIG. 2), then it is confirmed that no relay attack is in progress. The secure execution environment 11 informs the NFC controller 13 in the information step E15. The NFC controller 13 may send the R-APDU response to the server 21 via the NFC reader 20 in a response step E1 and a new command (not shown) may be received from the server 15 via the reader 14 and the controller 13 and processed. as previously described.
Dans un deuxième cas où la différence est supérieure au seuil prédéfini, (branche « nok » sur la figure 2) alors on considère qu'une attaque matérielle de type relais est en cours puisque le terminal 10 et le lecteur NFC 14 sont trop éloignés l'un de l'autre pour exécuter la transaction de paiement en cours. Dans ce cas le procédé s'arrête dans l'étape E13 de fin, ce qui met fin à la transaction en cours. Dans une étape optionnelle suivante (non représentée), un message d'information est affiché à l'attention de l'utilisateur et/ou envoyé par l'environnement d'exécution sécurisée 11 au lecteur NFC 20.  In a second case where the difference is greater than the predefined threshold, ("nok" branch in FIG. 2), then a relay type hardware attack is considered to be in progress since the terminal 10 and the NFC reader 14 are too far away. from one another to execute the current payment transaction. In this case, the process stops in the end step E13, which terminates the current transaction. In an optional next step (not shown), an information message is displayed to the user and / or sent by the secure execution environment 11 to the NFC reader 20.
L'attaque matérielle de type relais est cependant compliquée à mettre en œuvre. Les étapes optionnelles E17 à E21 permettent ainsi de s'assurer que c'est bien l'environnement d'exécution sécurisée 11 du terminal mobile 10 qui effectue la comparaison entre les première et deuxième valeurs de contrôle et qui fournit le résultat de cette comparaison au contrôleur NFC.  The relay-type hardware attack is, however, complicated to implement. The optional steps E17 to E21 thus make it possible to ensure that it is indeed the secure execution environment 11 of the mobile terminal 10 that compares the first and second control values and that provides the result of this comparison to the NFC controller.
Dans un deuxième exemple de réalisation (non représenté sur la figure 2), le contrôle effectué par l'environnement d'exécution sécurisée 11 au cours des étapes E12 et E14 porte uniquement sur la commande C-APDU. Ainsi, la première valeur de contrôle a est calculée par l'élément de sécurité 12 au cours de l'étape E5 en appliquant la fonction cryptographique f à la clé secrète K et à la commande C-APDU reçue du contrôleur NFC 13. Dans cet exemple, seules la première valeur de contrôle a et la commande C-APDU sont envoyées à l'environnement d'exécution sécurisée 11 au cours de l'étape E6 d'envoi de paramètres de contrôle. Dans l'étape E12 de vérification, la deuxième valeur de contrôle a' est calculée par l'environnement d'exécution sécurisée 11 en appliquant la fonction cryptographique f à la clé secrète K et à la commande C-APDU reçue du contrôleur NFC. Si les valeurs sont égales, alors dans l'étape E14, seules les commandes C-APDUs reçues par l'environnement d'exécution sécurisée 11 d'une part du contrôleur NFC 13 au cours de l'étape El i et d'autre part de l'élément de sécurité 12 au cours de l'étape E7 sont comparées. Le procédé est ici plus léger à mettre en œuvre en ce sens que seules les commandes C-APDU sont comparées. Dans une variante de réalisation, le contrôle est similaire à celui décrit dans cet exemple hormis qu'il concerne la réponse R-APDU au lieu de la commande C-APDU. In a second exemplary embodiment (not shown in FIG. 2), the control performed by the secure execution environment 11 during the steps E12 and E14 relates only to the C-APDU command. Thus, the first control value a is calculated by the security element 12 during the step E5 by applying the cryptographic function f to the secret key K and the C-APDU command received from the NFC controller 13. In this example, only the first control value a and the command C-APDU are sent to the secure execution environment 11 during the step E6 sending control parameters. In the verification step E12, the second control value a 'is calculated by the secure execution environment 11 by applying the cryptographic function f to the secret key K and the C-APDU command received from the NFC controller. If the values are equal, then in step E14, only the C-APDUs commands received by the secure execution environment 11 on the one hand from the NFC controller 13 during the step El i and on the other hand of the security element 12 during the step E7 are compared. The method is here lighter to implement in that only C-APDU commands are compared. In an alternative embodiment, the control is similar to that described in this example except that it concerns the R-APDU response instead of the C-APDU command.
Dans un troisième exemple de réalisation (non représenté sur la figure 3), un contrôle minimal est mis en œuvre par l'environnement d'exécution sécurisée 11 afin de détecter une attaque par relais. Ce contrôle consiste à s'assurer qu'à toute commande C-APDU reçue du contrôleur de sécurité 13 par l'environnement d'exécution sécurisée 11 correspond une même commande C-APDU reçue de l'élément de sécurité 12 par l'environnement d'exécution sécurisée 11. Dans cet exemple de réalisation, l'étape E5 de calcul de la première valeur de contrôle a n'est pas exécutée et l'étape E6 d'envoi de paramètres consiste à envoyer la commande C-APDU de l'élément de sécurité 12 à l'environnement d'exécution sécurisée 11. Dans cet exemple, le contrôleur NFC 13 envoie à l'environnement d'exécution sécurisée 11 au cours de l'étape E10 la commande C-APDU. Dans une variante de réalisation, la commande C- APDU peut être envoyée par le contrôleur NFC 13 à l'environnement d'exécution sécurisée 11 au cours de l'étape E3, en même temps qu'il l'envoie à élément de sécurité 12. Dans l'exemple décrit ici, l'étape E12 n'est pas exécutée et l'étape E14 consiste pour l'environnement d'exécution sécurisée 11 à comparer les commandes C-APDU reçues respectivement de l'élément de sécurité 12 et du contrôleur NFC 13. Une description fonctionnelle d'un terminal mobile 10 selon un premier exemple de réalisation de l'invention, va maintenant être fournie en relation avec la figure 3. In a third exemplary embodiment (not shown in FIG. 3), a minimal control is implemented by the secure execution environment 11 in order to detect a relay attack. This check consists in ensuring that any C-APDU command received from the security controller 13 by the secure execution environment 11 corresponds to the same C-APDU command received from the security element 12 by the security environment. 11. In this embodiment, the step E5 for calculating the first control value a is not executed and the step E6 for sending parameters consists in sending the command C-APDU of the security element 12 to the secure execution environment 11. In this example, the NFC controller 13 sends the secure execution environment 11 in step E10 the C-APDU command. In an alternative embodiment, the C-APDU command may be sent by the NFC controller 13 to the secure execution environment 11 during the step E3, at the same time that it sends it to security element 12. In the example described here, the step E12 is not executed and the step E14 consists for the secure execution environment 11 to compare the C-APDU commands received respectively from the security element 12 and the NFC controller 13. A functional description of a mobile terminal 10 according to a first embodiment of the invention will now be provided in connection with FIG.
Le terminal mobile 10 est un terminal intelligent de type smartphone en anglais. Il est conforme aux spécifications GlobalPlatform. Il comprend ainsi un environnement d'exécution sécurisée 101, ou TEE, et un environnement d'exécution non sécurisée (non représenté sur la figure 3). Il comprend également : un élément de sécurité 12, adapté pour héberger des applications et/ou des fonctions sensibles. Dans un exemple de réalisation, il héberge une application de paiement sans contact ; The mobile terminal 10 is a smart terminal type smartphone in English. It conforms to GlobalPlatform specifications. It thus comprises a secure execution environment 101, or TEE, and an insecure execution environment (not shown in FIG. 3). It also includes: a security element 12, adapted to host applications and / or sensitive functions. In an exemplary embodiment, it hosts a contactless payment application;
un contrôleur NFC 11 adapté pour dialoguer avec le lecteur sans contact NFC 20 (non représenté sur la figure 3), l'élément de sécurité 12 et l'environnement d'exécution sécurisée 11, et pour échanger des informations sous forme de trames APDU ;  an NFC controller 11 adapted to communicate with the NFC contactless reader 20 (not shown in FIG. 3), the security element 12 and the secure execution environment 11, and to exchange information in the form of APDU frames;
le cas échéant, un module de géolocalisation 16, adapté pour fournir les coordonnées géographiques du terminal mobile 10.  where appropriate, a geolocation module 16 adapted to provide the geographical coordinates of the mobile terminal 10.
L'environnement d'exécution sécurisée 11 est un environnement qui fonctionne en parallèle de l'environnement d'exécution non sécurisée. Les applications sensibles en termes de sécurité sont alors exécutées soit dans l'élément de sécurité, soit dans l'environnement d'exécution sécurisée. L'environnement d'exécution sécurisée fournit des fonctions de sécurité telles qu'un espace de stockage sécurisé, un espace d'exécution d'applications sécurisé et une gestion sécurisée d'interfaces d'entrée/sortie. Certains canaux de communication sont alors nativement sécurisée par l'environnement d'exécution sécurisée 11, comme le lien TEE/contrôleur NFC 13, ou le lien TEE/écran tactile (l'écran tactile n'est pas représenté sur la figure 3). Par contre, le lien TEE/élément de sécurité n'est, par construction pas sécurisé.  The secure execution environment 11 is an environment that operates in parallel with the unsecured execution environment. Security-sensitive applications are then executed either in the security element or in the secure execution environment. The secure execution environment provides security features such as secure storage space, secure application execution space, and secure management of input / output interfaces. Some communication channels are then natively secured by the secure execution environment 11, such as the TEE link / NFC controller 13, or the TEE / touch screen link (the touch screen is not shown in Fig. 3). On the other hand, the link TEE / element of security is, by construction not secured.
Le terminal mobile 10 comprend également un ensemble de ressources décrites ici de manière simplifiée comme étant réparties entre les différents éléments du terminal mobile 10. Cette description simplifiée est cohérente avec la description du procédé dans laquelle on considère que les étapes sont mises en œuvre dans le terminal mobile. Ainsi, de manière schématique, le terminal mobile 10 comprend :  The mobile terminal 10 also comprises a set of resources described here in a simplified manner as being distributed between the different elements of the mobile terminal 10. This simplified description is consistent with the description of the method in which it is considered that the steps are implemented in the mobile terminal. Thus, schematically, the mobile terminal 10 comprises:
une unité de traitement 101, ou « CPU » pour « Central Processing Unit », 101-1, un ensemble de mémoires, dont une mémoire volatile 102 et une mémoire de stockage 103. La mémoire volatile 102 est agencée pour exécuter des instructions de code, stocker des variables, etc. La mémoire de stockage 103 est agencée pour mémoriser des données de sécurité telles que des clés, des signatures, etc., le cas échéant la clé secrète K, ainsi qu'un programme sécurisé comprenant des instructions de code destinées à mettre en œuvre les étapes du procédé de détection d 'attaques telles que décrites précédemment. On comprend que par exemple, la clé secrète K, partagée entre l'élément de sécurité 12 et l'environnement d'exécution sécurisée 11 est mémorisée dans une première zone mémoire sécurisée, propre à l'élément de sécurité 12 et une deuxième zone mémoire sécurisée, propre à l'environnement d'exécution sécurisée 11. Le terminal mobile 10 comprend également : a processing unit 101, or "CPU" for "Central Processing Unit", 101-1, a set of memories, including a volatile memory 102 and a storage memory 103. The volatile memory 102 is arranged to execute code instructions , store variables, etc. The storage memory 103 is arranged to store security data such as keys, signatures, etc., where appropriate the secret key K, and a secure program comprising code instructions for implementing the steps. the method of detecting attacks as described above. It will be understood that, for example, the secret key K shared between the security element 12 and the secure execution environment 11 is stored in a first secure memory area specific to the security element 12 and a second memory zone secure, specific to the secure runtime environment 11. The mobile terminal 10 also comprises:
des premiers moyens d'envoi 104, agencés pour envoyer toute commande C-APDU en provenance du lecteur NFC 20 et reçue par le contrôleur NFC 13 à l'environnement d'exécution sécurisée 11 et à l'élément de sécurité 12 ; - des deuxièmes moyens d'envoi 105, agencés pour envoyer toute commande C- first sending means 104, arranged to send any C-APDU command from the NFC reader 20 and received by the NFC controller 13 to the secure execution environment 11 and the security element 12; second sending means 105, arranged to send any order C-
APDU reçue par l'élément de sécurité 12 à l'environnement d'exécution sécurisée i l ; APDU received by the security element 12 to the secure execution environment i l;
des premiers moyens de vérification 106, agencés poru vérifier qu'à une commande C-APDU reçue du contrôleur NFC 13 correspond une même commande C-APDU reçue de l'élément de sécurité 12, une attaque logicielle de type relais étant détectée en cas de vérification négative.  first verification means 106, arranged to verify that a C-APDU command received from the NFC controller 13 corresponds to the same C-APDU command received from the security element 12, a relay-type software attack being detected in the case of negative verification.
Dans un exemple de réalisation, le terminal mobile 10 comprend également les modules suivants, en pointillés sur la figure 3 :  In an exemplary embodiment, the mobile terminal 10 also comprises the following modules, in dashed lines in FIG. 3:
des moyens 107 de calcul et d'envoi, agencés pour que l'élément de sécurité 12 calcule une première valeur de contrôle, fonction de la commande C-APDU reçue du contrôleur NFC 13 et de la clé secrète K partagée entre l'environnement d'exécution sécurisée et l'élément de sécurité 12, et pour envoyer la valeur de contrôle ainsi calculée à l'environnement d'exécution sécurisée,  means 107 for calculating and sending, arranged so that the security element 12 calculates a first control value, a function of the C-APDU command received from the NFC controller 13 and the secret key K shared between the environment of the secure execution and the security element 12, and to send the calculated control value to the secure execution environment,
des deuxièmes moyens de vérification 108, agencés pour que l'environnement d'exécution sécurisée 11 vérifie la cohérence entre la première valeur de contrôle et la commande reçue de l'élément de sécurité 12, une attaque logicielle de type relais étant détectée en cas d'incohérence.  second verification means 108, arranged so that the secure execution environment 11 checks the coherence between the first control value and the command received from the security element 12, a relay-type software attack being detected in the event of 'inconsistency.
Dans un exemple de réalisation, le terminal mobile 10 comprend également :  In an exemplary embodiment, the mobile terminal 10 also comprises:
des moyens 109 de réception de coordonnées géographiques, agencés pour recevoir du lecteur 14 ses coordonnées géographiques,  means 109 for receiving geographic coordinates, arranged to receive from the reader 14 its geographical coordinates,
des moyens de comparaison 110, agencés pour comparer, lorsqu'aucune attaque logicielle de type relais n'a été détectée, les coordonnées du terminal mobile 10 avec les coordonnées géographiques du lecteur 20, une attaque matérielle étant détectée lorsque les coordonnées du terminal mobile 10 et du lecteur 20 diffèrent d'une valeur supérieure à une valeur seuil donnée.  comparison means 110, arranged to compare, when no relay-type software attack has been detected, the coordinates of the mobile terminal 10 with the geographical coordinates of the reader 20, a hardware attack being detected when the coordinates of the mobile terminal 10 and the reader 20 differ by a value greater than a given threshold value.
Les premiers moyens d'envoi 104, les deuxièmes moyens d'envoi 105, les premiers moyens de vérification 106, les moyens 107 de calcul et d'envoi, les deuxièmes moyens de vérification 108, les moyens 109 de réception de coordonnées géographiques et les moyens de comparaison 110 sont de préférence des modules logiciels qui comprennent des instructions de code pour faire exécuter les étapes du procédé de détection d'attaques tel que décrit précédemment. Les modules logiciels peuvent être stockés dans, ou transmis par un support de données. Celui-ci peut être un support matériel de stockage, par exemple un CD-ROM, une disquette magnétique ou un disque dur, ou bien un support de transmission, ou un réseau. The first sending means 104, the second sending means 105, the first checking means 106, the calculating and sending means 107, the second checking means 108, the geographic coordinate receiving means 109 and comparison means 110 are preferably software modules which comprise code instructions for executing the steps of the attack detection method as described previously. The software modules can be stored in, or transmitted by, a data carrier. This may be a hardware storage medium, for example a CD-ROM, a magnetic diskette or a hard disk, or a transmission medium, or a network.

Claims

REVENDICATIONS
1. Procédé de détection d'une attaque visant un terminal mobile (10), le terminal comprenant un élément de sécurité (12), un contrôleur sans contact (13) adapté pour dialoguer avec un lecteur sans contact (20) et un environnement d'exécution sécurisée (11), dans lequel : 1. A method of detecting an attack on a mobile terminal (10), the terminal comprising a security element (12), a contactless controller (13) adapted to communicate with a contactless reader (20) and a control environment. secure execution (11), wherein:
- toute commande (C-APDU) en provenance du lecteur sans contact et reçue par le contrôleur sans contact est envoyée à l'environnement d'exécution sécurisée et au module de sécurité, et  any command (C-APDU) coming from the contactless reader and received by the contactless controller is sent to the secure execution environment and the security module, and
- toute commande (C-APDU) reçue par l'élément de sécurité est envoyée à l'environnement d'exécution sécurisée,  - any command (C-APDU) received by the security element is sent to the secure execution environment,
le procédé comprenant une étape de vérification (El 4), mise en œuvre par l'environnement d'exécution sécurisée, au cours de laquelle il est vérifié qu'à une commande (C-APDU) reçue du contrôleur sans contact correspond une même commande (C-APDU) reçue de l'élément de sécurité, dans le cas contraire une attaque logicielle de type relais est détectée.  the method comprising a verification step (El 4), implemented by the secure execution environment, during which it is verified that a command (C-APDU) received from the contactless controller corresponds to the same command (C-APDU) received from the security element, otherwise a relay type software attack is detected.
2. Procédé selon la revendication 1, dans lequel l'élément de sécurité (12) et l'environnement d'exécution sécurisée (11) partagent la connaissance d'une clé secrète (K), le procédé comprenant en outre les étapes suivantes : The method of claim 1, wherein the security element (12) and the secure execution environment (11) share knowledge of a secret key (K), the method further comprising the steps of:
- calcul (E5) par l'élément de sécurité d'une première valeur de contrôle (a), fonction de la commande reçue du contrôleur sans contact et de la clé secrète, et envoi de ladite première valeur de contrôle à l'environnement d'exécution sécurisée (11),  calculation (E5) by the security element of a first control value (a), a function of the command received from the contactless controller and the secret key, and sending of said first control value to the environment of secure execution (11),
- vérification (El 2) par l'environnement d'exécution sécurisée de la cohérence entre la première valeur de contrôle et la commande reçue de l'élément de sécurité, une attaque logicielle de type relais étant détectée en cas d'incohérence.  - Verification (El 2) by the secure execution environment of the consistency between the first control value and the command received from the security element, a relay-type software attack being detected in case of inconsistency.
3. Procédé selon la revendication 1, dans lequel l'élément de sécurité (12) et l'environnement d'exécution sécurisée (11) partagent la connaissance d'une clé secrète (K), le procédé comprenant en outre les étapes suivantes : The method of claim 1, wherein the security element (12) and the secure execution environment (11) share the knowledge of a secret key (K), the method further comprising the steps of:
- réception (E7) par l'environnement d'exécution sécurisée, en provenance de l'élément de sécurité de la réponse (R-APDU),  - reception (E7) by the secure execution environment, from the security element of the response (R-APDU),
- réception (El i) par l'environnement d'exécution sécurisée, en provenance du contrôleur sans contact de la réponse à la commande reçue de l'élément de sécurité par le contrôleur, - calcul (E5) par l'élément de sécurité d'une première valeur de contrôle (a), fonction de la réponse reçue du contrôleur sans contact et de la clé secrète et envoi de ladite première valeur de contrôle à l'environnement d'exécution sécurisée (11), receiving (El i) by the secure execution environment, from the contactless controller of the response to the command received from the security element by the controller, calculation (E5) by the security element of a first control value (a), a function of the response received from the contactless controller and the secret key and sending of said first control value to the environment of secure execution (11),
- vérification (El 2) par l'environnement d'exécution sécurisée de la cohérence entre la première valeur de contrôle et la réponse reçue de l'élément de sécurité, une attaque logicielle de type relais étant détectée en cas d'incohérence.  - Verification (El 2) by the secure execution environment of the consistency between the first control value and the response received from the security element, a relay-type software attack being detected in the event of inconsistency.
4. Procédé selon la revendication 1 ou la revendication 2, dans lequel le calcul de la première valeur de contrôle par l'élément de sécurité est également fonction d'une réponse (R- APDU) à ladite commande déterminée par l'élément de sécurité et que le procédé comprend les étapes suivantes : The method according to claim 1 or claim 2, wherein the calculation of the first control value by the security element is also a function of a response (R-APDU) to said command determined by the security element. and that the method comprises the following steps:
- réception (E7) par l'environnement d'exécution sécurisée, en provenance de l'élément de sécurité de la réponse (R-APDU),  - reception (E7) by the secure execution environment, from the security element of the response (R-APDU),
- réception (El i) par l'environnement d'exécution sécurisée, en provenance du contrôleur sans contact de la réponse à la commande reçue de l'élément de sécurité par le contrôleur,  receiving (El i) by the secure execution environment, from the contactless controller of the response to the command received from the security element by the controller,
- vérification (El 2) de la cohérence entre la première valeur de contrôle et les commande et réponse reçues de l'élément de sécurité,  checking (El 2) of the coherence between the first control value and the commands and responses received from the security element,
- si la vérification est positive, comparaison (El 4) de la réponse reçue de l'élément de sécurité avec la réponse reçus du contrôleur sans contact, une attaque logicielle de type relais étant détectée si la vérification est négative ou si la comparaison est négative.  if the verification is positive, comparison (El 4) of the response received from the security element with the response received from the contactless controller, a relay-type software attack being detected if the verification is negative or if the comparison is negative .
5. Procédé selon l'une des revendications précédentes, comprenant, lorsqu'aucune attaque logicielle de type relais n'a été détectée : 5. Method according to one of the preceding claims, comprising, when no relay type software attack has been detected:
- une étape d'obtention (E20) par l'environnement d'exécution sécurisée auprès d'un module (16) de localisation du terminal, de coordonnées de localisation géographique du terminal mobile,  a step of obtaining (E20) by the secure execution environment from a terminal location module (16), geographic location coordinates of the mobile terminal,
- une étape de comparaison (E21) desdites coordonnées de localisation géographique du terminal avec des coordonnées de localisation géographique du lecteur, une attaque matérielle de type relais étant détectée lorsque les coordonnées du terminal et du lecteur diffèrent d'une valeur supérieure à une valeur seuil donnée.  a comparison step (E21) of said geographical location coordinates of the terminal with geographical location coordinates of the reader, a relay type hardware attack being detected when the coordinates of the terminal and the reader differ from a value greater than a threshold value; given.
6. Terminal mobile (10) comprenant un élément de sécurité (12), un contrôleur sans contact (13) adapté pour dialoguer avec un lecteur sans contact, et un environnement d'exécution sécurisée (11), et : - des premiers moyens d'envoi (104), agencés pour envoyer toute commande (C- APDU) en provenance du lecteur sans contact et reçue par le contrôleur sans contact à l'environnement d'exécution sécurisée et au module de sécurité, A mobile terminal (10) comprising a security element (12), a contactless controller (13) adapted to communicate with a contactless reader, and a secure execution environment (11), and: first sending means (104), arranged to send any command (C-APDU) from the contactless reader and received by the contactless controller to the secure execution environment and the security module,
- des deuxièmes moyens d'envoi (105), agencés pour envoyer toute commande (C- APDU) reçue par l'élément de sécurité à l'environnement d'exécution sécurisée,  second sending means (105), arranged to send any command (C-APDU) received by the security element to the secure execution environment,
- des premiers moyens de vérification (106), agencés pour vérifier qu'à une commande reçue du contrôleur sans contact correspond la même commande reçue de l'élément de sécurité, une attaque logicielle de type relais est détectée en cas de vérification négative.  first verification means (106), arranged to verify that when a command received from the contactless controller corresponds to the same command received from the security element, a relay-type software attack is detected in the event of a negative verification.
7. Terminal mobile selon la revendication 6, dans lequel l'élément de sécurité (12) et l'environnement d'exécution sécurisée (11) partagent la connaissance d'une clé secrète (K), le terminal comprenant en outre : The mobile terminal of claim 6, wherein the security element (12) and the secure execution environment (11) share the knowledge of a secret key (K), the terminal further comprising:
- des moyens (107) de calcul et d'envoi, agencés pour que l'élément de sécurité calcule une première valeur de contrôle (a), fonction de la commande reçue du contrôleur sans contact et de la clé secrète, et pour envoyer ladite première valeur de contrôle à l'environnement d'exécution sécurisée (11),  means (107) for calculating and sending, arranged so that the security element calculates a first control value (a), a function of the command received from the contactless controller and the secret key, and to send said first control value to the secure execution environment (11),
- des deuxièmes moyens de vérification (108), agencés pour que l'environnement d'exécution sécurisée vérifie la cohérence entre la première valeur de contrôle et la commande reçue de l'élément de sécurité, une attaque logicielle de type relais étant détectée en cas d'incohérence.  second verification means (108), arranged so that the secure execution environment verifies the coherence between the first control value and the command received from the security element, a relay-type software attack being detected in case inconsistency.
8. Terminal mobile selon la revendication 6 ou la revendication 7, comprenant en outre :The mobile terminal of claim 6 or claim 7, further comprising:
- un module de géolocalisation (16), agencé pour fournir à l'environnement d'exécution sécurisée des coordonnées géographiques du terminal mobile, a geolocation module (16), arranged to provide the secure execution environment with the geographic coordinates of the mobile terminal,
- des moyens (109) de réception de coordonnées géographiques du lecteur, agencés pour recevoir des coordonnées géographiques du lecteur,  means (109) for receiving geographical coordinates of the reader, arranged to receive geographical coordinates of the reader,
- des moyens de comparaison (110), agencés pour, lorsqu'aucune attaque par relais n'a été détectée, comparer les coordonnées du terminal mobile avec les coordonnées géographiques du lecteur, une attaque matérielle étant détectée lorsque les coordonnées du terminal et du lecteur diffèrent d'une valeur supérieure à une valeur seuil donnée.  comparison means (110), arranged for, when no relay attack has been detected, comparing the coordinates of the mobile terminal with the geographical coordinates of the reader, a hardware attack being detected when the coordinates of the terminal and the reader differ from a value greater than a given threshold value.
9. Programme d'ordinateur sur un support de données et chargeable dans la mémoire d'un terminal mobile, le programme comprenant des instructions de code pour l'exécution des étapes du procédé de détection d'attaques selon l'une des revendications 1 à 5, lorsque le programme est exécuté sur ledit ordinateur. A computer program on a data carrier and loadable in the memory of a mobile terminal, the program comprising code instructions for performing the steps of the attack detection method according to one of claims 1 to 5, when the program is run on said computer.
10. Support de données dans lequel est enregistré le programme selon la revendication 10. Data carrier in which the program is recorded according to the claim
PCT/FR2015/052579 2014-09-30 2015-09-28 Method of protecting a mobile terminal against attacks WO2016051059A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
FR1459326A FR3026528A1 (en) 2014-09-30 2014-09-30 METHOD FOR PROTECTING A MOBILE TERMINAL AGAINST ATTACKS
FR1459326 2014-09-30

Publications (1)

Publication Number Publication Date
WO2016051059A1 true WO2016051059A1 (en) 2016-04-07

Family

ID=52465476

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/FR2015/052579 WO2016051059A1 (en) 2014-09-30 2015-09-28 Method of protecting a mobile terminal against attacks

Country Status (2)

Country Link
FR (1) FR3026528A1 (en)
WO (1) WO2016051059A1 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013185889A1 (en) * 2012-06-13 2013-12-19 Giesecke & Devrient Gmbh Mobile station with set operating range

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013185889A1 (en) * 2012-06-13 2013-12-19 Giesecke & Devrient Gmbh Mobile station with set operating range

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LISHOY FRANCIS ET AL: "Practical Relay Attack on Contactless Transactions by Using NFC Mobile Phones", INTERNATIONAL ASSOCIATION FOR CRYPTOLOGIC RESEARCH,, vol. 20120224:103814, 24 February 2012 (2012-02-24), pages 1 - 16, XP061005717 *
MICHAEL ROLAND: "Software Card Emulation in NFC-enabled Mobile Phones: Great Advantage or Security Nightmare?", 18 June 2012 (2012-06-18), XP055182749, Retrieved from the Internet <URL:http://www.medien.ifi.lmu.de/iwssi2012/papers/iwssi-spmu2012-roland.pdf> [retrieved on 20150414] *

Also Published As

Publication number Publication date
FR3026528A1 (en) 2016-04-01

Similar Documents

Publication Publication Date Title
EP2912594B1 (en) Method of providing a secured service
EP3221815B1 (en) Method for securing a payment token
EP2873045B1 (en) Secure electronic entity for authorizing a transaction
EP3238474B1 (en) Method for securing contactless transactions
EP3032799B1 (en) Method for authenticating a user, corresponding server, communication terminal and programs
EP2545724B1 (en) Protection of a security module in a telecommunication device coupled to a an nfc circuit
EP2545722B1 (en) Detection of the rerouting of a communication channel of a telecommunication device connected to an nfc circuit
CN103477666A (en) Connecting mobile devices, Internet-connected vehicles, and cloud services
KR102372571B1 (en) Mobile payment methods, devices and systems
EP3308564B1 (en) Procédé de chargement d&#39;une clé virtuelle et terminal utilisateur associé
WO2011110436A1 (en) Protection against rerouting in an nfc circuit communication channel
EP3189485A1 (en) Electronic ticket management
EP3238150B1 (en) Method for making contactless transactions secure
EP1851901A1 (en) Method for fast pre-authentication by distance recognition
EP3479325B1 (en) Method for authenticating payment data, corresponding devices and programs
WO2016051059A1 (en) Method of protecting a mobile terminal against attacks
EP3667530A1 (en) Secure access to encrypted data from a user terminal
FR3102322A1 (en) Communication technique between an application implementing a service and a server
EP2911365B1 (en) Method and system for protecting transactions offered by a plurality of services between a mobile device of a user and an acceptance point
EP2897095B1 (en) Method for securing a transaction conducted by bank card
EP4198792A1 (en) Nfc transaction
WO2015144635A2 (en) An activation and deactivation method for an application in a telecommunications terminal comprising a secure element and a biometric reader, and corresponding server
EP4198790A1 (en) Nfc transaction
EP4198791A1 (en) Nfc transaction
FR3025631A1 (en) SECURE SELECTION OF AN APPLICATION IN A CHIP OR EQUIVALENT CARD

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15787254

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15787254

Country of ref document: EP

Kind code of ref document: A1