Model Checking for Security Anupam Datta CMU Fall 2007-08 18739A: Foundations of Security and Privacy.

Slides:



Advertisements
Similar presentations
Security attacks. - confidentiality: only authorized parties have read access to information - integrity: only authorized parties have write access to.
Advertisements

AUTHENTICATION AND KEY DISTRIBUTION
CMSC 414 Computer (and Network) Security Lecture 22 Jonathan Katz.
University of Twente The Netherlands Centre for Telematics and Information Technology Constraint Logic Programming for Verifying Security Protocols Sandro.
Lecture 3Dr. Verma1 COSC 6397 – Information Assurance Module M2 – Protocol Specification and Verification University of Houston Rakesh Verma Lecture 3.
Model Checking for Security Anupam Datta CMU Fall A: Foundations of Security and Privacy.
CS259: Security Analysis of Network Protocols Overview of Murphi Arnab Roy.
Automated Analysis of Cryptographic Protocols Using Murphi Mingchen Zhao University of Pennsylvania.
Security Definitions in Computational Cryptography
Luu Anh Tuan. Security protocol Intruder Intruder behaviors Overhead and intercept any messages being passed in the system Decrypt messages that are.
Deeper Security Analysis of Web-based Identity Federation Apurva Kumar IBM Research – India.
1 Digital Signatures & Authentication Protocols. 2 Digital Signatures have looked at message authentication –but does not address issues of lack of trust.
CMSC 414 Computer (and Network) Security Lecture 26 Jonathan Katz.
15-1 Last time Internet Application Security and Privacy Public-key encryption Integrity.
 Authorization via symmetric crypto  Key exchange o Using asymmetric crypto o Using symmetric crypto with KDC  KDC shares a key with every participant.
 Public key (asymmetric) cryptography o Modular exponentiation for encryption/decryption  Efficient algorithms for this o Attacker needs to factor large.
CS555Spring 2012/Topic 161 Cryptography CS 555 Topic 16: Key Management and The Need for Public Key Cryptography.
Modelling and Analysing of Security Protocol: Lecture 3 Protocol Goals Tom Chothia CWI.
Analysis of Security Protocols (I) John C. Mitchell Stanford University.
Analysis of Security Protocols (IV) John C. Mitchell Stanford University.
Overview of Cryptography Anupam Datta CMU Fall A: Foundations of Security and Privacy.
CMSC 414 Computer and Network Security Lecture 22 Jonathan Katz.
Modelling and Analysing of Security Protocol: Lecture 1 Introductions to Modelling Protocols Tom Chothia CWI.
CMSC 414 Computer and Network Security Lecture 24 Jonathan Katz.
Slide 1 Vitaly Shmatikov CS 378 Key Establishment Pitfalls.
Just Fast Keying (JFK) Protocol 18739A: Foundations of Security and Privacy Anupam Datta CMU Fall
CMSC 414 Computer and Network Security Lecture 17 Jonathan Katz.
Protocol Composition Logic Arnab Roy joint work with A. Datta, A. Derek, N. Durgin, J.C. Mitchell, D. Pavlovic CS259: Security Analysis of Network Protocols,
Progress Report on Java Based Protocol Analysis Presented by Stephen W. Mancini, 1Lt, USAF/AFIT Robert P. Graham, MAJ, USAF/AFIT Presentation date: 09.
Security 2 Distributed Systems Lecture# 15. Overview Cryptography Symmetric Assymeteric Digital Signature Secure Digest Functions Authentication.
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
Security Analysis of Network Protocols TECS Week Reference: John Mitchell Stanford 2005.
Inductive Verification of Protocols Anupam Datta CMU Fall A: Foundations of Security and Privacy.
1 Authentication Protocols Celia Li Computer Science and Engineering York University.
CMSC 414 Computer and Network Security Lecture 14 Jonathan Katz.
CS5204 – Fall Cryptographic Security Presenter: Hamid Al-Hamadi October 13, 2009.
Network Security. An Introduction to Cryptography The encryption model (for a symmetric-key cipher).
Executable specification of cryptofraglets with Maude for security verification Fabio Martinelli and Marinella Petrocchi IIT-CNR, Pisa Italy presented.
Formal Analysis of Security Protocols Dr. Changyu Dong
Analysis of a Fair Exchange Protocol Vitaly Shmatikov John Mitchell Stanford University.
Lecture 14 ISAKMP / IKE Internet Security Association and Key Management Protocol / Internet Key Exchange CIS CIS 5357 Network Security.
Security protocols  Authentication protocols (this lecture)  Electronic voting protocols  Fair exchange protocols  Digital cash protocols.
Security protocols and their verification Mark Ryan University of Birmingham Midlands Graduate School University of Birmingham April 2005 Steve Kremer.
Design and Analysis of Security Protocols Vitaly Shmatikov CS 395T
CSCE 813 Internet Security Cryptographic Protocol Analysis.
1 Reasoning about Concrete Security in Protocol Proofs A. Datta, J.Y. Halpern, J.C. Mitchell, R. Pucella, A. Roy.
Correctness Proofs and Counter-model Generation with Authentication-Protocol Logic Koji Hasebe Mitsuhiro Okada Department of Philosophy, Keio University.
6 June Lecture 2 1 TU Dresden - Ws on Proof Theory and Computation Formal Methods for Security Protocols Catuscia Palamidessi Penn State University,
SSL/TLS Analysis Anupam Datta CMU Fall A: Foundations of Security and Privacy.
Security Analysis of Network Protocols Vitaly Shmatikov SRI CS 259 John Mitchell Stanford.
Interleaving and Collusion Attacks on a Dynamic Group Key Agreement Scheme for Low-Power Mobile Devices * Junghyun Nam 1, Juryon Paik 2, Jeeyeon Kim 2,
Computer Science Lecture 23, page 1 CS677: Distributed OS Security: Focus of Control Three approaches for protection against security threats a)Protection.
Project: XML Security CS 259 March, 2004 Jun Yoshida (Visiting Scholar from Hitachi Ltd.)
@Yuan Xue CS 285 Network Security Key Distribution and Management Yuan Xue Fall 2012.
Pertemuan #8 Key Management Kuliah Pengaman Jaringan.
@Yuan Xue CS 285 Network Security Secure Socket Layer Yuan Xue Fall 2013.
Model Checking for Security Protocols Will Marrero, Edmund Clarke, Shomesh Jha.
Fourth Edition by William Stallings Lecture slides by Lawrie Brown
Security Analysis of Network Protocols
CS259: Security Analysis of Network Protocols, Winter 2008
Security Analysis of Network Protocols
Security Protocols Analysis
Man in the Middle Attacks
Protocol Verification by the Inductive Method
CDK4: Chapter 7 CDK5: Chapter 11 TvS: Chapter 9
Security Analysis of Network Protocols
CDK: Chapter 7 TvS: Chapter 9
‘Crowds’ through a PRISM
Protocol Verification by the Inductive Method
Formal Methods for Security Protocols
Presentation transcript:

