SlideShare une entreprise Scribd logo
1  sur  1
Télécharger pour lire hors ligne
Verifying Implementations of Security Protocols in C
Mihhail Aizatulin (avatar@hot.ee)


   1. Goal
                              Our goal is a tool for cryptographic security analysis at implementation level:
                 Source code of a
                                                                                                                     List of all potential
                 cryptographic
                                                                           Our tools                                 security flaws or
                 protocol
                                                                                                                     proof of security
                 implementation


2. Motivation: an Attack Example                                                             3. Assumptions
 Here is an example vulnerability that we would like to prevent. In January                    We assume that cryptographic primitives (encryption, hash-
2009 a flaw in the OpenSSL library was discovered, permitting a corrupt certifi-               ing) are implemented correctly and are unbreakable.
cate to be recognised as valid. A function return value is wrongly interpreted:
  int check_certificate ( ) {                / / l a t e r in code :                         4. Background
    ...                                      ...
    if ( certificate_malformed )             if ( check_certificate ())         / / oops !     Very little has been done for crypto-verification of low-level
       r e t u r n − 1;                      {                                               languages. We rely on tools for proving security from high-level
    else if ( ! certificate_check_ok )          trust_certificate ();                        specifications of protocols. Currently we are using ProVerif.
       return 0 ;                            }
    else return 1 ; }

 Notice how the -1 return value passes the validity test! An attacker can craft              5. Challenges
a malformed certificate, pretending to be someone else:                                        We cannot simply reuse existing program verification tools,
                                                                                             because we don’t just verify a program, but a system, consisting
           paypal.com Certificate?                                                            of several instances of a program and an unknown attacker.

         Malformed Certificate
  Client                 Attacker (= Internet)                              paypal.com
                                                                                             7. Proposed Method
                                                                                              We propose to use symbolic execution to extract a high-level
Now the attacker can impersonate the client and the bank to each other:
                                                                                             model of the protocol and then use existing tools to verify it.
                                                                                             Suppose we use shared key hashing for message integrity:
                  Password?                             Password?
                                                                                                                        m, hash(m, k shared )
                  Password                         Password + “get $$$”                                              A−−−−−−−−−− B.
                                                                                                                                →
  Client                          Attacker (= Internet)               paypal.com              The client side implementation could look as follows. Note the
                                                                                             extra data added to the message: the payload length and a tag.
We would like to use formal methods to prove absence of similar flaws.
                                                                                                   c l i e n t ( char ∗ payload , i n t payload_len ) {
                                                                                                       i n t msg_len = 5 + l e n + SHA1_LEN ;
6. Symbolic Execution                                                                                  char ∗ msg = malloc ( msg_len ) ;
                                                                                                       char ∗ p = msg ;
 Symbolic execution is a tool to simplify programs and extract their meaning.                          ∗p = l e n ; p += 4 ;            / / add l e n g t h
The program is “executed” with symbols as input, instead of numbers:                                   ∗ ( p++) = 1 ;                   / / add t h e t a g
                                                                                                       memcpy( payload , p , l e n ) ; / / add t h e p a y l o a d
                     Concrete:                          Symbolic:
                                                                                                       sha1 ( msg , 5 + len , p ) ;     / / add t h e h a s h
                x = 2          y = 3               x = a           y = b                               send ( msg , msg_len ) ;         / / send
                                                                                                   }

             int f ( int x , int y ) {          int f ( int x , int y ) {                     Using symbolic execution we can summarise the effect of the
               r e t u r n ++x ∗ y + + ; }        r e t u r n ++x ∗ y + + ; }
                                                                                             function:
                                                                                                                              Symbolic Execution
                          9                               ( a + 1) b
                                                                                                           out(len(payload)|01|payload
 We use symbolic execution to derive the formats of messages that the program
                                                                                                               |sha1(len(payload)|01|payload, kshared ))
generates.
                                                                                              Here “|” stands for bitstring concatenation. High-level verifi-
8. Current Status                                                                            cation tools can’t deal with it directly, so we perform some extra
                                                                                             analysis to prove that concatenation patterns can be abstracted
 Done:                                                                                       as pure symbolic functions:
   • Implemented symbolic execution for fixed bitstring lengths and linear con-                                                           Format Abstraction
     trol flow.
   • Proved correctness of format abstraction.                                                               out(f 1(payload, hash1(payload, kshared )))
 To do:
                                                                                              This is a representation that ProVerif can easily deal with:
   • Implement symbolic execution for variable bitstring lengths.
                                                                                                                                         ProVerif (+ Server Side)
   • Implement format abstraction.
   • Add support for arbitrary control flow.                                                                            Integrity verified.


