Subject: [Lurk] lurk -- February 2018 draft; comments

From: <[email-masked]>
Date: Thu, 24 May 2018 14:39:54 +0000

Dear all,

I’ve had a look at a draft of Lurk that Daniel Migault sent me a while back; it was  dated February 2018.
Here come a mix of comments:

1. I like the aspect of termination of TLS be split into different services  (e.g., network + crypto); I think we should expand on this side.
We should expand both because it’s a nice idea and because I’m a bit worried of weird DoS attacks where one service is left in limbo.

2. I would do away with TLS 1.1.

3. I would introduce a version for TLS 1.3.

4. Let us focus on annex A1 (Lurk/TLS 1.2. RSA mode)

As you know there is this work: , "Content delivery over TLS: a cryptographic analysis of keyless SSL,” by K. Bhargavan, I. Boureanu, P. A. Fouque, C. Onete and B. Richard at 2017 IEEE European Symposium on Security and Privacy (EuroS&P), Paris, 2017, pp. 1-16.
And an attack was shown on Cloudflare’s "Keyless SSL” when run in RSA mode.

The attack rests on the fact that the client sends the “encrypted premaster secret” to the edge server who forwards this to the key server and the *answer the key-server gives back to the edge-server*.
As per Annex A1, it is not clear to me what does the key-server reply with, to the edge-server, in this step. This we need to make clear.

However, in this last step of the LURK handshake in TLS1.2. RSA-mode, the key-server should not *reply to the edge server with the premaster secret* .
Such a reply would be an issue. Namely, if one edge server E1 becomes corrupt this is what it can be used to do.
The attacker collects handshake data (which is over insecure channel) from one session —called session1-- between a client and an edge server E2; this collected data includes the  “encrypted premaster secret” of this session 1.
Then, the attacker used the corrupted edge server E2 to query the key-server on this  “encrypted premaster secret” of session 1. The key server would reply back to the corrupted E2 with the premaster secret  from session1. The attacker who controls E2 and has the handshake data from session1 can now obtain the channel key for session1 and therefore decrypt the record-layer of  session1.

In the work I mentioned above, there are several solutions to this and we can discuss them.
One solution I would suggest, and is very pertinent as a tightening of the design in LURK, is like so:
1. the key-server is involved in the handshake at the beginning and generates a nonce N_S which is sent to the edge server who sends it further to the client, as to is essentially used in the ServerHello from the edge-server to the client.

2. the edge-server sends to the key server (in the step attacked above) not just the “encrypted premaster secret” but also the nonce of the client and the encrypted Finished message by the client. (In this way the key-server can find his nonce N_S inside the finished message and the attacker above is counteracted).

3. the key-server answers with X, where depending on what we wish for then we make X be different things. My top preference would be that X be the "channel keys + the Server-Finished message”. In this way, the edge-server cannot do session-resumption. This is therefore inefficient in practice. So, if we want session resumption, then we can make X be pmk or msk. Of course, we can link this to the options of the handshake..

 (Also, there is the question as to whether we want RSA mode, but this is orthogonal to the above).

5. I did not look at the description TLS 1.2 DHE-mode.
But there we need to be able to describe well the beginning of the handshake as the work I mentioned above also exposes some weird cross-protocol attacks.
I.e.,  the edge-server is corrupted and makes the key-server sign a QUIC hash (with a long TTL inside) and then this edge-server can run for quite some time.
So, we need to pay some attention to this.

Speak soon.

Best,
Ioana Boureanu

Dr. Ioana Boureanu, FHEA

Lecturer in Secure Systems
Department of Computer Science
Surrey Centre for Cyber Security
University of Surrey, Guildford, GU2 7XH
Web: people.itcarlson.com/ioana<http://people.itcarlson.com/ioana>
Linkedin: goo.gl/540OHa<http://goo.gl/540OHa>
T.: +44 1483 683425

---

From: Daniel Migault <[email-masked]>
Date: Fri, 25 May 2018 20:08:06 -0400

Hi Ioana,

Thanks for the feed back. I agree with you that the document should be
focused on TLS 1.2. This is especially true as the designation of the
extension is "tls12". We are also planning to design an extension for TLS
1.3 by next IETF in Montreal.

My understanding of step 1 and 2 is to prevent a passive attacker to send a
request to the key server. The key server is bound to a specific TLS
handshake, by providing an random nonce involved in the handshake (and
checking that random nonce has effectively been used in the exchange). More
specifically, a recorded TLS handshake can only be replayed if the nonce
provided by the key server matches the recorded one.

