SlideShare una empresa de Scribd logo
1 de 27
Descargar para leer sin conexión
Verifying Implementations
       of Security Protocols in C

             Mihhail Aizatulin1
                 supervised by
Andrew Gordon2 , Jan J¨rjens3 , Bashar Nuseibeh1
                      u
                 1 The    Open University
            2 Microsoft   Research Cambridge
                 3 Dortmund    University


         CRC PhD Student Conference
              Open University
               June 3-4, 2010

                M. Aizatulin    Verifying Implementations of Security Protocols in C
The Goal

    Source code of a                Our goal is a tool for security
    cryptographic protocol          analysis at implementation level.
    implementation




           Our tools




    List of all potential
    security flaws or proof
    of security


                         M. Aizatulin   Verifying Implementations of Security Protocols in C
The Goal

    Source code of a                Our goal is a tool for security
    cryptographic protocol          analysis at implementation level.
    implementation                  The analysis should be
                                        automated,


           Our tools




    List of all potential
    security flaws or proof
    of security


                         M. Aizatulin   Verifying Implementations of Security Protocols in C
The Goal

    Source code of a                Our goal is a tool for security
    cryptographic protocol          analysis at implementation level.
    implementation                  The analysis should be
                                        automated,
                                        sound (not miss any bugs),

           Our tools




    List of all potential
    security flaws or proof
    of security


                         M. Aizatulin   Verifying Implementations of Security Protocols in C
The Goal

    Source code of a                Our goal is a tool for security
    cryptographic protocol          analysis at implementation level.
    implementation                  The analysis should be
                                        automated,
                                        sound (not miss any bugs),
                                        scalable (aim to verify
           Our tools                    OpenSSL or Kerberos).




    List of all potential
    security flaws or proof
    of security


                         M. Aizatulin   Verifying Implementations of Security Protocols in C
The Goal

    Source code of a                Our goal is a tool for security
    cryptographic protocol          analysis at implementation level.
    implementation                  The analysis should be
                                        automated,
                                        sound (not miss any bugs),
                                        scalable (aim to verify
           Our tools                    OpenSSL or Kerberos).
                                    We assume that
                                        cryptographic primitives are
                                        implemented correctly,
    List of all potential
    security flaws or proof
    of security


                         M. Aizatulin   Verifying Implementations of Security Protocols in C
The Goal

    Source code of a                Our goal is a tool for security
    cryptographic protocol          analysis at implementation level.
    implementation                  The analysis should be
                                        automated,
                                        sound (not miss any bugs),
                                        scalable (aim to verify
           Our tools                    OpenSSL or Kerberos).
                                    We assume that
                                        cryptographic primitives are
                                        implemented correctly,
    List of all potential
    security flaws or proof              cryptography is unbreakable
    of security                         (for now).



                         M. Aizatulin   Verifying Implementations of Security Protocols in C
Motivation (I)

  OpenSSL library bug, January 2009:

    int c h e c k c e r t i f i c a t e (){
      ...
      if ( certificate malformed )
         r e t u r n −1;
      else i f (! c e r t i f i c a t e c h e c k o k )
         return 0;
      else return 1;}

   // l a t e r i n code :
   ...
   i f ( c h e c k c e r t i f i c a t e ( ) ) // o o p s !
   {
       trust certificate ();
   }



                                 M. Aizatulin   Verifying Implementations of Security Protocols in C
Motivation (II)




   An attacker can craft a malformed certificate, pretending to be
   someone else:

         paypal.com Certificate?

         Malformed Certificate
Client                    Attacker (= Internet)                                      paypal.com




                            M. Aizatulin   Verifying Implementations of Security Protocols in C
Motivation (III)




   Now the attacker can impersonate the client and the bank to each
   other:

            Password?                                    Password?

             Password                    Password + “get $$$”
Client                  Attacker (= Internet)               paypal.com




                          M. Aizatulin   Verifying Implementations of Security Protocols in C
Background




                          Machine Languages                Formal Languages
                              (C, Java)                    (π-calculus, LySa)
  low-level properties
  (NULL dereference,
  division by zero)

  high-level properties
  (secrecy, authentica-
  tion)


                          M. Aizatulin   Verifying Implementations of Security Protocols in C
Background

  There has been great progress in
      static software analysis,




                           Machine Languages                Formal Languages
                               (C, Java)                    (π-calculus, LySa)
   low-level properties       VCC        Frama-C
   (NULL dereference,             ESC/Java
   division by zero)
                                          SLAM
   high-level properties
   (secrecy, authentica-
   tion)


                           M. Aizatulin   Verifying Implementations of Security Protocols in C
