Verfying the SSH TLP with ProVerif

Similar documents
Formally Linking Security Protocol Models and Implementations

for Compound Authentication

CPSC 467: Cryptography and Computer Security

Code Generation for network software with formal safety guarantees

CPSC 467b: Cryptography and Computer Security

Verifying Real-World Security Protocols from finding attacks to proving security theorems

SPi Calculus: Outline. What is it? Basic SPi Calculus Notation Basic Example Example with Channel Establishment Example using Cryptography

Formal Methods for Assuring Security of Computer Networks

Formal Verification of e-reputation Protocols 1

Secure Multi-Party Computation Without Agreement

Automated Security Proofs with Sequences of Games

Cryptography and Network Security. Prof. D. Mukhopadhyay. Department of Computer Science and Engineering. Indian Institute of Technology, Kharagpur

Analysis Techniques. Protocol Verification by the Inductive Method. Analysis using theorem proving. Recall: protocol state space.

Cryptography (Overview)

Chapter 4 Defining Classes I

Secure Multiparty Computation: Introduction. Ran Cohen (Tel Aviv University)

Key-value store with eventual consistency without trusting individual nodes

Plaintext Awareness via Key Registration

Nigori: Storing Secrets in the Cloud. Ben Laurie

Information Security. message M. fingerprint f = H(M) one-way hash. 4/19/2006 Information Security 1

A Practical Optional Type System for Clojure. Ambrose Bonnaire-Sergeant

UNIT - IV Cryptographic Hash Function 31.1

CS1 Recitation. Week 1

CS5232 Formal Specification and Design Techniques. Using PAT to verify the Needham-Schroeder Public Key Protocol

CS 395T. Analyzing SET with Inductive Method

An Executable Model for JFKr

Computer Networks II, advanced networking

The AVISPA Tool for the Automated Validation of Internet Security Protocols and Applications

Key Exchange in IPsec revisited: Formal Analysis of IKEv1 and IKEv2. Cas Cremers, ETH Zurich

UNIT 3

HP Instant Support Enterprise Edition (ISEE) Security overview

Implementing Cryptography: Good Theory vs. Bad Practice

Research Statement. Yehuda Lindell. Dept. of Computer Science Bar-Ilan University, Israel.

A messy state of the union:

340 Review Fall Midterm 1 Review

Detectable Byzantine Agreement Secure Against Faulty Majorities

From CryptoVerif Specifications to Computationally Secure Implementations of Protocols

Deploying a New Hash Algorithm. Presented By Archana Viswanath

Session key establishment protocols

The Secure Shell (SSH) Protocol

The automatic security protocol verifier ProVerif

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages

Session key establishment protocols

Key Agreement Schemes

Basic Concepts and Definitions. CSC/ECE 574 Computer and Network Security. Outline

From Crypto to Code. Greg Morrisett

CS Protocol Design. Prof. Clarkson Spring 2017

Refining Computationally Sound Mech. Proofs for Kerberos

Lesson 13 Securing Web Services (WS-Security, SAML)

How Formal Analysis and Verification Add Security to Blockchain-based Systems

Formal Methods in Software Engineering. Lecture 07

Message authentication. Why message authentication. Authentication primitives. and secure hashing. To prevent against:

Security Handshake Pitfalls

Protocols II. Computer Security Lecture 12. David Aspinall. 17th February School of Informatics University of Edinburgh

A Remote Biometric Authentication Protocol for Online Banking

Security protocols and their verification. Mark Ryan University of Birmingham

CSCI 454/554 Computer and Network Security. Topic 2. Introduction to Cryptography

Chapter 8 Web Security

CS Protocols. Prof. Clarkson Spring 2016

CSC/ECE 774 Advanced Network Security

Outline Key Management CS 239 Computer Security February 9, 2004

Outline. Cryptography. Encryption/Decryption. Basic Concepts and Definitions. Cryptography vs. Steganography. Cryptography: the art of secret writing

Robbing the Bank with a Theorem Prover

Module: Cryptographic Protocols. Professor Patrick McDaniel Spring CMPSC443 - Introduction to Computer and Network Security

Outline More Security Protocols CS 239 Computer Security February 4, 2004

Authenticity by Typing for Security Protocols