The two drawback I see with this proposed mechanism are that it requires
two interactions with the key server ( one to send the ServerHello, and one
to retrieve the keys). Then, the handshake_message as well as the Finished
message needs to be send to the key server. The advantage is on the other
hand an explicit binding to a TLS handshake.

The current protocol prevents an exchange to be replayed by generating the
server_random as the output of a hash function. server_random = hash( M )
and the operations performed by the edge server as well as by the key
server. A passive attacker would observed server_random but could not
reverse M. In addition, the server_random carry the time and the key server
does not respond when the server_random is out of a windows. Note that this
latest time control may also be performed in your case.)

I believe that the two mechanisms achieve the same goal with a different
perspective. Explicit biding, versus unability to replay a query based on
cryptographic hash function. While the mechanism is not described in the
appendix, I am wondering if you see any reason to change the mechanism.
That said agree that the appendix should be clarified and updated.

Regarding 3) we effectively prove the master secret. This provides session
resumption for efficiency reasons.

Regarding extended master, the current design does not prevent anti replay
mechanism as the edge server provides the hash of the session. In this
case, there is probably a trade off between perfect forward secrecy versus
efficiency.  I would be happy to know which direction we should take. pfs
would require sending the handshake messages to the key server so the key
server can generate the server_random and the session hash.

Thanks you for your feed backs!

Yours,
Daniel

On Thu, May 24, 2018 at 10:39 AM, <i.boureanu=[email-masked]>
wrote:

> 1. I like the aspect of termination of TLS be split into different
> services  (e.g., network + crypto); I think we should expand on this side.
> We should expand both because it’s a nice idea and because I’m a bit
> worried of weird DoS attacks where one service is left in limbo.
>
> As you know there is this work: , "Content delivery over TLS: a
> cryptographic analysis of keyless SSL,” by K. Bhargavan, I. Boureanu, P. A.
> Fouque, C. Onete and B. Richard at *2017 IEEE European Symposium on
> Security and Privacy (EuroS&P)*, Paris, 2017, pp. 1-16.
> The attack rests on the fact that the client sends the “encrypted
> premaster secret” to the edge server who forwards this to the key server
> and the **answer the key-server gives back to the edge-server**.
> As per Annex A1,* it is not clear to me what does the key-server reply
> with, to the edge-server, in this step*. This we need to make clear.
>
> However, in this last step of the LURK handshake in TLS1.2. RSA-mode, the
> key-server should not *reply to the edge server with the premaster
> secret* .
> Such a reply would be an issue. Namely, if one edge server E1 becomes
> corrupt this is what it can be used to do.
> The attacker collects handshake data (which is over insecure channel) from
> one session —called session1-- between a client and an edge server E2; this
> collected data includes the  “encrypted premaster secret” of this session 1.
> Then, the attacker used the corrupted edge server E2 to query the
> key-server on this  “encrypted premaster secret” of session 1. The key
> server would reply back to the corrupted E2 with the premaster secret  from
> session1. The attacker who controls E2 and has the handshake data from
> session1 can now obtain the channel key for session1 and therefore decrypt
> the record-layer of  session1.
>
> In the work I mentioned above, there are *several solutions* to this and
> we can discuss them.
> *One solution I would suggest, and is very pertinent as a tightening of
> the design in LURK, is like so:*
>
> 1. the key-server is involved in the handshake at the beginning and
> generates a nonce N_S which is sent to the edge server who sends it further
> to the client, as to is essentially used in the ServerHello from the
> edge-server to the client.
>
> 2. the edge-server sends to the key server (in the step attacked above)
> not just the “encrypted premaster secret” but also the nonce of the client
> and the encrypted Finished message by the client. (In this way the
> key-server can find his nonce N_S inside the finished message and the
> attacker above is counteracted).
>
> 3. the key-server answers with *X, *where depending on what we wish for
> then we make *X* be different things. My top preference would be that * X
> *be the "channel keys + the Server-Finished message”. In this way, the
> edge-server cannot do session-resumption. This is therefore inefficient in
> practice. So, if we want session resumption, then we can make* X* be *pmk*
> or *msk*. Of course, we can link this to the options of the handshake..
>
>
> But there we need to be able to describe well the beginning of the
> handshake as the work I mentioned above also exposes some weird
> cross-protocol attacks.
> I.e.,  the edge-server is corrupted and makes the key-server sign a QUIC
> hash (with a long TTL inside) and then this edge-server can run for quite
> some time.
> Web: people.itcarlson.com/ioana
> Linkedin: goo.gl/540OHa
> T.: +44 1483 683425
>
>
>
>
>
>
>
>
> _______________________________________________
> Lurk mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/lurk
>
>

