27
Analysis of the SILC Pro Analysis of the SILC Pro tocol with Murphi tocol with Murphi

Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

Embed Size (px)

Citation preview

Page 1: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

Analysis of the SILC Protocol with Analysis of the SILC Protocol with MurphiMurphi

Page 2: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

OverviewOverview

What is SILC?What is SILC? Stands for Stands for SSecure ecure IInternet nternet LLive ive CConferencing.onferencing. Designed as a secure replacement for IRC (Designed as a secure replacement for IRC (IIntnt

ernet ernet RRelay elay CChat).hat). Also has some features of instant messaging.Also has some features of instant messaging. Stable implementations for clients and servers Stable implementations for clients and servers

are available. (http://www.silcnet.org)are available. (http://www.silcnet.org)

Page 3: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

Project objectivesProject objectives

Examine the security of SILC, and hopefully Examine the security of SILC, and hopefully find attacks with Murphi.find attacks with Murphi.

More specifically, we wanted to see if a maMore specifically, we wanted to see if a malicious client can “eavesdrop” on a converslicious client can “eavesdrop” on a conversation in a channel to which he does not belation in a channel to which he does not belong.ong.

Page 4: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

ResultsResults

Used rational reconstruction to verify the nUsed rational reconstruction to verify the necessity of key part of the chat protocol.ecessity of key part of the chat protocol.

Found a possible non-trivial attack.Found a possible non-trivial attack. Bad news: Murphi didn’t find it; we thought Bad news: Murphi didn’t find it; we thought

it up while fine-tuning our invariants. (It turit up while fine-tuning our invariants. (It turned out that the invariant broke because of ned out that the invariant broke because of a bug in our code and not because of the ea bug in our code and not because of the exploit.)xploit.)

Good news: Murphi verifies the exploit.Good news: Murphi verifies the exploit.

Page 5: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

Presentation outlinePresentation outline

The SILC channel protocolThe SILC channel protocol Our model of the protocolOur model of the protocol Rational reconstruction of the modelRational reconstruction of the model The exploitThe exploit Problems we encounteredProblems we encountered Future workFuture work

Page 6: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

TerminologyTerminology A A serverserver handles channel maintenance handles channel maintenance

and accepts connections from clients.and accepts connections from clients. A A clientclient connects to a server to join and connects to a server to join and

part channels.part channels. A A channelchannel is a group of clients that are in is a group of clients that are in

the same conversation.the same conversation. No one outside a channel is supposed to No one outside a channel is supposed to

be able to listen in on the conversation.be able to listen in on the conversation. It is assumed that each client has already It is assumed that each client has already

established a session key with each server established a session key with each server to which it talks.to which it talks.

Page 7: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

Protocol description Protocol description (Client)(Client)

If entity A sends something to entity B in SILC, it is always If entity A sends something to entity B in SILC, it is always encrypted with the session key between A and B.encrypted with the session key between A and B.

A client initially connects to a server.A client initially connects to a server. A connected client can request to join a channel on a A connected client can request to join a channel on a

server.server. The client knows that it has joined the channel when it The client knows that it has joined the channel when it

receives a channel key from the server.receives a channel key from the server. Every time a client joins or parts a channel, a new channel Every time a client joins or parts a channel, a new channel

key is generated and distributed among the remaining key is generated and distributed among the remaining channel members.channel members.

Each channel message, instead of being with the session Each channel message, instead of being with the session key, is encrypted with the channel key. However, the key, is encrypted with the channel key. However, the packet header (which stores the source and destination) is packet header (which stores the source and destination) is still encrypted with the session key.still encrypted with the session key.

A client, when it parts a channel, notifies the server so that A client, when it parts a channel, notifies the server so that it may update the channel roster and regenerate the it may update the channel roster and regenerate the channel key.channel key.

Page 8: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

Protocol description Protocol description (Server)(Server)

A server, when it receives a join request for a channel froA server, when it receives a join request for a channel from a client, adds that client to the channel roster if it is nm a client, adds that client to the channel roster if it is not already there.ot already there.

A server, when it receives a part request for a channel froA server, when it receives a part request for a channel from a client, removes that client from the channel roster if im a client, removes that client from the channel roster if it is there.t is there.

If the channel roster changes, a new session key is creatIf the channel roster changes, a new session key is created and distributed to all remaining clients in the channel ed and distributed to all remaining clients in the channel roster.roster.

Whenever a message for a channel is received from a cliWhenever a message for a channel is received from a client of which it is a member, it is broadcast to all clients ient of which it is a member, it is broadcast to all clients in the channel roster. (Only the header is reencrypted.)n the channel roster. (Only the header is reencrypted.)

Page 9: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

Protocol exampleProtocol example

C1 C2S

Connect Connect

Join #silctalkgenerated-silctalk-key(1)

{Message: “I’m all alone.”}(1){C1 message: “I’m all alone.”}(1)

Join #silctalkgenerated-silctalk-key(2) generated-silctalk-key(2)

{Message: “Sup C1.”}(2)

{C2 Message: “Sup C1.”}(2){C2 Message: “Sup C1.”}(2)

Part #silctalk

generated-silctalk-key(3)

Part #silctalkYou have joined channel #silctalk

C1: I’m all alone.

C2 has joined channel #silctalk

C2: Sup C1.

You have parted channel #silctalk

You have channel #silctalk

C2: Sup C1.

C1 has parted channel #silctalk

You have channel #silctalk

Page 10: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

SimplificationsSimplifications We assume no packet loss.We assume no packet loss. We assume lag-free connections.We assume lag-free connections. In other words, as soon as a client joins or In other words, as soon as a client joins or

parts a channel, the new key is instantly parts a channel, the new key is instantly distributed to all other clients (unless distributed to all other clients (unless intercepted by an intruder).intercepted by an intruder).

In practice, clients keep around old keys In practice, clients keep around old keys so that they may still decrypt messages so that they may still decrypt messages that have been delayed, but we don’t that have been delayed, but we don’t model that.model that.

Perfect cryptography and key exchange.Perfect cryptography and key exchange.

Page 11: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

IntruderIntruder model model Intruder can intercept packets and store them.Intruder can intercept packets and store them. Intruder can then forward packets it has stored.Intruder can then forward packets it has stored. Intruder may have a partner client and/or a Intruder may have a partner client and/or a

partner server.partner server. If a client/server is a partner of an intruder it is If a client/server is a partner of an intruder it is

malicious.malicious. Intruder cannot directly decrypt packets, but it Intruder cannot directly decrypt packets, but it

can pass it on to its partner(s), which may be can pass it on to its partner(s), which may be able to decrypt it.able to decrypt it.

Page 12: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

MurphiMurphi implementationimplementation ( (CommaCommandnd))

Command : recordCommand : recordsource: AgentId;source: AgentId;dest: AgentId;dest: AgentId;intDest: AgentId; -- intended destinationintDest: AgentId; -- intended destination

-- (source, intDest) is the key-- (source, intDest) is the key

cType: CommandType;cType: CommandType; -- C_Join, C_Part, C_Msg, C_NewChannelKey-- C_Join, C_Part, C_Msg, C_NewChannelKey

channel: ChannelId; -- all msg typeschannel: ChannelId; -- all msg typeschannelKey: KeyId; -- NewKey, MsgchannelKey: KeyId; -- NewKey, Msgmessage: MsgId; -- Msg onlymessage: MsgId; -- Msg only

end;end;

Page 13: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

MurphiMurphi ImplementationImplementation ( (ClientClient))Client : recordClient : record

partnerServer: ServerId;partnerServer: ServerId;numMsgs: MsgId;numMsgs: MsgId;lastSeenMsg: Command;lastSeenMsg: Command;wtjChannels: multiset[NumChannels] wtjChannels: multiset[NumChannels]

of ChannelId; of ChannelId;channelRecords: multiset[NumChannels] channelRecords: multiset[NumChannels]

of ChannelRecord; of ChannelRecord; -- record contains channel ID, joined boolean and-- record contains channel ID, joined boolean and -- channel key-- channel key

messagesSent: multiset[NumMessages] messagesSent: multiset[NumMessages] of Command; of Command;

partnerIntruder: IntruderId;partnerIntruder: IntruderId;end;end;

Page 14: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

MurphiMurphi ImplementationImplementation ( (ServerServer))Server : recordServer : recordchannels: array[ChannelId] of channels: array[ChannelId] of

ChannelRoster; ChannelRoster;end;end;

ChannelRoster : recordChannelRoster : recordchannelKey: ChannelKeyId;channelKey: ChannelKeyId;clients: array[AgentId] of boolean;clients: array[AgentId] of boolean;

-- should be ClientId, but Murphi-- should be ClientId, but Murphi -- complains-- complainsend;end;

Page 15: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

MurphiMurphi ImplementationImplementation ((intruderintruder))

Intruder: recordIntruder: record

partnerClient: ClientId;partnerClient: ClientId;

partnerServer: ServerId;partnerServer: ServerId;

messages: multiset[NumIntruderMessages] of messages: multiset[NumIntruderMessages] of Command;Command;

End;End;

Page 16: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

InvariantsInvariants If the client thinks that it is joined to a channel, If the client thinks that it is joined to a channel,

the server also thinks that the client is joined to the server also thinks that the client is joined to that channel.that channel.

If the server thinks that a particular client is not If the server thinks that a particular client is not joined to a channel, then that client also thinks joined to a channel, then that client also thinks that it is not joined to that channel.that it is not joined to that channel.

If the client receives a message, the source of the If the client receives a message, the source of the message must have sent it. (No spoofing)message must have sent it. (No spoofing)

If the client receives a message that it has the If the client receives a message that it has the channel key for, the client must be currently in to channel key for, the client must be currently in to that channel, or the message was sent while the that channel, or the message was sent while the client was in the channel. (No eavesdropping)client was in the channel. (No eavesdropping)

Page 17: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

Rational ReconstructionRational Reconstruction We tried removing the part of the SILC We tried removing the part of the SILC

protocol where a new channel key is protocol where a new channel key is generated every time a client joins or parts a generated every time a client joins or parts a channel from our Murphi model.channel from our Murphi model.

Eavesdropping invariant breaks, as it should.Eavesdropping invariant breaks, as it should. Malicious client joins, gets the key for the Malicious client joins, gets the key for the

channel, and parts.channel, and parts. Malicious client can read any future message Malicious client can read any future message

sent on that channel that is intercepted by its sent on that channel that is intercepted by its partner intruder.partner intruder.

Murphi finds it within 19 states, 20 rules Murphi finds it within 19 states, 20 rules (DFS).(DFS).

Page 18: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

MC C

S

Connect Connect

Join #silctalk

generated-silctalk-key(1)

Join #silctalk

generated-silctalk-key(1)

{Message: “Hello”} (1)

{C Message: “Hello.”}(1)

Part #silctalk

Intruder is able to decrypt a message for the channel even though it has already parted the channel!

I

Page 19: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

TheThe exploitexploit ( (asas foundfound byby MurphiMurphi))

Bob is in channel #foo.Bob is in channel #foo. Murphy joins #foo, and key K1 is sent to Murphy joins #foo, and key K1 is sent to

Bob and Murphy.Bob and Murphy. Murphy parts #foo and server tries to Murphy parts #foo and server tries to

send key K2 to Bob.send key K2 to Bob. Intruder blocks key message. Bob sends a Intruder blocks key message. Bob sends a

message with K1, intruder intercepts and message with K1, intruder intercepts and passes it to Murphy, who can read it.passes it to Murphy, who can read it.

Murphi finds it within 344 states, 543 Murphi finds it within 344 states, 543 rules (0.60s).rules (0.60s).

Page 20: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

M B

S

Join #foo

generated-silctalk-key(1) generated-silctalk-key(1)

{Message: “Hello”} (1)

{C Message: “Hello.”}(1)

Part #foo

Intruder is able to decrypt a message for the channel even though it has already parted the channel!

I

generated-silctalk-key(2)

Page 21: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

PracticalPractical??

Bob may not have seen Murphi Bob may not have seen Murphi leave, so might still keep silent.leave, so might still keep silent.

Even if Bob saw Murphi leave, he Even if Bob saw Murphi leave, he could realize that he didn’t receive a could realize that he didn’t receive a new key from the server yet, so may new key from the server yet, so may keep silent.keep silent.

Page 22: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

AA moremore practicalpractical exploitexploit Alice and Bob are in #foo.Alice and Bob are in #foo. Murphy joins #foo. Server sends K1 to Murphi and tries to Murphy joins #foo. Server sends K1 to Murphi and tries to

send K1 to Alice and Bob but intruder intercepts and stores.send K1 to Alice and Bob but intruder intercepts and stores. Murphy parts #foo. Server tries to send K2 to Alice and Bob Murphy parts #foo. Server tries to send K2 to Alice and Bob

but intruder intercepts and stores.but intruder intercepts and stores. Intruder forwards K2 and K1 to Alice and Bob Intruder forwards K2 and K1 to Alice and Bob in that orderin that order.. Alice and Bob mistakenly think K1 is the most recent key from Alice and Bob mistakenly think K1 is the most recent key from

the server, and thus will use it to encrypt their messages.the server, and thus will use it to encrypt their messages. Intruder can intercept said messages and forward to Murphy Intruder can intercept said messages and forward to Murphy

to decrypt.to decrypt. Alice and Bob saw Murphy join and part, and they both Alice and Bob saw Murphy join and part, and they both

received two keys, so they think everything is fine.received two keys, so they think everything is fine.

Page 23: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

WhyWhy doesdoes thethe exploitexploit existexist??

No timestamping or numbering of keys.No timestamping or numbering of keys. No mention of timestamping or numbering in SILC spec.No mention of timestamping or numbering in SILC spec. Why even use channel keys? Why not just encrypt using Why even use channel keys? Why not just encrypt using

session keys?session keys? Generality; SILC supports a “private channel” mode, Generality; SILC supports a “private channel” mode,

where even the server cannot decrypt the channel where even the server cannot decrypt the channel messages.messages.

Disallow messages encrypted with old key?Disallow messages encrypted with old key? Impractical; due to lag, clients may send messages Impractical; due to lag, clients may send messages

encrypted with old key, and dropping those when someone encrypted with old key, and dropping those when someone joins or parts is unacceptable.joins or parts is unacceptable.

In fact, disallowing messages encrypted with old key turns In fact, disallowing messages encrypted with old key turns this exploit into a DOS attack.this exploit into a DOS attack.

Found and verified exploit only last night, so haven’t yet Found and verified exploit only last night, so haven’t yet contacted SILC people.contacted SILC people.

Page 24: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

DifficultiesDifficulties Most of our difficulties arose from the fact that a server could have multiple clients.Most of our difficulties arose from the fact that a server could have multiple clients. Had to use arrays instead of multisets (which causes the number of states to explode)Had to use arrays instead of multisets (which causes the number of states to explode) Difficult to model network—more specifically, to model the sequential guarantees of TDifficult to model network—more specifically, to model the sequential guarantees of T

CP.CP. Forced to serialize everything.Forced to serialize everything. Murphi doesn’t find exploits with BFS! (Error on our part?)Murphi doesn’t find exploits with BFS! (Error on our part?) Ran into possible Murphi bugs?Ran into possible Murphi bugs? Modeling in Murphi forced us to adapt to its idiosyncracies, and seemingly trivial chanModeling in Murphi forced us to adapt to its idiosyncracies, and seemingly trivial chan

ges to the model changed runtime/correctness drastically; programming in Murphi is ges to the model changed runtime/correctness drastically; programming in Murphi is “brittle.”“brittle.”

Known problem; see “Source-Level Transformations for Improved Formal Verification” Known problem; see “Source-Level Transformations for Improved Formal Verification” (Winters, Hu)(Winters, Hu)

http://www.http://www.cscs..ubcubc.ca/~.ca/~bwintersbwinters/docs.and./docs.and.publspubls/winters./winters.mscmsc.thesis..thesis.pdfpdf A novice user will model a system in a different manner—semantically equivalent, but A novice user will model a system in a different manner—semantically equivalent, but

less efficient for the verification tool—than an expert user would.less efficient for the verification tool—than an expert user would.

Page 25: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

Future workFuture work

Explore other possible models—Explore other possible models—strand space (Lecture 12), PRISM strand space (Lecture 12), PRISM (Lecture 7).(Lecture 7).

Either seems to lead to a more Either seems to lead to a more intuitive model.intuitive model.

However, whether either can model However, whether either can model multiple clients/single server is multiple clients/single server is unclear.unclear.

Page 26: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

ConclusionConclusion

Murphi confirms the necessity of channel kMurphi confirms the necessity of channel key generation part of the examined protocoey generation part of the examined protocol.l.

However, Murphi finds a new (?) attack anyHowever, Murphi finds a new (?) attack anyway.way.

Murphi was not the ideal tool for this protoMurphi was not the ideal tool for this protocol; however, whether a better tool exists icol; however, whether a better tool exists is unclear.s unclear.

Page 27: Analysis of the SILC Protocol with Murphi. Overview What is SILC? What is SILC? Stands for Secure Internet Live Conferencing. Stands for Secure Internet

Fin