Verification of Security Protocols

Lecture 12 Page 1. Lecture 12 Page 3

1 Introduction. 3 Syntax

Operational Semantics. One-Slide Summary. Lecture Outline

Concepts of programming languages

CS 6110 S11 Lecture 25 Typed λ-calculus 6 April 2011

Typed Lambda Calculus. Chapter 9 Benjamin Pierce Types and Programming Languages

6.001 Notes: Section 6.1

(Refer Slide Time: 1:36)

Secure Programming Techniques

Outline. More Security Protocols CS 239 Security for System Software April 22, Needham-Schroeder Key Exchange

Secure Multiparty Computation

CCured. One-Slide Summary. Lecture Outline. Type-Safe Retrofitting of C Programs

CS530 Authentication

Contents. Program 1. Java s Integral Types in PVS (p.4 of 37)

Verification of security protocols introduction

Implementing Internet Key Exchange Security Protocol

Motivation was to facilitate development of systems software, especially OS development.

Outline More Security Protocols CS 239 Computer Security February 6, 2006

Formal Methods and Cryptography

Rule based Forwarding (RBF): improving the Internet s flexibility and security. Lucian Popa, Ion Stoica, Sylvia Ratnasamy UC Berkeley Intel Labs

Notes for Lecture 24

Public Review: Comments on Draft ETSI SR V0.0.4 ( )

Introduction to Cryptography in Blockchain Technology. December 23, 2018

Safety and liveness for critical sections

Agreement in Distributed Systems CS 188 Distributed Systems February 19, 2015

CS-XXX: Graduate Programming Languages. Lecture 9 Simply Typed Lambda Calculus. Dan Grossman 2012

Uses of Cryptography

Representation Independence, Confinement and Access Control

Encryption. INST 346, Section 0201 April 3, 2018

CS Paul Krzyzanowski

Computer Security Exam 2 Review. Paul Krzyzanowski. Rutgers University. Spring 2018

Lecture 9a: Secure Sockets Layer (SSL) March, 2004

MSO Lecture Design by Contract"

Transcription:

A Demo Alfredo Pironti Riccardo Sisto Politecnico di Torino, Italy {alfredo.pironti,riccardo.sisto}@polito.it CryptoForma Bristol, 7-8 April, 2010

Outline Introduction 1 Introduction 2 3 4

Introduction Goals Show how to model a real protocol in ProVerif So that an interoperable implementation can be derived Learn how to tweak the model to let it verify Tips to help spotting bugs in the model Safety properties turn true on a protocol doing nothing!

The SSH TLP I Definition RFC 4253 Also related to RFC 4250 and 4251 Description 1 2: Identifiers exchange 3 4: Supported algorithms exchange 5: Client s DH public key 6: Server s DH public key; digitally signed hash of relevant session data

The SSH TLP II Algorithms negotiation Several algorithms are negotiated E.g. hashing, signing, encryption... Ten algorithms are negotiated in total For each algorithm to be negotiated Each actor sends a list of supported algorithms Preferred algorithms come first The most preferred client algorithm that is supported by the server is chosen Negotiation is client-driven Hashings Digital signature implies hashing before signing Hashing is explicitly represented in the model

The SSH TLP III Server authentication Through public key mechanism But not certificates Public key must be trusted by other means Usually by a local key store First session trust problem

Specification Outline Description Separate processes for client and server One instance process coordinating them Thus generating protocol sessions Example See sshboth.v1.proverif file

Notes about the Model Protocol sessions Unbounded independent sessions handled Each actor is replicated; not the composition of the two Cryptographic algorithms and parameters Not taken into account in this version Not even algorithm negotiation Server trusted public key The model knows the correct server key The server provided key must match the correct one

Experiments with the Model Tip (valid for all models) Do the actors eventually reach the end of the protocol (at least once)? Very relevant to safety properties Use fictitious debug events Not liveness, yet some information about protocol execution Example See sshboth.v1.debug.proverif file

Preliminary Algorithms Support I Representing algorithms in the model Algorithms lists are included in exchanged messages No explicit algorithm agreement No usage of those algorithms in the specification Partially included in authentication (via agreement on exchanged messages) Example See sshboth.v2.proverif file