9. Project
  The project is supervised by Andrew Gordon (Microsoft Research), Jan Jürjens (Dortmund University) and Bashar Nuseibeh (Open University). It
is partially supported through the Microsoft Research PhD Scholarship programme.

Contenu connexe

Tendances

Latest C Interview Questions and Answers
Latest C Interview Questions and AnswersLatest C Interview Questions and Answers
Latest C Interview Questions and Answers
DaisyWatson5
 
SecurePtrs: Proving Secure Compilation with Data-Flow Back-Translation and Tu...
SecurePtrs: Proving Secure Compilation with Data-Flow Back-Translation and Tu...SecurePtrs: Proving Secure Compilation with Data-Flow Back-Translation and Tu...
SecurePtrs: Proving Secure Compilation with Data-Flow Back-Translation and Tu...
Akram El-Korashy
 
Listen and look at your PHP code
Listen and look at your PHP codeListen and look at your PHP code
Listen and look at your PHP code
Gabriele Santini
 

Tendances (20)

Embedded device hacking Session i
Embedded device hacking Session iEmbedded device hacking Session i
Embedded device hacking Session i
 
661 665
661 665661 665
661 665
 
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
 
Ch34508510
Ch34508510Ch34508510
Ch34508510
 
Latest C Interview Questions and Answers
Latest C Interview Questions and AnswersLatest C Interview Questions and Answers
Latest C Interview Questions and Answers
 
Network Security
Network SecurityNetwork Security
Network Security
 
SecurePtrs: Proving Secure Compilation with Data-Flow Back-Translation and Tu...
SecurePtrs: Proving Secure Compilation with Data-Flow Back-Translation and Tu...SecurePtrs: Proving Secure Compilation with Data-Flow Back-Translation and Tu...
SecurePtrs: Proving Secure Compilation with Data-Flow Back-Translation and Tu...
 
ENKI: Access Control for Encrypted Query Processing
ENKI: Access Control for Encrypted Query ProcessingENKI: Access Control for Encrypted Query Processing
ENKI: Access Control for Encrypted Query Processing
 
Cryptography Workbook
Cryptography WorkbookCryptography Workbook
Cryptography Workbook
 
rsa-1
rsa-1rsa-1
rsa-1
 
Listen and look at your PHP code
Listen and look at your PHP codeListen and look at your PHP code
Listen and look at your PHP code
 
Iss lecture 2
Iss lecture 2Iss lecture 2
Iss lecture 2
 
Realizing Fine-Grained and Flexible Access Control to Outsourced Data with At...
Realizing Fine-Grained and Flexible Access Control to Outsourced Data with At...Realizing Fine-Grained and Flexible Access Control to Outsourced Data with At...
Realizing Fine-Grained and Flexible Access Control to Outsourced Data with At...
 
Java - Concurrent programming - Thread's advanced concepts
Java - Concurrent programming - Thread's advanced conceptsJava - Concurrent programming - Thread's advanced concepts
Java - Concurrent programming - Thread's advanced concepts
 
OpenMI Developers Training
OpenMI Developers TrainingOpenMI Developers Training
OpenMI Developers Training
 
OpenMI Developers Training
OpenMI Developers TrainingOpenMI Developers Training
OpenMI Developers Training
 
Rfid
Rfid Rfid
Rfid
 
Unit 3(1)
Unit 3(1)Unit 3(1)
Unit 3(1)
 
VHDL Part 4
VHDL Part 4VHDL Part 4
VHDL Part 4
 
Unit 3(1)
Unit 3(1)Unit 3(1)
Unit 3(1)
 

En vedette

Mouawad
MouawadMouawad
Mouawad
anesah
 
Dupressoir
DupressoirDupressoir
Dupressoir
anesah
 
Abraham
AbrahamAbraham
Abraham
anesah
 
Aizatulin
AizatulinAizatulin
Aizatulin
anesah
 

En vedette (12)

Mouawad
MouawadMouawad
Mouawad
 
Pantidi
PantidiPantidi
Pantidi
 
Wilkie
WilkieWilkie
Wilkie
 
Dupressoir
DupressoirDupressoir
Dupressoir
 
Abraham
AbrahamAbraham
Abraham
 
Aizatulin
AizatulinAizatulin
Aizatulin
 
Session3
Session3Session3
Session3
 
Formal analysis-crypto-proto
Formal analysis-crypto-protoFormal analysis-crypto-proto
Formal analysis-crypto-proto
 
Oops index
Oops indexOops index
Oops index
 
Teaching Students with Emojis, Emoticons, & Textspeak
Teaching Students with Emojis, Emoticons, & TextspeakTeaching Students with Emojis, Emoticons, & Textspeak
Teaching Students with Emojis, Emoticons, & Textspeak
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 