Background

  There has been great progress in
      static software analysis,
      verification of protocol specifications.


                           Machine Languages                Formal Languages
                               (C, Java)                    (π-calculus, LySa)
   low-level properties       VCC        Frama-C
   (NULL dereference,             ESC/Java
   division by zero)
                                          SLAM
   high-level properties                                        ProVerif/CryptoVerif
   (secrecy, authentica-                                             AVISPA
   tion)                                                          LySatool


                           M. Aizatulin   Verifying Implementations of Security Protocols in C
Background

  There has been great progress in
      static software analysis,
      verification of protocol specifications.
  But so far very little progress in where the two meet.

                           Machine Languages                Formal Languages
                               (C, Java)                    (π-calculus, LySa)
   low-level properties       VCC        Frama-C
   (NULL dereference,             ESC/Java
   division by zero)
                                          SLAM
   high-level properties                                        ProVerif/CryptoVerif
                              CSur
   (secrecy, authentica-                                             AVISPA
                                          Our Goal
   tion)                                                          LySatool


                           M. Aizatulin   Verifying Implementations of Security Protocols in C
ProVerif
  ProVerif is a protocol verifier we would like to use. Its models are
  much more abstract than C.




                           M. Aizatulin   Verifying Implementations of Security Protocols in C
ProVerif
  ProVerif is a protocol verifier we would like to use. Its models are
  much more abstract than C.
       ProVerif
 M ::=             expression
   a, b, c            name
   x, y, z            variable
   f (M1 , . . . , Mn ) constructor




                             M. Aizatulin   Verifying Implementations of Security Protocols in C
ProVerif
  ProVerif is a protocol verifier we would like to use. Its models are
  much more abstract than C.
       ProVerif                                                C
 M ::=             expression               M, N ::=                       expression
   a, b, c            name                          0, . . . , ’a’, . . . constant
   x, y, z            variable                      M op N                     operator
   f (M1 , . . . , Mn ) constructor                 u                          lvalue
                                                    &u                         reference
                                                  u ::=                    lvalue
                                                    x, y, z                    variable
                                                     ∗u                        dereference
                                                    u.f ield                   field access
                                                    u[i]                       array access

                             M. Aizatulin   Verifying Implementations of Security Protocols in C
Symbolic Execution

  Symbolic execution is a tool to simplify programs and extract their
  meaning.

             Concrete:                                         Symbolic:
    x = 2                  y = 3                 x = a                             y = b



    i n t f ( i n t x , i n t y ){                i n t f ( i n t x , i n t y ){
        r e t u r n ++x ∗ y++;}                       r e t u r n ++x ∗ y++;}



                  9                                              (a + 1)b




                             M. Aizatulin   Verifying Implementations of Security Protocols in C
Method (I)


               m, hash(m, kshared )
             A − − − − − − → B.
                −−−−−−




               M. Aizatulin   Verifying Implementations of Security Protocols in C
Method (I)


                             m, hash(m, kshared )
                          A − − − − − − → B.
                             −−−−−−
  Client side implemented as:

      c l i e n t ( char ∗ p a y l o a d , i n t p a y l o a d l e n ) {
          i n t m s g l e n = 5 + l e n + SHA1 LEN ;
          char ∗ msg = m a l l o c ( m s g l e n ) ;
          char ∗ p = msg ;
          ∗p = l e n ; p += 4 ;                  // add l e n g t h
          ∗ ( p++) = 1 ;                         // add t h e t a g
          memcpy ( p a y l o a d , p , l e n ) ; // add t h e p a y l o a d
          s h a 1 ( msg , 5 + l e n , p ) ;      // add t h e h a s h
          s e n d ( msg , m s g l e n ) ;        // s e n d
      }



                             M. Aizatulin   Verifying Implementations of Security Protocols in C
Method (II)

     c l i e n t ( char ∗ p a y l o a d , i n t p a y l o a d l e n ) {
         i n t m s g l e n = 5 + l e n + SHA1 LEN ;
         char ∗ msg = m a l l o c ( m s g l e n ) ;
         char ∗ p = msg ;
         ∗p = l e n ; p += 4 ;                  // add l e n g t h
         ∗ ( p++) = 1 ;                         // add t h e t a g
         memcpy ( p a y l o a d , p , l e n ) ; // add t h e p a y l o a d
         s h a 1 ( msg , 5 + l e n , p ) ;      // add t h e h a s h
         s e n d ( msg , m s g l e n ) ;        // s e n d
     }




                            M. Aizatulin   Verifying Implementations of Security Protocols in C