Preliminary Algorithms Support II Enhancing cryptographic primitives Algorithms are represented as constructor/destructor parameters The used cryptographic algorithms must match Representing algorithms in the model Use server provided algorithms everywhere Like the server chose the algorithms (based on client preferences) Useful to let the model formally verify Not really close to the RFC

Preliminary Algorithms Support III Note Always in a Dolev-Yao model Adding algorithms to spot logical errors in their negotiation and usage Not able to spot bad algorithms interactions or specific weaknesses Example See sshboth.v3.proverif file

Improving the Model Addressed issues Full algorithms handling Including algorithms negotiation Trusted server key handling By means of a fully modeled key store Protocol errors handling Also modeled Type casts Unnecessary in untyped languages such as π-calculus and derivatives Needed in strongly typed derived implementations Actually the main source of verification troubles But solved with semantically equivalent constructs

Algorithms Negotiation I Strategy Both client and server exchange their preferred algorithms lists Remember: several lists; each for one algorithm negotiation Each list is opaque (i.e. a name); not an expanded list For each algorithm to be negotiated, we have Client list Server list These form a list-pair Both client and server apply the same negotiation function to each list-pair They get the same negotiated algorithm

Algorithms Negotiation II Discussion Realistic Each actor gets its own negotiated algorithms independently The negotiated algorithms can be formally shown to be equal Both client and server implement the same negotiation algorithm Generic No knowledge on the negotiation algorithm internals Modeled as a hash Output (negotiated algorithm) depends on input (algorithms lists) Link between input and output is lost But the attacker knows the input

Trusted Server Key I Strategy A key store stores the known server key pair A honest server accesses the key store to retrieve its key pair A honest client compares the server-provided public key with the trusted key looked up from the key store One key store running in parallel with each client and each server instance

Trusted Server Key II Interacting with the key store Request/Response (Output/Input) policy Send request (OP, DATA) Receive response OUTCOME Several available operands CHECK, CHECK IP: check whether the given alias is associated with any key OUTCOME is [YES, NO] GET, GET IP: retrieve the key associated with the given alias OUTCOME is the key, or the process is stuck if there is no such key

Trusted Server Key III Discussion Design: key store must be implementable We provide such an implementation Backed by the Java key store Client does not need to know the correct key The key store actually knows it First session trust problem still open Each session is independent Keys in key stores do not depend from previous runs of the protocol Very helpful in verification Reason why first session trust problem still open Vision: Automatically find and exploit protocol session invariants

Protocol Errors Introduction Modeling Use else branches to handle errors or unexpected data Send SSH prescribed error messages (Also use a state private channel to return data to the caller of the protocol) Discussion More complete specification (Dolev-Yao) Information leakage through error messages is ruled out

Type Casts I Introduction Motivation Allow strongly typed implementations be derived from this specification Each spi calculus term gets a statically assigned type Two types for the same term Two different terms Design Send term M over the cast channel: out(cast,m) Read M back from the cast channel; bind it to x: in(cast,x) Several casts sequentially over the same channel

Type Casts II Introduction Issue 1 Over-approximations Message order lost on private channels Tentative solution Rename cast channel to preserve order Very verbose specification Not always working Not actually working in the current version of the SSH model

Type Casts III Issue 2 According to Blanchet: private channels stress ProVerif a lot We could not reach ProVerif termination Working solution Convert casts to let assignments Semantically equivalent But avoids duplicated terms (syntactical substitution) Enables verification of the model

Demo Introduction Example See ssh2/*.proverif files

I Results Quite detailed SSH model Adheres to the RFC Interoperable implementations have been derived from it Include details sometimes omitted from high-level models Algorithms negotiation Key stores Error handling Sometimes over-complicated (see casts) Needed to derive an implementation Semantically equivalent simplifications available Still in a Dolev-Yao symbolic context

II Lessons learnt Interpretation of a model Usage of cryptography can mean something at a higher level E.g. hashing for algorithms negotiation Safety properties can be tricky At least ensure some form of liveness, especially in complex models Tweaking the model may be necessary to enable verification Strongly dependent on verification tool internal algorithms Future work Extend to several (unbounded?) client/server pairs Handle the first session trust problem

The End Thank you! Questions?