Lazart: a symbolic approach for evaluating the robustness of secured - - PowerPoint PPT Presentation

lazart a symbolic approach for evaluating the robustness
SMART_READER_LITE
LIVE PREVIEW

Lazart: a symbolic approach for evaluating the robustness of secured - - PowerPoint PPT Presentation

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections M. L. Potet L. Mounier M. Puys L. Dureuil VERIMAG University of Grenoble Alpes, France SDTA 2014 First presented in ICST 2014


slide-1
SLIDE 1

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections

  • M. L. Potet
  • L. Mounier
  • M. Puys
  • L. Dureuil

VERIMAG University of Grenoble Alpes, France

SDTA 2014 First presented in ICST 2014

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 1/19

slide-2
SLIDE 2

Outline

1 Context and Motivation 2 The Lazart Approach 3 A quick example 4 Conclusion and perspectives

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 2/19

slide-3
SLIDE 3

Context: smart card certification

Smart cards Pervasive : bank, health, phones, . . . (7 billions sold in 2012) Contain sensible data and applications ⇒ can be attacked! Smart card security Protections mechanisms added by manufacturers Well-defined certification process, prior to commercialization:

Security functional test Penetration test

Certification procedures include Physical testing on the device (black box) Code review and/or code analysis (white box)

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 3/19

slide-4
SLIDE 4

Effects of fault injection at the source level

1 int verify(char buffer [4]) 2 { 3 int i; 4 for(i = 0; i < 4; i++) 5 if(buffer[i] != pin[i]) { 6 authenticated = 0; 7 goto FAILURE; 8 } 9 authenticated = 1; 10 return EXIT_SUCCESS; 11 FAILURE : return EXIT_FAILURE; 12 } 1 MOV R3 , #01h 2 MOV R0 , #00h 3 WHILE: MOV A, R0 4 SUBB A, #04h 5 JZ END // exit loop 6 DO: 7 MOV R2 , [buffer+i] 8 MOV A, [pin+i] 9 SUBB A, R2 10 JZ SUCCESS 11 MOV R3 , #00h 12 JMP END 13 14 SUCCESS: INC R0 15 JMP WHILE 16 17 END: MOV authenticated , R3 18 RET

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 4/19

slide-5
SLIDE 5

Security Property and Fault Model

Security Property ֒ → Enforce or prevent the execution of specific instruction(s). ⇒ Attack Objective = set of basic blocks (not) to be reached Objectives of the analysis: Predict (or prove the absence of) possible attacks, for a given fault model Locate the“dangerous spots”in the code Evaluate the relevance of existing counter-measures Fault Model - Multiple faults Volatile control structure test inversion (e.g., if, while, etc.) ֒ → Encompass multiple binary-level attacks, e.g., NOP injection, modify flag or register value, . . .

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 5/19

slide-6
SLIDE 6

Outline

1 Context and Motivation 2 The Lazart Approach 3 A quick example 4 Conclusion and perspectives

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 6/19

slide-7
SLIDE 7

The complete tool chain

CFG coloring inconclusive attack paths robustness "proof" appli.ll attack objectives mutation strategy mutant generation appli.ll mutant.ll symbolic test case generation Java tool LLVM framework KLEE

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 7/19

slide-8
SLIDE 8

Step 1: CFG-coloring

(a) cfg for 'Verify' function entry: T F FAILURE: bb: bb6: bb4: T F bb1: T F bb5: bb2: bb3: return: (b) Colored cfg for bb5 to be reached entry: T F FAILURE: bb: bb6: bb4: T F bb1: T F bb5: bb2: bb3: return:

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 8/19

slide-9
SLIDE 9

Step 2: Mutation operators

Example: mandatory mutation operator

(a) A mutation scheme bb: T F bb2: bb1: (b) Our mandatory mutation bb: T F bbTI: bb1:

More complex mutation operators Using only mandatory mutations guarantees adversary to reach the objective. More mutation operators describing optional faults the adversary can use to optimize his attack path. Guarded by boolean values named activ_i.

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 9/19

slide-10
SLIDE 10

Step 3: Symbolic execution

֒ → Produce“all possible”mutant executions . . . Symbolic values Attack activation guards activ_i. Security-relevant external inputs (e.g., PIN input values). Assertions Inputs constraints (e.g., the entered PIN is incorrect). Maximal fault number (e.g., fault <= 2). Coverage criteria (Try to) exercise each symbolic execution path. (Try to) satisfy/violate each assertion.

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 10/19

slide-11
SLIDE 11

Step 4: Results gathering

Tool-chain Use of LLVM-Klee and STP solver. Produces trace execution files for: “Correct”test cases. Assertion violations, execution errors. Timeout occurrences (to many paths or untractable constraint). Robustness verdicts (for a given fault number) ATK ∃ an execution path satisfying the assertions. INC timeout detection and no attack produced. ROB no timeout and no attack . . .

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 11/19

slide-12
SLIDE 12

Outline

1 Context and Motivation 2 The Lazart Approach 3 A quick example 4 Conclusion and perspectives

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 12/19