Method (II)

     c l i e n t ( char ∗ p a y l o a d , i n t p a y l o a d l e n ) {
         i n t m s g l e n = 5 + l e n + SHA1 LEN ;
         char ∗ msg = m a l l o c ( m s g l e n ) ;
         char ∗ p = msg ;
         ∗p = l e n ; p += 4 ;                  // add l e n g t h
         ∗ ( p++) = 1 ;                         // add t h e t a g
         memcpy ( p a y l o a d , p , l e n ) ; // add t h e p a y l o a d
         s h a 1 ( msg , 5 + l e n , p ) ;      // add t h e h a s h
         s e n d ( msg , m s g l e n ) ;        // s e n d
     }


                                               Symbolic Execution

              out(len(payload )|01| payload
                  |sha1(len(payload )|01| payload, kshared ))


                            M. Aizatulin   Verifying Implementations of Security Protocols in C
Method (III)

                                       ...
                                                 Symbolic Execution

           out(len(payload )|01| payload
               |sha1(len(payload )|01| payload, kshared ))




                        M. Aizatulin         Verifying Implementations of Security Protocols in C
Method (III)

                                         ...
                                                   Symbolic Execution

           out(len(payload )|01| payload
               |sha1(len(payload )|01| payload, kshared ))


                                                   Format Abstraction

               out(f1 (payload, hash1 (payload, kshared )))




                          M. Aizatulin         Verifying Implementations of Security Protocols in C
Method (III)

                                         ...
                                                   Symbolic Execution

           out(len(payload )|01| payload
               |sha1(len(payload )|01| payload, kshared ))


                                                   Format Abstraction

               out(f1 (payload, hash1 (payload, kshared )))


                                                   ProVerif (+ Server Side)

                           Integrity verified.


                          M. Aizatulin         Verifying Implementations of Security Protocols in C
Current Status



  Done:
      Implemented symbolic execution for fixed bitstring lengths
      and linear control flow.
      Proved correctness of format abstraction.
  To do:
      Implement symbolic execution for variable bitstring lengths.
      Implement format abstraction.
      Add support for arbitrary control flow.




                         M. Aizatulin   Verifying Implementations of Security Protocols in C
Thank you!




 M. Aizatulin   Verifying Implementations of Security Protocols in C

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (20)

Cs8792 cns - Public key cryptosystem (Unit III)
Cs8792   cns - Public key cryptosystem (Unit III)Cs8792   cns - Public key cryptosystem (Unit III)
Cs8792 cns - Public key cryptosystem (Unit III)
 
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
 
Security Tools Foss
Security Tools FossSecurity Tools Foss
Security Tools Foss
 
Latest C Interview Questions and Answers
Latest C Interview Questions and AnswersLatest C Interview Questions and Answers
Latest C Interview Questions and Answers
 
Rfid
Rfid Rfid
Rfid
 
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
 
Introduction to-vhdl
Introduction to-vhdlIntroduction to-vhdl
Introduction to-vhdl
 
Introduction to VHDL
Introduction to VHDLIntroduction to VHDL
Introduction to VHDL
 
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...
 
Network Security
Network SecurityNetwork Security
Network Security
 
Cryptography Workbook
Cryptography WorkbookCryptography Workbook
Cryptography Workbook
 
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...
 
PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...
PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...
PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...
 
rsa-1
rsa-1rsa-1
rsa-1
 
Behavioral modelling in VHDL
Behavioral modelling in VHDLBehavioral modelling in VHDL
Behavioral modelling in VHDL
 
Formal analysis-crypto-proto
Formal analysis-crypto-protoFormal analysis-crypto-proto
Formal analysis-crypto-proto
 
Crash course in verilog
Crash course in verilogCrash course in verilog
Crash course in verilog
 
Verilog overview
Verilog overviewVerilog overview
Verilog overview
 

Similar a Aizatulin slides-4-3

Static Detection of Application Backdoors
Static Detection of Application BackdoorsStatic Detection of Application Backdoors
Static Detection of Application Backdoors
Tyler Shields
 
[DSBW Spring 2009] Unit 08: WebApp Security
[DSBW Spring 2009] Unit 08: WebApp Security[DSBW Spring 2009] Unit 08: WebApp Security
[DSBW Spring 2009] Unit 08: WebApp Security
Carles Farré
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
johnpragasam1
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
azida3
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
cgt38842
 