Similaire à Aizatulin poster

Pascal script maxbox_ekon_14_2
Pascal script maxbox_ekon_14_2Pascal script maxbox_ekon_14_2
Pascal script maxbox_ekon_14_2
Max Kleiner
 
Cypherock Assessment (1).pdf
Cypherock Assessment (1).pdfCypherock Assessment (1).pdf
Cypherock Assessment (1).pdf
PARNIKA GUPTA
 
FORECAST: Fast Generation of Accurate Context-Aware Signatures of Control-Hij...
FORECAST: Fast Generation of Accurate Context-Aware Signatures of Control-Hij...FORECAST: Fast Generation of Accurate Context-Aware Signatures of Control-Hij...
FORECAST: Fast Generation of Accurate Context-Aware Signatures of Control-Hij...
Alexey Smirnov
 
Eight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programsEight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programs
Aleksandr Yampolskiy
 
DIRA: Automatic Detection, Identification, and Repair of Controll-Hijacking a...
DIRA: Automatic Detection, Identification, and Repair of Controll-Hijacking a...DIRA: Automatic Detection, Identification, and Repair of Controll-Hijacking a...
DIRA: Automatic Detection, Identification, and Repair of Controll-Hijacking a...
Alexey Smirnov
 

Similaire à Aizatulin poster (20)

SRAVANByCPP
SRAVANByCPPSRAVANByCPP
SRAVANByCPP
 
Chapter 15 - Security
Chapter 15 - SecurityChapter 15 - Security
Chapter 15 - Security
 
Pascal script maxbox_ekon_14_2
Pascal script maxbox_ekon_14_2Pascal script maxbox_ekon_14_2
Pascal script maxbox_ekon_14_2
 
Symbolic Execution (introduction and hands-on)
Symbolic Execution (introduction and hands-on)Symbolic Execution (introduction and hands-on)
Symbolic Execution (introduction and hands-on)
 
Ransomware for fun and non-profit
Ransomware for fun and non-profitRansomware for fun and non-profit
Ransomware for fun and non-profit
 
Cypherock Assessment (1).pdf
Cypherock Assessment (1).pdfCypherock Assessment (1).pdf
Cypherock Assessment (1).pdf
 
C sharp chap6
C sharp chap6C sharp chap6
C sharp chap6
 
Real-World WebAppSec Flaws - Examples and Countermeasues
Real-World WebAppSec Flaws - Examples and CountermeasuesReal-World WebAppSec Flaws - Examples and Countermeasues
Real-World WebAppSec Flaws - Examples and Countermeasues
 
Notes on c++
Notes on c++Notes on c++
Notes on c++
 
FORECAST: Fast Generation of Accurate Context-Aware Signatures of Control-Hij...
FORECAST: Fast Generation of Accurate Context-Aware Signatures of Control-Hij...FORECAST: Fast Generation of Accurate Context-Aware Signatures of Control-Hij...
FORECAST: Fast Generation of Accurate Context-Aware Signatures of Control-Hij...
 
iPhone Seminar Part 2
iPhone Seminar Part 2iPhone Seminar Part 2
iPhone Seminar Part 2
 
Eight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programsEight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programs
 
DIRA: Automatic Detection, Identification, and Repair of Controll-Hijacking a...
DIRA: Automatic Detection, Identification, and Repair of Controll-Hijacking a...DIRA: Automatic Detection, Identification, and Repair of Controll-Hijacking a...
DIRA: Automatic Detection, Identification, and Repair of Controll-Hijacking a...
 
Encryption/Decryption Algorithm for Devanagri Script(Affine Cipher)
Encryption/Decryption Algorithm for Devanagri Script(Affine Cipher)Encryption/Decryption Algorithm for Devanagri Script(Affine Cipher)
Encryption/Decryption Algorithm for Devanagri Script(Affine Cipher)
 
Lattice based Merkle for post-quantum epoch
Lattice based Merkle for post-quantum epochLattice based Merkle for post-quantum epoch
Lattice based Merkle for post-quantum epoch
 
EEE 3rd year oops cat 3 ans
EEE 3rd year  oops cat 3  ansEEE 3rd year  oops cat 3  ans
EEE 3rd year oops cat 3 ans
 
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...
 
MPI
MPIMPI
MPI
 
venkatesh.pptx
venkatesh.pptxvenkatesh.pptx
venkatesh.pptx
 
C tutorial
C tutorialC tutorial
C tutorial
 

Plus de anesah (20)

Van der merwe
Van der merweVan der merwe
Van der merwe
 
Thomas
ThomasThomas
Thomas
 
Taubenberger
TaubenbergerTaubenberger
Taubenberger
 
Sach
SachSach
Sach
 