slide-13
SLIDE 13

On an example: VerifyPIN

1 int verify(char buffer [4]) { 2 int i; 3 for(i = 0; i < 4; i++) { 4 if(buffer[i] != pin[i]) { 5 authenticated = 0; 6 goto FAILURE; 7 } 8 } 9 authenticated = 1; 10 return EXIT_SUCCESS; 11 FAILURE: 12 return EXIT_FAILURE; 13 }

(b) Colored cfg for bb5 to be reached entry: T F FAILURE: bb: bb6: bb4: T F bb1: T F bb5: bb2: bb3: return:

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 13/19

slide-14
SLIDE 14

Results obtained for the VerifyPIN example

Number of test execution produced: # fault injections no input constraints input PIN is incorrect fault ==0 1 fault ==1 x 1 fault ==2 x 1 fault >= 3 x 3 A 1-fault attack scenario Circumvent the whole loop (PIN verification) execution Optional mutation on bb4 A 4-faults attack scenario Change the result (inside the loop) when checking each PIN digit Mandatory mutation on bb1: force the flow to bb3

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 14/19

slide-15
SLIDE 15

A PIN Verify procedure with countermeasures (CM)

1 char triesLeft = maxTries; 2 char triesLeftBackup = -maxTries; // triesleft BACKUP 3 BYTE Verify(char buffer [4]) { 4 int i; 5 int stepCounter = INITIAL_VALUE ; // instruction counter 6 short char t1 = triesLeft; 7 if(t1 != -triesLeftBackup ) goto CM ; // check with triesleft BACKUP 8 if(triesLeft <= 0) return EXIT_FAILURE ; 9 t1 --; triesLeft = t1; triesLeftBackup ++; 10 if(triesLeft != -triesLeftBackup ) goto CM ; 11 equal = BOOL_TRUE; 12 for(i = 0; i < 4; i++) 13 {equal=equal &(( buffer[i]!= pin[i])?BOOL_FALSE : BOOL_TRUE); 14 stepCounter ++; }; 15 if(equal == BOOL_TRUE) { 16 if(equal != BOOL_TRUE) goto CM ; // redundant test 17 triesLeft = maxTries; triesLeftBackup = -maxTries; 18 if (triesLeft != -triesLeftBackup ) goto CM ; 19 authenticated = 1; 20 if( stepCounter == INITIAL_VALUE + 4) // check instruction counter 21 return EXIT_SUCCESS ; } // TO BE REACHED 22 else { 23 authenticated = 0; 24 if( stepCounter == INITIAL_VALUE + 4) // check instruction counter 25 return EXIT_FAILURE ; } 26 }

(a) Colored CFG for bb12 to be reached entry: T F CM: bb: T F bb17: bb1: bb2: T F bb3: return: bb8: T F bb4: T F bb9: T F bb5: bb6: bb7: bb10: T F bb15: T F bb11: T F bb16: bb12: T F bb13: bb14:

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 15/19

slide-16
SLIDE 16

Outline

1 Context and Motivation 2 The Lazart Approach 3 A quick example 4 Conclusion and perspectives

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 16/19

slide-17
SLIDE 17

Conclusion

Current results Higher-order fault injection according to the state of the art Positive and negative diagnostic A tool suite based on robust tools (Clang, LLVM, Klee) validation on“realistic”applications (PIN verifier, random number generator, OpenSSH, . . . ) A conservative approach for extended fault models

[PMPD14] Lazart: A symbolic approach for evaluation the robustness of secured codes against control flow injections. In ICST 2014, March 2014. [RPL+14] Combining High-Level and Low-Level Approaches to Evaluate Software Implementations Robustness Against Multiple Fault Injection Attacks. In FPS 2014, November 2014.

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 17/19

slide-18
SLIDE 18

Ongoing work

Louis Dureuil’s thesis Higher-order low level fault injection simulator Based on symbolic execution and static analysis Criteria for guiding physical attacks Project Sertif (Astrid 2014) Simulation pour l’Evaluation de la RobusTesse des applications embarqu´ ees contre l’Injection de Fautes (V´ erimag, Cesti-Leti, Morpho) A global process from high-level code analysis to physical attacks Counter-measure analysis for multiple attacks An open-source benchmark associated with evaluation criteria

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 18/19

slide-19
SLIDE 19

Conclusion

Thanks for your attention! Question time ?

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 19/19

slide-20
SLIDE 20

Symbolic Execution

1 void foo(int a, int b) { 2 make_symbolic (a,b); 3 4 int c = 2*b; 5 if (a == 10) { 6 if (a >= c) { 7 print("Hello"); 8 } 9 } 10 }

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 20/19

slide-21
SLIDE 21

Optionnal mutation operator

(a) A mutation pattern bb: T F bb1: bb2:

(c) Our optional mutation bb: T F T1bb1: T F T1bb2: T F bb1: bb2: bb1: bb2: !(activbb2=1) T2bb1: activbb2=1 !(activbb1=1) T2bb2: activbb1=1

Lazart: a symbolic approach for evaluating the robustness of secured codes against control flow fault injections 21/19