Perturbation attack on modern CPUs, from the fault model to the exploitation Thomas TROUCHKINE 1 , Guillaume BOUFFARD 1,2 , Jessy CLÉDIÈRE 3 1 National Cybersecurity Agency of France (ANSSI) 2 Information Security Group, École Normale Supérieure 3 CEA, LETI, MINATEC September, 24 th 2020
My thesis Evaluation of hardware attacks against System-On-Chip Jessy Clédière (Director) Guillaume Bouffard (Supervisor) Focus on the perturbation of modern CPUs September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 1 / 19
Modern CPU ? Exynos 9820 SoC (Samsung) September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 2 / 19
Modern CPU ? Exynos 9820 SoC (Samsung) Exynos M4 core September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 2 / 19
Targets BCM2837 Intel Core i3-6100T BMC2711b0 (Raspberry Pi 3 model B) (Custom motherboard) (Raspberry Pi 4) Linux based OS (Raspbian Buster/Debian 9) September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 3 / 19
Fault injection mediums Device EMFI LFI BCM2837 (RPi3) X � Intel Core i3 � X � BCM2711b0 (RPi4) � September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 4 / 19
Characterization method Tested program Initial values trigger_up() ; Register Value orr r5, r5 ; r0 0xfffe0001 ... # several times r1 0xfffd0002 orr r5, r5 ; r2 0xfffb0004 trigger_down() ; r3 0xfff70008 Analysis paths r4 0xffef0010 Faulted program r5 0xffdf0020 r6 0xffbf0040 Faulted data Faulted instruction r7 0xff7f0080 r8 0xfeff0100 Registers Pipeline Memory r9 0xfdff0200 Decode Execute Fetch Bus Cache MMU September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 5 / 19
Characterization (BCM2837) 14 Fault models 13 4 12 Register corruption Number of faults per positions 11 10 Bit reset 3 9 Y position (mm) Instruction dependent value 8 7 2 Instruction corruption 6 5 Operands corruption 1 4 Opcode corruption 3 2 0 1 0 Hypothesis 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 X position (mm) Fault targets cache Positions of the probe over the chip leading to faults. September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 6 / 19
Characterization (Intel Core i3) 28 Fault models 26 24 Register corruption Number of faults per positions 22 1 Bit reset 20 18 System values Position (mm) 16 14 Instruction corruption 12 10 Operands corruption 8 0 Opcode corruption 6 4 2 0 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 Hypothesis Position (mm) Positions of the probe over the die Fault targets cache leading to faults. September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 7 / 19
Characterization (Intel Core i3) 28 Fault models 26 5 Register corruption 24 Number of reboots per positions 22 4 Bit reset 20 18 System values Position (mm) 3 16 14 Instruction corruption 12 2 10 Operands corruption 8 1 Opcode corruption 6 4 0 2 0 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 Hypothesis Position (mm) Positions of the probe over the die Fault targets cache leading to reboots. September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 7 / 19
Characterization (BCM2711b0) Fault models 6 Register corruption 5 Number of faults per position 1 Bit set 4 Bit reset Y position (mm) 3 Instruction corruption Operands corruption 2 0 Opcode corruption 1 0 0 1 2 3 4 5 6 7 Not an hypothesis X position (mm) Positions of the laser spot over the We mainly target the cache die leading to faults. September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 8 / 19
Fault model exploitability Secrets Component Fault model Attack path Exploitation Source/Binary Injection medium Characterization Analysis Exploitation September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 9 / 19
Exploitation DFA on AES Forced authentication (BCM2837) (On going) target MixColumns 9 th round target password verification entry functions from PAM library 1 useful cipher every 294 use-case with sudo program injection (0.34%) 2 library dynamic loads and 12 1 useful cipher every 10 functions involved in total minutes 2 to 8 ciphers needed for the attack Up to 3 hours of fault injections September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 10 / 19
Exploitation - OpenSSL AES Fault probability regarding the delay of injection 5 Fault Probability (%) 4 3 2 1 2 2 . 5 3 3 . 5 4 4 . 5 5 5 . 5 6 Delays (s) · 10 − 7 September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 11 / 19
Exploitation - OpenSSL AES Number of faulted ciphers with a specific number of faulted diagonals regarding the delay of injection Number of faulted diagonals: 0 Number of faulted ciphers 15 1 2 3 10 4 5 0 2 2 . 5 3 3 . 5 4 4 . 5 5 5 . 5 6 Delay (s) · 10 − 7 September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 12 / 19
Exploitation - OpenSSL AES Number of faulted ciphers with a specific number of faulted diagonals regarding the delay of injection Number of faulted diagonals: 0 Number of faulted ciphers 15 1 2 3 10 4 5 0 2 2 . 5 3 3 . 5 4 4 . 5 5 5 . 5 6 Delay (s) · 10 − 7 September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 13 / 19
Exploitation - Forced authentication Default sudo behavior sudo sudoers.so dynamically load sudoers_policy_check() sudoers_policy_main() check_user() check_user_interactive() verify_user() sudo_pam_verify() depends on pam_unix.so libpam.so dynamically load _unix_verify_password() pam_authenticate() verify_pwd_hash() _pam_dispatch() _pam_dispatch_aux() pam_sm_authenticate() September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 14 / 19
Exploitation - Forced authentication sudo source code /* Initialize plugin... */ ok = policy_check(&policy_plugin, nargc, nargv, env_add, &command_info, &argv_out, &user_env_out); if (ok != 1) { /* Critical if comparison */ if (ok == -2) usage(1); exit(EXIT_FAILURE); } /* Execute command as root... */ September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 15 / 19
Exploitation - Forced authentication Traces acquired on BCM2711b0 (Laser Fault Injection) hash comparison based on strncmp() function September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 16 / 19
Exploitation - Forced authentication Target program execution flow Send signal Wait trigger Wait response Bench Perturb Wait signal Send (dummy) password Wait response Send response Thread 1 Wait password Verify password Send response Thread 2 sudo ‘command’ September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 17 / 19
Exploitation - Forced authentication Target program execution flow Send signal Wait trigger Wait response Bench Perturb Wait signal Send (dummy) password Wait response Send response Thread 1 Wait password Verify password Send response Thread 2 sudo ‘command’ September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 17 / 19
Exploitation - Forced authentication Target program execution flow Send signal Wait trigger Wait response Bench Perturb Wait signal Send (dummy) password Wait response Send response Thread 1 Wait password Verify password Send response Thread 2 sudo ‘command’ September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 17 / 19
Exploitation - Forced authentication Target program execution flow Send signal Wait trigger Wait response Bench Perturb Wait signal Send (dummy) password Wait response Send response Thread 1 Wait password Verify password Send response Thread 2 sudo ‘command’ September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 17 / 19
Exploitation - Forced authentication Target program execution flow Send signal Wait trigger Wait response Bench Perturb Wait signal Send (dummy) password Wait response Send response Thread 1 Thread 2 Wait password Verify password Send response sudo ‘command’ September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 17 / 19
Conclusion Classical fault injection mediums (EMFI, Laser) are: efficient on modern CPUs characterizable and understandable Modern CPUs have shown sensitive to faults elements, in particular the cache memory Modern CPUs asynchronous behavior and high frequencies does not protect against timing precision demanding attacks like DFA September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 18 / 19
Future works Achieve a forced authentication on the targets Link side-channel activity with chip activity Realize tests on in production chips (embedded in smartphones for instance) Determine how the cache is faulted and design an adapted countermeasure September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 19 / 19
Questions?
September, 24th 2020 Perturbation on CPUs Thomas TROUCHKINE (ANSSI) 19 / 19
Recommend
More recommend