Similar a Aizatulin slides-4-3 (20)

Shift Left Security
Shift Left SecurityShift Left Security
Shift Left Security
 
Bypass Security Checking with Frida
Bypass Security Checking with FridaBypass Security Checking with Frida
Bypass Security Checking with Frida
 
Owasp masvs spain 17
Owasp masvs spain 17Owasp masvs spain 17
Owasp masvs spain 17
 
Safeguarding artifact integrity in your Software Supply Chain
Safeguarding artifact integrity in your Software Supply ChainSafeguarding artifact integrity in your Software Supply Chain
Safeguarding artifact integrity in your Software Supply Chain
 
Static Detection of Application Backdoors
Static Detection of Application BackdoorsStatic Detection of Application Backdoors
Static Detection of Application Backdoors
 
45
4545
45
 
[DSBW Spring 2009] Unit 08: WebApp Security
[DSBW Spring 2009] Unit 08: WebApp Security[DSBW Spring 2009] Unit 08: WebApp Security
[DSBW Spring 2009] Unit 08: WebApp Security
 
Ch15,secu..
Ch15,secu..Ch15,secu..
Ch15,secu..
 
OWASP_Top_Ten_Proactive_Controls version 2
OWASP_Top_Ten_Proactive_Controls version 2OWASP_Top_Ten_Proactive_Controls version 2
OWASP_Top_Ten_Proactive_Controls version 2
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
 
Automated Cloud-Native Incident Response with Kubernetes and Service Mesh
Automated Cloud-Native Incident Response with Kubernetes and Service MeshAutomated Cloud-Native Incident Response with Kubernetes and Service Mesh
Automated Cloud-Native Incident Response with Kubernetes and Service Mesh
 
OWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptxOWASP_Top_Ten_Proactive_Controls_v2.pptx
OWASP_Top_Ten_Proactive_Controls_v2.pptx
 
Finding Zero-Days Before The Attackers: A Fortune 500 Red Team Case Study
Finding Zero-Days Before The Attackers: A Fortune 500 Red Team Case StudyFinding Zero-Days Before The Attackers: A Fortune 500 Red Team Case Study
Finding Zero-Days Before The Attackers: A Fortune 500 Red Team Case Study
 
Automated Validation of Internet Security Protocols and Applications (AVISPA)...
Automated Validation of Internet Security Protocols and Applications (AVISPA)...Automated Validation of Internet Security Protocols and Applications (AVISPA)...
Automated Validation of Internet Security Protocols and Applications (AVISPA)...
 
Verification of Security for Untrusted Third Party IP Cores
Verification of  Security for Untrusted Third Party IP CoresVerification of  Security for Untrusted Third Party IP Cores
Verification of Security for Untrusted Third Party IP Cores
 
OWASP_Top_Ten_Proactive_Controls_v32.pptx
OWASP_Top_Ten_Proactive_Controls_v32.pptxOWASP_Top_Ten_Proactive_Controls_v32.pptx
OWASP_Top_Ten_Proactive_Controls_v32.pptx
 
Security Process in DevSecOps
Security Process in DevSecOpsSecurity Process in DevSecOps
Security Process in DevSecOps
 
Unit 08: Security for Web Applications
Unit 08: Security for Web ApplicationsUnit 08: Security for Web Applications
Unit 08: Security for Web Applications
 
SmartphoneHacking_Android_Exploitation
SmartphoneHacking_Android_ExploitationSmartphoneHacking_Android_Exploitation
SmartphoneHacking_Android_Exploitation
 

Más de anesah (20)

Abraham
AbrahamAbraham
Abraham
 
Mouawad
MouawadMouawad
Mouawad
 
Pantidi
PantidiPantidi
Pantidi
 