Model Checking for Security Anupam Datta CMU Fall A: Foundations of Security and Privacy

Logistics  Scribing Notes due a week after the lecture Sign-up!  Blackboard access for people who are auditing, but are not officially enrolled: send to Joe  Homework 1 is out; due Sept 18 before class  Project discussion: Sept 18, 20 (Tue-Th): 4:30-6PM in CIC 2118 Sign up for slots (15 min per group)

This Lecture  Model checking overview  Model checking security protocols using Murphi Example: Needham-Schroeder public key protocol  Note: More on Murphi this Friday HW1 will use Murphi; possibly projects

Model Checking: Basics  Model the system Set of states + Start state Transition relation between states  Specify properties Special case: Invariants (properties that are true in all states)  Model checking Check that every reachable state in the graph satisfies the invariants Graph search done using BFS or DFS Developed by [Clarke, Emerson, Sistla] and [Quille, Sifakis] around 1980

Model Checking: Issue  State space explosion The number of reachable states quickly blows up  Techniques to combat problem Symmetry reduction Partial order reduction Symbolic representation of transition relation … More details in A: Introduction to Model Checking

Model checking security protocols  Many tools (see “Tools” page on course web page) Murphi – Explicit state model-checker  Authentication, key exchange protocols PRISM – Probabilistic model checker  Protocols for anonymity MOCHA – Game properties specified in ATL and ATL*  Contract signing protocols AVISPA – Specialized symbolic model checker for security protocols  Authentication, key exchange Tools can be used for course projects

Explicit intruder model Intruder Model Analysis Tool Formal Protocol Informal Protocol Description Find error Specify Property

Example: Needham-Schroeder  Famous simple example Protocol published and known for 10 years Gavin Lowe discovered unintended property while preparing formal analysis using FDR system  Subsequently rediscovered by every analysis method

Needham-Schroeder Crypto  Nonces Fresh, random numbers  Public-key cryptography Every agent A has  Public encryption key Ka  Private decryption key Ka -1 Main properties  Everyone can encrypt message to A  Only A can decrypt these messages Recall how we modeled encryption in the symbolic model

Needham-Schroeder Key Exchange { A, NonceA } { NonceA, NonceB } { NonceB} Ka Kb Security properties: On execution of the protocol, A and B are guaranteed mutual authentication and secrecy AB Kb

NS security properties  Responder correctly authenticated When initiator A completes the protocol apparently with honest responder B, it must be that B believes he ran the protocol with A  Initiator correctly authenticated When responder B completes the protocol apparently with honest initiator A, it must be that A believes she ran the protocol with B  Initiator Nonce secrecy When honest initiator completes the protocol with honest peer, intruder does not know initiator’s nonce.

