Tls Sec
Tls Sec
0
De facto standard for Internet security
“The primary goal of the TLS protocol is to
provide privacy and data integrity between two
communicating applications”
In practice, used to protect information
transmitted between browsers and Web servers
Based on Secure Sockets Layers protocol, ver
3.0
Same protocol design, different algorithms
Deployed in nearly every web browser
SSL 1.0
Internal Netscape design, early 1994?
Lost in the mists of time
SSL 2.0
Published by Netscape, November 1994
Several problems (next slide)
SSL 3.0
Designed by Netscape and Paul Kocher,
November 1996
TLS 1.0
Internet standard based on SSL 3.0, January
1999
Not interoperable with SSL 3.0
Short key length
In export-weakened modes, SSL 2.0 unnecessarily weakens
the authentication keys to 40 bits.
Weak MAC construction
Message integrity vulnerability
SSL 2.0 feeds padding bytes into the MAC in block cipher
modes, but leaves the padding-length unauthenticated, may
allow active attackers to delete bytes from the end of
messages
Ciphersuite rollback attack
An active attacker may edits the list of ciphersuite
preferences in the hello messages to invisibly force both
endpoints to use a weaker form of encryption
“Least common denominator" security under active attack
Informal
Formal Intruder
Protocol
Protocol Model
Description
RFC
(request for
comments) Analysis
Find error Tool
Network protocols are defined in an RFC
TLS version 1.0 is described in RFC 2246
Intended to be a self-contained definition
of the protocol
Describes the protocol in sufficient detail for
readers who will be implementing it and those
who will be doing protocol analysis (that’s you!)
Mixture of informal prose and pseudo-code
Read some RFCs to get a flavor of what
protocols look like when they emerge from
the committee
80
70
60
50
40
Page count
30
20
10
0
SSL 2.0 SSL 3.0 TLS 1.0
Informal
Formal Intruder
Protocol
Protocol Model
Description
Mur code
RFC
Analysis
Find error Tool
TLS consists of two protocols
Handshake protocol
Use public-key cryptography to establish a
shared secret key between the client and the
server
Record protocol
Use the secret key established in the
handshake protocol to protect communication
between the client and the server
We will focus on the handshake protocol
Two parties: client and server
Negotiate version of the protocol and the
set of cryptographic algorithms to be used
Interoperability between different
implementations of the protocol
Authenticate client and server (optional)
Use digital certificates to learn each other’s
public keys and verify each other’s identity
Use public keys to establish a shared secret
ClientHello
ServerHello,
[Certificate],
[ServerKeyExchange],
[CertificateRequest],
ServerHelloDone
C [Certificate],
ClientKeyExchange,
S
[CertificateVerify]
C Secret key K
encrypted with
S
server’s key Ks
Server certificate can be verified by any client that has CA verification key Ka
Certificate authority is “off line”
Client, server communicate
Hi
Hello
Client Server
How are you?
ClientHello CS C, VerC, SuiteC, NC
C S
Highest version of the
struct { protocol supported by the
client
ProtocolVersion client_version;
Session id (if the client
Random random; wants tosession)
resume an old
ServerHello
C
• Highest protocol version both
client &
server support
S
• Strongest cryptographic suite
selected
from those offered by the client
ruleset i: ServerId do
choose l: serNet do
rule “Server receives ServerHello (new session)"
ser[i].clients[0].state = M_CLIENT_HELLO &
serNet[l].dest = i &
serNet[l].session = 0
==>
var
inM: Message; -- incoming message
outM: Message; -- outgoing message
begin
inM := serNet[l]; -- receive message
if inM.mType = M_CLIENT_HELLO then
outM.source := i;
outM.dest := inM.source;
outM.session := freshSessionId();
outM.mType := M_SERVER_HELLO;
outM.version := ser[i].version;
outM.suite := ser[i].suite;
outM.random := freshNonce();
multisetadd (outM, serNet);
ser[i].state := M_SERVER_SEND_KEY;
end; end; end;
C, Versionc, suitec, Nc
C ClientKeyExchange
S
Client generates some secret key
material
and sends it to the server encrypted
with
the server’s public key
struct { Let’s model this as
{Secret } c Ks
select (KeyExchangeAlgorithm) {
case rsa: EncryptedPreMasterSecret;
case diffie_hellman:
ClientDiffieHellmanPublic;
} exchange_keys
} ClientKeyExchange
struct {
ProtocolVersion client_version;
opaque random[46];
} PreMasterSecret
C, Versionc, suitec, Nc
C {Secretc}Ks
S
If the protocol is correct, C and S share
some secret key material secretc at this point
ServerHell
o
M_SERVER_HELLO M_SEND_KEY
ServerKeyExchang
e
M_SERVER_KEY M_CLIENT_KEY
M_SEND_KEY M_DONE
ClientKeyExchange
Informal
Formal Intruder
Protocol
Protocol Model
Description
Specify security
conditions and run
Mur
Intruder should not be able to learn
the secret generated by the client
ruleset i: ClientId do
ruleset j: IntruderId do
rule "Intruder has learned a client's secret"
cli[i].state = M_DONE &
multisetcount(s: int[j].secretKeys,
keyEqual(int[j].secretKeys[s], cli[i].secretKey)) > 0
==>
begin
error "Intruder has learned a client's secret"
end;
end;
end;
After the protocol has finished, client and
server should agree on their shared secret
ruleset i: ServerId do
ruleset s: SessionId do
rule "Server's shared secret is not the same as its client's"
ismember(ser[i].clients[s].client, ClientId) &
ser[i].clients[s].state = M_DONE &
cli[ser[i].clients[s].client].state = M_DONE &
!keyEqual(cli[ser[i].clients[s].client].secretKey,
ser[i].clients[s].secretKey)
==>
begin
error "S's secret is not the same as C's"
end;
end;
end;
Client and server should be running the highest
version of the protocol they both support
ruleset i: ServerId do
ruleset s: SessionId do
rule "Server has not learned the client's version or suite
correctly"
!ismember(ser[i].clients[s].client, IntruderId) &
ser[i].clients[s].state = M_DONE &
cli[ser[i].clients[s].client].state = M_DONE &
(ser[i].clients[s].clientVersion != MaxVersion |
ser[i].clients[s].clientSuite.text != 0)
==>
begin
error "Server has not learned the client's version or suite
correctly"
end;
end;
end;
Mur rules for protocol
participants and the
intruder define a
nondeterministic state
transition graph
...
...
Mur will exhaustively
enumerate all graph nodes
Mur will verify whether
specified security conditions
Correctness
hold in every reachable
condition violated node
If not, the path to the
Bad abstraction
Removed too much detail from the protocol when
constructing the abstract model
Add the piece that fixes the bug and repeat
This is part of the rational reconstruction process
Genuine attack
Yay! Hooray!
Attacks found by formal analysis are usually quite
strong: independent of specific cryptographic
schemes, OS implementation, etc.
Test an implementation of the protocol, if
available
C, Versionc=3.0, suitec
Versions=3.0, suites
sigca(S,Ks),
“ServerHelloDone”
C {Secretc}Ks
S
If the protocol is correct, C and S share
some secret key material secretc at this point
C {Secretc}Ks
S
Versions=3.0, suites
sigca(S,Ks),
Prevents “ServerHelloDone”
version
C
rollback attack
{Versionc,Secretc}Ks
Add rule to check that received
version is equal to version in
ClientHello
S
If the protocol is correct, C and S share
some secret key material secretc at this point
Versions, suites, Ns
Server public key in
certificate signed by sigca(S,Ks),
CA “ServerHelloDone”
C {Versionc,Secretc}Ks S
switch to negotiated cipher
Hash messages to
confirm consistent
views
… SuiteC …
… SuiteS …
…
data data
o d ifCy…
… Suite
M
d i
S y
… Suite f…
M…o
data data
SessionId, VerC= 3.0, NC, ...
C Finished Finished S
data data
SessionId, VerC= 2.0, NC, ...
C
X
Finished
{ NS } SecretKey
X
Finished
{ NC } SecretKey
S
data data