---

From: <[email-masked]>
Date: Sat, 26 May 2018 10:25:34 +0000

Hi Daniel,

Thanks for this.
Please see my answers below.

On 26 May 2018, at 01:08, Daniel Migault <[email-masked]<mailto:[email-masked]>> wrote:

Hi Ioana,

Thanks for the feed back. I agree with you that the document should be focused on TLS 1.2. This is especially true as the designation of the extension is "tls12".

If this were me, I would consider  altogether removing TLS 1.1…, unless there is some very stringent and very well motivate use-case for ot.

We are also planning to design an extension for TLS 1.3 by next IETF in Montreal.

Good. That’s great.

My understanding of step 1 and 2 is to prevent a passive attacker to send a request to the key server.

He is not just passive: first he is passive, then he is active —querying the key-server on an old KE_C = enc_pkS(premaster-secret)

The key server is bound to a specific TLS handshake, by providing an random nonce involved in the handshake (and checking that random nonce has effectively been used in the exchange).

That was one of my suggestions for remedies to the above!
I did not see this in the Feb. draft.

More specifically, a recorded TLS handshake can only be replayed if the nonce provided by the key server matches the recorded one.

And that cannot happen, as I presume the channel between the key-server and the edge-server is secured...

The two drawback I see with this proposed mechanism are that it requires two interactions with the key server ( one to send the ServerHello, and one to retrieve the keys).

Correct. I wrote this in my initial comments. But without this nonce N_S contributed in the ServerHello from the key-server to the edge-server, the querying on an old KE_C is just unstoppable.

Then, the handshake_message as well as the Finished message needs to be send to the key server. The advantage is on the other hand an explicit binding to a TLS handshake.

Not sure what the 1st sentence means, but the 2nd is the crux of the doing this proxied handshake securely: one needs to bind the server in the ServerHello message.

In fact I do not remember as I write this, if the edge-server only sends KE_C back to the Server  at the end of the handshake, but I would make the edge-server send to the key-server [N_C , KE_C , enc(k_C;Client-Finished) ] at the end of the handshake. Like this the key-server, can check that his nonce N_S and *that the nonce N_C* appear in Client-Finished.

By the way, in the above, I call “ N_S” what you call "server-random” and “N_C" what you call "client-random”.

The current protocol prevents an exchange to be replayed by generating the server_random as the output of a hash function. server_random = hash( M ) and the operations performed by the edge server as well as by the key server. A passive attacker would observed server_random but could not reverse M.

Where does this M come from? Who produces it? I could now see it in the February draft.

Let’s do this…: I will just look at the link you sent me to the online, current draft.
Sorry for my commenting potentially on some old draft.

In addition, the server_random carry the time and the key server does not respond when the server_random is out of a windows.

That’s good.
I still would like  to check  that hash(M) thing...

Note that this latest time control may also be performed in your case.)

Correct.

I believe that the two mechanisms achieve the same goal with a different perspective. Explicit biding, versus unability to replay a query based on cryptographic hash function.

I agree, modulo the fact that I still would like  to check  that hash(M) thing...

While the mechanism is not described in the appendix, I am wondering if you see any reason to change the mechanism. That said agree that the appendix should be clarified and updated.

I will check and make comments on the very draft therein.

It will be done on Tuesday.

Regarding 3) we effectively prove the master secret. This provides session resumption for efficiency reasons.

OK. If you want session-resumption, you have to give back “msk”  indeed.

Regarding extended master, the current design does not prevent anti replay mechanism as the edge server provides the hash of the session. In this case, there is probably a trade off between perfect forward secrecy versus efficiency.

I do not follow this phrase above…. Sorry.
I would be happy to know which direction we should take. pfs would require sending the handshake messages to the key server so the key server can generate the server_random and the session hash.

You’re welcome.

I will be back on email and on this on Tuesday.

Best,
Ioana

Yours,
Daniel

On Thu, May 24, 2018 at 10:39 AM, <i.boureanu=[email-masked]<mailto:i.boureanu=[email-masked]>> wrote:
Dear all,