Anomaly in Needham-Schroeder AE B { A, NA } { NA, NB } { NB } Ke Kb Ka Ke Evil agent E tricks honest A into revealing private key NB from B Evil E can then fool B [Lowe96]

Murphi [Dill et al]  Describe finite-state system State variables with initial values Transition rules Communication by shared variables  Scalable: choose system size parameters  Automatic exhaustive state enumeration Space limit: hash table to avoid repeating states  Research and industrial protocol verification  Method for security protocol analysis developed by Mitchell et al

Limitations of Finite State Methods  Two sources of infinite behavior Many instances of participants, multiple runs Message space or data space may be infinite  Finite approximation Assume finite participants  Example: 2 clients, 2 servers Assume finite message space  Represent random numbers by r1, r2, r3, …  Do not allow encrypt(encrypt(encrypt(…)))

Applying Murj to security protocols  Formulate protocol Model initiator, responder state machines Model n/w as a shared variable Model properties using invariants  Add adversary Control over “network” Possible actions  Intercept any message  Remember parts of messages  Generate new messages, using observed data and initial knowledge (e.g. public keys)

Data structures const NumInitiators: 1; -- number of initiators NumResponders: 1; -- number of responders … type InitiatorId: scalarset (NumInitiators); InitiatorStates: enum{I_SLEEP, I_WAIT, I_COMMIT; Initiator: record state: InitiatorStates responder: AgentId end; var ini: array [InitiatorId] of Initiator Scalable model Symmetry reduction

Messages and network MessageType : enum { -- types of messages M_NonceAddress, -- {Na, A}Kb nonce and addr M_NonceNonce, -- {Na,Nb}Ka two nonces M_Nonce -- {Nb}Kb one nonce }; Message : record source: AgentId; -- source of message dest: AgentId; -- intended destination of msg key: AgentId; -- key used for encryption mType: MessageType; -- type of message nonce1: AgentId; -- nonce1 nonce2: AgentId; -- nonce2 OR sender id OR empty end; var net: multiset[NetworkSize] of Message; -- state variable for n/w

Modeling Protocol Actions ruleset i: InitiatorId do ruleset j: AgentId do rule 20 "initiator starts protocol" ini[i].state = I_SLEEP & multisetcount (l:net, true) var outM: Message; -- outgoing message begin undefine outM; outM.source := i; outM.dest := j; outM.key := j; outM.mType := M_NonceAddress; outM.nonce1 := i; outM.nonce2 := i; multisetadd (outM,net); ini[i].state :=I_WAIT; ini[i].responder := j; end; end;end;

Modeling Properties invariant "responder correctly authenticated" forall i: InitiatorId do ini[i].state = I_COMMIT & ismember(ini[i].responder, ResponderId) -> res[ini[i].responder].initiator = i & ( res[ini[i].responder].state = R_WAIT | res[ini[i].responder].state = R_COMMIT ) end;

Adversary Model  Formalize “knowledge” initial data observed message fields results of simple computations  Optimization only generate messages that others read time-consuming to hand simplify  Possibility: automatic generation

Attacker capabilities (1) S |- m  S |-k  S |- {m} k (2) S |- {m} k  S |- k  S |- m (3) S |- m  S |-K  S |- {m} K (4) S |- {m} K  S |- K -1  S |- m (5) S |- {m} K  S |- s -1  S |- sig(s -1, m) (6) S |- m   S |- h(m) (7) S |- m  S |- k  S |- h(k,m) (8) S |- m1  S |- m2  S |- (9) S |-  S |- m1  S |- m2 (10) S |- n (new symbol denoting random number) S includes initial knowledge of attacker + messages sent on the network

Modeling the attacker -- intruder i sends recorded message ruleset i: IntruderId do -- arbitrary choice of choose j: int[i].messages do -- recorded message ruleset k: AgentId do -- destination rule "intruder sends recorded message" !ismember(k, IntruderId) & -- not to intruders multisetcount (l:net, true) < NetworkSize ==> var outM: Message; begin outM := int[i].messages[j]; outM.source := i; outM.dest := k; multisetadd (outM,net); end; end;

Run of Needham-Schroeder  Find error after 1.7 seconds exploration  Output: trace leading to error state  Murphi times after correcting error:

Homework #1  Investigate the NS flaw and the fixed Needham Schroeder Lowe protocol  Investigate conditions under which attack succeeds: adversary power, initiator behavior and crypto

Limitations  System size with current methods 2-6 participants Kerberos: 2 clients, 2 servers, 1 KDC, 1 TGS 3-6 steps in protocol May need to optimize adversary  Adversary model Cannot model randomized attack Do not model adversary running time

State Reduction on N-S Protocol

Security Protocols in Mur   Standard “benchmark” protocols Needham-Schroeder, TMN, … Kerberos  Study of Secure Sockets Layer (SSL) Versions 2.0 and 3.0 of handshake protocol Include protocol resumption  Tool optimization  Additional protocols Contract-signing Wireless networking (IEEE i)

Questions?