Rae
RaeRae
Rae
 
Pantidi
PantidiPantidi
Pantidi
 
Corneli
CorneliCorneli
Corneli
 
Collins
CollinsCollins
Collins
 
Xambo
XamboXambo
Xambo
 
Ullmann
UllmannUllmann
Ullmann
 
Tran
TranTran
Tran
 
Quinto
QuintoQuinto
Quinto
 
Pluss
PlussPluss
Pluss
 
Pawlik
PawlikPawlik
Pawlik
 
Overbeeke
OverbeekeOverbeeke
Overbeeke
 
Nguyen
NguyenNguyen
Nguyen
 
Murphy
MurphyMurphy
Murphy
 
Moyo
MoyoMoyo
Moyo
 
Montrieux
MontrieuxMontrieux
Montrieux
 
Ma
MaMa
Ma
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Aizatulin poster

  • 1. Verifying Implementations of Security Protocols in C Mihhail Aizatulin (avatar@hot.ee) 1. Goal Our goal is a tool for cryptographic security analysis at implementation level: Source code of a List of all potential cryptographic Our tools security flaws or protocol proof of security implementation 2. Motivation: an Attack Example 3. Assumptions Here is an example vulnerability that we would like to prevent. In January We assume that cryptographic primitives (encryption, hash- 2009 a flaw in the OpenSSL library was discovered, permitting a corrupt certifi- ing) are implemented correctly and are unbreakable. cate to be recognised as valid. A function return value is wrongly interpreted: int check_certificate ( ) { / / l a t e r in code : 4. Background ... ... if ( certificate_malformed ) if ( check_certificate ()) / / oops ! Very little has been done for crypto-verification of low-level r e t u r n − 1; { languages. We rely on tools for proving security from high-level else if ( ! certificate_check_ok ) trust_certificate (); specifications of protocols. Currently we are using ProVerif. return 0 ; } else return 1 ; } Notice how the -1 return value passes the validity test! An attacker can craft 5. Challenges a malformed certificate, pretending to be someone else: We cannot simply reuse existing program verification tools, because we don’t just verify a program, but a system, consisting paypal.com Certificate? of several instances of a program and an unknown attacker. Malformed Certificate Client Attacker (= Internet) paypal.com 7. Proposed Method We propose to use symbolic execution to extract a high-level Now the attacker can impersonate the client and the bank to each other: model of the protocol and then use existing tools to verify it. Suppose we use shared key hashing for message integrity: Password? Password? m, hash(m, k shared ) Password Password + “get $$$” A−−−−−−−−−− B. → Client Attacker (= Internet) paypal.com The client side implementation could look as follows. Note the extra data added to the message: the payload length and a tag. We would like to use formal methods to prove absence of similar flaws. c l i e n t ( char ∗ payload , i n t payload_len ) { i n t msg_len = 5 + l e n + SHA1_LEN ; 6. Symbolic Execution char ∗ msg = malloc ( msg_len ) ; char ∗ p = msg ; Symbolic execution is a tool to simplify programs and extract their meaning. ∗p = l e n ; p += 4 ; / / add l e n g t h The program is “executed” with symbols as input, instead of numbers: ∗ ( p++) = 1 ; / / add t h e t a g memcpy( payload , p , l e n ) ; / / add t h e p a y l o a d Concrete: Symbolic: sha1 ( msg , 5 + len , p ) ; / / add t h e h a s h x = 2 y = 3 x = a y = b send ( msg , msg_len ) ; / / send } int f ( int x , int y ) { int f ( int x , int y ) { Using symbolic execution we can summarise the effect of the r e t u r n ++x ∗ y + + ; } r e t u r n ++x ∗ y + + ; } function: Symbolic Execution 9 ( a + 1) b out(len(payload)|01|payload We use symbolic execution to derive the formats of messages that the program |sha1(len(payload)|01|payload, kshared )) generates. Here “|” stands for bitstring concatenation. High-level verifi- 8. Current Status cation tools can’t deal with it directly, so we perform some extra analysis to prove that concatenation patterns can be abstracted Done: as pure symbolic functions: • Implemented symbolic execution for fixed bitstring lengths and linear con- Format Abstraction trol flow. • Proved correctness of format abstraction. out(f 1(payload, hash1(payload, kshared ))) To do: This is a representation that ProVerif can easily deal with: • Implement symbolic execution for variable bitstring lengths. ProVerif (+ Server Side) • Implement format abstraction. • Add support for arbitrary control flow. Integrity verified. 9. Project The project is supervised by Andrew Gordon (Microsoft Research), Jan Jürjens (Dortmund University) and Bashar Nuseibeh (Open University). It is partially supported through the Microsoft Research PhD Scholarship programme.