1. I like the aspect of termination of TLS be split into different services  (e.g., network + crypto); I think we should expand on this side..
We should expand both because it’s a nice idea and because I’m a bit worried of weird DoS attacks where one service is left in limbo.

Speak soon.

Best,
Ioana Boureanu

Dr. Ioana Boureanu, FHEA

---

From: Daniel Migault <[email-masked]>
Date: Sat, 26 May 2018 14:14:02 -0400

Hi Ioana,

The current working version is available here:
https://github.com/mglt/draft-mglt-lurk-tls12

The txt and mkd version are in sync. Feel free to update the text.

To briefly respond to your comments:

* TLS1.1 has been removed from this document.
* The way we implement PFS is described in section 4.1.1 "Perfect Forward
Secrecy".
* For the extended master secret, I do not thing the current design is
acceptable as there is no PFS.

I will send an update email to notify the list of the changes performed on
the version available on the git.

Feel free to update the document on github!

Yours,
Daniel

On Sat, May 26, 2018 at 6:25 AM, <i.boureanu=[email-masked]>
wrote:

> On 26 May 2018, at 01:08, Daniel Migault <[email-masked]>
> wrote:
>
> Hi Ioana,
>
> extension is "tls12".
> If this were me, I would consider  altogether removing TLS 1.1…, unless
> there is some very stringent and very well motivate use-case for ot.
>
> He is not just passive: first he is passive, then he is active —querying
> the key-server on an old KE_C = enc_pkS(premaster-secret)
>
> The key server is bound to a specific TLS handshake, by providing an
> random nonce involved in the handshake (and checking that random nonce has
> effectively been used in the exchange).
>
>
> More specifically, a recorded TLS handshake can only be replayed if the
> nonce provided by the key server matches the recorded one.
>
>
> to retrieve the keys).
> Correct. I wrote this in my initial comments. But without this nonce N_S
> contributed in the ServerHello from the key-server to the edge-server, the
> querying on an old KE_C is just unstoppable.
>
> Then, the handshake_message as well as the Finished message needs to be
> send to the key server. The advantage is on the other hand an explicit
> binding to a TLS handshake.
>
>
> Not sure what the 1st sentence means, but the 2nd is the crux of the doing
> this proxied handshake securely: one needs to bind the server in the
> ServerHello message.
>
> In fact I do not remember as I write this, if the edge-server only sends
> KE_C back to the Server  at the end of the handshake, but I would make the
> edge-server send to the key-server [N_C , KE_C , enc(k_C;Client-Finished) ]
> at the end of the handshake. Like this the key-server, can check that his
> nonce N_S and *that the nonce N_C* appear in Client-Finished.
>
> reverse M.
> *Let’s do this…: I will just look at the link you sent me to the online,
> current draft.*
> *Sorry for my commenting potentially on some old draft.*
>
> In addition, the server_random carry the time and the key server does not
> respond when the server_random is out of a windows.
>
>
> That’s good.
> cryptographic hash function.
>
>
> While the mechanism is not described in the appendix, I am wondering if
> you see any reason to change the mechanism. That said agree that the
> appendix should be clarified and updated.
>
>
> efficiency.
> I would be happy to know which direction we should take. pfs would require
> sending the handshake messages to the key server so the key server can
> generate the server_random and the session hash.
>
>
>
> On Thu, May 24, 2018 at 10:39 AM, <i.boureanu=40surrey.ac.
> [email-masked]> wrote:
> Dear all,
>
> services  (e.g., network + crypto); I think we should expand on this side..
>
> Fouque, C. Onete and B. Richard at 2017 IEEE European Symposium on Security
> and Privacy (EuroS&P), Paris, 2017, pp. 1-16.
> and the *answer the key-server gives back to the edge-server*.
> As per Annex A1, it is not clear to me what does the key-server reply
> with, to the edge-server, in this step. This we need to make clear.
>
> key-server should not *reply to the edge server with the
> premaster secret* .
> one session —called session1-- between a client and an edge server E2;
> this collected data includes the  “encrypted premaster secret” of this
> session 1.
> not just the “encrypted premaster secret” but also the nonce of the
> client and the encrypted Finished message by the client. (In this way the
> 3. the key-server answers with X, where depending on what we wish for then
> we make X be different things. My top preference would be that X be the
> "channel keys + the Server-Finished message”. In this way, the edge-server
> cannot do session-resumption. This is therefore inefficient in practice.
> So, if we want session resumption, then we can make X be pmk or msk. Of
> course, we can link this to the options of the handshake..
>