Wilkie
WilkieWilkie
Wilkie
 
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
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Aizatulin slides-4-3

  • 1. Verifying Implementations of Security Protocols in C Mihhail Aizatulin1 supervised by Andrew Gordon2 , Jan J¨rjens3 , Bashar Nuseibeh1 u 1 The Open University 2 Microsoft Research Cambridge 3 Dortmund University CRC PhD Student Conference Open University June 3-4, 2010 M. Aizatulin Verifying Implementations of Security Protocols in C
  • 2. The Goal Source code of a Our goal is a tool for security cryptographic protocol analysis at implementation level. implementation Our tools List of all potential security flaws or proof of security M. Aizatulin Verifying Implementations of Security Protocols in C
  • 3. The Goal Source code of a Our goal is a tool for security cryptographic protocol analysis at implementation level. implementation The analysis should be automated, Our tools List of all potential security flaws or proof of security M. Aizatulin Verifying Implementations of Security Protocols in C
  • 4. The Goal Source code of a Our goal is a tool for security cryptographic protocol analysis at implementation level. implementation The analysis should be automated, sound (not miss any bugs), Our tools List of all potential security flaws or proof of security M. Aizatulin Verifying Implementations of Security Protocols in C
  • 5. The Goal Source code of a Our goal is a tool for security cryptographic protocol analysis at implementation level. implementation The analysis should be automated, sound (not miss any bugs), scalable (aim to verify Our tools OpenSSL or Kerberos). List of all potential security flaws or proof of security M. Aizatulin Verifying Implementations of Security Protocols in C
  • 6. The Goal Source code of a Our goal is a tool for security cryptographic protocol analysis at implementation level. implementation The analysis should be automated, sound (not miss any bugs), scalable (aim to verify Our tools OpenSSL or Kerberos). We assume that cryptographic primitives are implemented correctly, List of all potential security flaws or proof of security M. Aizatulin Verifying Implementations of Security Protocols in C
  • 7. The Goal Source code of a Our goal is a tool for security cryptographic protocol analysis at implementation level. implementation The analysis should be automated, sound (not miss any bugs), scalable (aim to verify Our tools OpenSSL or Kerberos). We assume that cryptographic primitives are implemented correctly, List of all potential security flaws or proof cryptography is unbreakable of security (for now). M. Aizatulin Verifying Implementations of Security Protocols in C
  • 8. Motivation (I) OpenSSL library bug, January 2009: int c h e c k c e r t i f i c a t e (){ ... if ( certificate malformed ) r e t u r n −1; else i f (! c e r t i f i c a t e c h e c k o k ) return 0; else return 1;} // l a t e r i n code : ... i f ( c h e c k c e r t i f i c a t e ( ) ) // o o p s ! { trust certificate (); } M. Aizatulin Verifying Implementations of Security Protocols in C
  • 9. Motivation (II) An attacker can craft a malformed certificate, pretending to be someone else: paypal.com Certificate? Malformed Certificate Client Attacker (= Internet) paypal.com M. Aizatulin Verifying Implementations of Security Protocols in C
  • 10. Motivation (III) Now the attacker can impersonate the client and the bank to each other: Password? Password? Password Password + “get $$$” Client Attacker (= Internet) paypal.com M. Aizatulin Verifying Implementations of Security Protocols in C
  • 11. Background Machine Languages Formal Languages (C, Java) (π-calculus, LySa) low-level properties (NULL dereference, division by zero) high-level properties (secrecy, authentica- tion) M. Aizatulin Verifying Implementations of Security Protocols in C
  • 12. Background There has been great progress in static software analysis, Machine Languages Formal Languages (C, Java) (π-calculus, LySa) low-level properties VCC Frama-C (NULL dereference, ESC/Java division by zero) SLAM high-level properties (secrecy, authentica- tion) M. Aizatulin Verifying Implementations of Security Protocols in C
  • 13. Background There has been great progress in static software analysis, verification of protocol specifications. Machine Languages Formal Languages (C, Java) (π-calculus, LySa) low-level properties VCC Frama-C (NULL dereference, ESC/Java division by zero) SLAM high-level properties ProVerif/CryptoVerif (secrecy, authentica- AVISPA tion) LySatool M. Aizatulin Verifying Implementations of Security Protocols in C
  • 14. Background There has been great progress in static software analysis, verification of protocol specifications. But so far very little progress in where the two meet. Machine Languages Formal Languages (C, Java) (π-calculus, LySa) low-level properties VCC Frama-C (NULL dereference, ESC/Java division by zero) SLAM high-level properties ProVerif/CryptoVerif CSur (secrecy, authentica- AVISPA Our Goal tion) LySatool M. Aizatulin Verifying Implementations of Security Protocols in C
  • 15. ProVerif ProVerif is a protocol verifier we would like to use. Its models are much more abstract than C. M. Aizatulin Verifying Implementations of Security Protocols in C
  • 16. ProVerif ProVerif is a protocol verifier we would like to use. Its models are much more abstract than C. ProVerif M ::= expression a, b, c name x, y, z variable f (M1 , . . . , Mn ) constructor M. Aizatulin Verifying Implementations of Security Protocols in C
  • 17. ProVerif ProVerif is a protocol verifier we would like to use. Its models are much more abstract than C. ProVerif C M ::= expression M, N ::= expression a, b, c name 0, . . . , ’a’, . . . constant x, y, z variable M op N operator f (M1 , . . . , Mn ) constructor u lvalue &u reference u ::= lvalue x, y, z variable ∗u dereference u.f ield field access u[i] array access M. Aizatulin Verifying Implementations of Security Protocols in C
  • 18. Symbolic Execution Symbolic execution is a tool to simplify programs and extract their meaning. Concrete: Symbolic: x = 2 y = 3 x = a y = b i n t f ( i n t x , i n t y ){ i n t f ( i n t x , i n t y ){ r e t u r n ++x ∗ y++;} r e t u r n ++x ∗ y++;} 9 (a + 1)b M. Aizatulin Verifying Implementations of Security Protocols in C
  • 19. Method (I) m, hash(m, kshared ) A − − − − − − → B. −−−−−− M. Aizatulin Verifying Implementations of Security Protocols in C
  • 20. Method (I) m, hash(m, kshared ) A − − − − − − → B. −−−−−− Client side implemented as: c l i e n t ( char ∗ p a y l o a d , i n t p a y l o a d l e n ) { i n t m s g l e n = 5 + l e n + SHA1 LEN ; char ∗ msg = m a l l o c ( m s g l e n ) ; char ∗ p = msg ; ∗p = l e n ; p += 4 ; // add l e n g t h ∗ ( p++) = 1 ; // add t h e t a g memcpy ( p a y l o a d , p , l e n ) ; // add t h e p a y l o a d s h a 1 ( msg , 5 + l e n , p ) ; // add t h e h a s h s e n d ( msg , m s g l e n ) ; // s e n d } M. Aizatulin Verifying Implementations of Security Protocols in C
  • 21. Method (II) c l i e n t ( char ∗ p a y l o a d , i n t p a y l o a d l e n ) { i n t m s g l e n = 5 + l e n + SHA1 LEN ; char ∗ msg = m a l l o c ( m s g l e n ) ; char ∗ p = msg ; ∗p = l e n ; p += 4 ; // add l e n g t h ∗ ( p++) = 1 ; // add t h e t a g memcpy ( p a y l o a d , p , l e n ) ; // add t h e p a y l o a d s h a 1 ( msg , 5 + l e n , p ) ; // add t h e h a s h s e n d ( msg , m s g l e n ) ; // s e n d } M. Aizatulin Verifying Implementations of Security Protocols in C
  • 22. Method (II) c l i e n t ( char ∗ p a y l o a d , i n t p a y l o a d l e n ) { i n t m s g l e n = 5 + l e n + SHA1 LEN ; char ∗ msg = m a l l o c ( m s g l e n ) ; char ∗ p = msg ; ∗p = l e n ; p += 4 ; // add l e n g t h ∗ ( p++) = 1 ; // add t h e t a g memcpy ( p a y l o a d , p , l e n ) ; // add t h e p a y l o a d s h a 1 ( msg , 5 + l e n , p ) ; // add t h e h a s h s e n d ( msg , m s g l e n ) ; // s e n d } Symbolic Execution out(len(payload )|01| payload |sha1(len(payload )|01| payload, kshared )) M. Aizatulin Verifying Implementations of Security Protocols in C
  • 23. Method (III) ... Symbolic Execution out(len(payload )|01| payload |sha1(len(payload )|01| payload, kshared )) M. Aizatulin Verifying Implementations of Security Protocols in C
  • 24. Method (III) ... Symbolic Execution out(len(payload )|01| payload |sha1(len(payload )|01| payload, kshared )) Format Abstraction out(f1 (payload, hash1 (payload, kshared ))) M. Aizatulin Verifying Implementations of Security Protocols in C
  • 25. Method (III) ... Symbolic Execution out(len(payload )|01| payload |sha1(len(payload )|01| payload, kshared )) Format Abstraction out(f1 (payload, hash1 (payload, kshared ))) ProVerif (+ Server Side) Integrity verified. M. Aizatulin Verifying Implementations of Security Protocols in C
  • 26. Current Status Done: Implemented symbolic execution for fixed bitstring lengths and linear control flow. Proved correctness of format abstraction. To do: Implement symbolic execution for variable bitstring lengths. Implement format abstraction. Add support for arbitrary control flow. M. Aizatulin Verifying Implementations of Security Protocols in C
  • 27. Thank you! M. Aizatulin Verifying Implementations of Security Protocols in C