00:00:00.000-->00:00:13.780 >>Alright so please join me in welcoming Alfonso and Alejo. [applause from audience] >>Hi 00:00:13.780-->00:00:18.752 Defcon. Our presentation today is about TLS 1 point 3 which is going to be the next major 00:00:18.752-->00:00:25.659 version of TLS which will be date release soon. It has a new feature which is call 0-RTT. 00:00:25.659-->00:00:32.599 Zero Round Trip Time er Resumption which it speeds up the session resumption. Eh 00:00:32.599-->00:00:39.506 however it has some security impacts. This is a known issues that has been acknowledged by uh 00:00:39.506-->00:00:47.547 the protocol specification. So I’ll attempt today One is to give you a better understanding 00:00:47.547-->00:00:53.987 of the TLS 1 point 3 and this new feature 0-RTT. Two is to raise awareness across the 00:00:53.987-->00:01:00.527 audience of the potential risks of using 0-RTT and three is to eh provide you with 00:01:00.527-->00:01:06.466 recommendations about how to mitigate those risk of using 0-RTT. Finally um minor minor 00:01:06.466-->00:01:12.773 disclaimer what we are going to discuss here is just our own opinion and does not reflect the 00:01:12.773-->00:01:23.317 view of our employer. >>Hi Defcon. My name is Alfonso Garcia Alguacil I work for Cisco 00:01:23.317-->00:01:29.589 as a senior security consultant. I mostly do penetration testing and some research on development 00:01:29.589-->00:01:36.596 focused on offensive security. And I am glad to be here for first time. [applause from 00:01:36.596-->00:01:46.239 audience] >>Hi my name is Alejo Murillo Moya I am a senior security consultant at Cisco. I 00:01:46.239-->00:01:52.813 am the red team lead for Emir, Europe, Middle East, Africa, and Russia. I have eh more than 10 00:01:52.813-->00:01:57.584 years experience in the security field. Um as Alfonso said we are really happy to be here at 00:01:57.584-->00:02:06.626 Defcon. So and once we have introduce ourselves, let’s introduce TLS 1 point 3. So 00:02:06.626-->00:02:13.100 first a bit of history. So 4 years ago a working group was created. And that working group 00:02:13.100-->00:02:20.574 had a mission. That mission was to develop the new version of TLS, TLS 1 point 3. There has 00:02:20.574-->00:02:26.546 been 28 iterations of the protocol specification and as you can imagine that has been a 00:02:26.546-->00:02:32.753 long journey. So now with this introduction let’s move on to how about some of the good 00:02:32.753-->00:02:37.124 things that TLS is going to bring to us 1 point 3. One of the good things is it has follow 00:02:37.124-->00:02:43.296 the keep simple approach. So only 5 ciphers are going to be defined on the TLS 1 point 3 00:02:43.296-->00:02:47.934 specification. That means that the implementation is going to be easier and also that will 00:02:47.934-->00:02:54.107 reduce the complexity of the protocol. If we compare these to previous versions of TLS that’s 00:02:54.107-->00:02:59.413 a huge improvement because if you recall those versions previous version had dozens of 00:02:59.413-->00:03:05.085 ciphers. Another good thing is that TLS 1 point 3 is not going to be vulnerable to previous 00:03:05.085-->00:03:11.725 known attacks against previous versions of TLS. So for example you can think about eh RC 4, 00:03:11.725-->00:03:17.364 RSA, synchronization model or even completion attacks. Good luck finding them on TLS one 00:03:17.364-->00:03:22.869 point three because you are not going to find them. Also another good thing is that it supports 00:03:22.869-->00:03:28.408 perfect forward secrecy by default. It’s by default enabled and that-that-that’s not going 00:03:28.408-->00:03:34.514 to be optional like in previous versions of TLS. Just a quick eh recap of forward secrecy. 00:03:34.514-->00:03:41.288 Imagine that an attacker is able to stole all your secret communications. Perfect forward 00:03:41.288-->00:03:48.261 secrecy is going to ensure that even if the attacker managed to steal the server private keys he 00:03:48.261-->00:03:55.102 wouldn’t be able to decrypt your secret communications because ephemeral keys were used. Also 00:03:55.102-->00:04:01.475 in in TLS 1 point 3 protocol went through some formal critical analysis which 00:04:01.475-->00:04:05.946 basically it took in the protocol specification, it’s machinist state, its security 00:04:05.946-->00:04:10.183 assumption and those were analyzed and some weaknesses were identified. With that 00:04:10.183-->00:04:19.693 information the protocol was refined and improved before it’s final release. Let’s talk now 00:04:19.693-->00:04:28.235 about the compatibility issues. So last year Chrome and Firefox were doing some field tests and 00:04:28.235-->00:04:32.038 what they found is that around 5 percent of the of the users were not able to connect to the 00:04:32.038-->00:04:38.278 websites using TLS 1 point 3. They analyzed the data and they found that that behavior was 00:04:38.278-->00:04:45.685 caused by something called meter boxes. A meter box is a corporate networking device that 00:04:45.685-->00:04:51.825 is inspecting all intercepting ACTPS. What happened in the end is that they made some 00:04:51.825-->00:04:57.931 modifications to the protocol specifically they changed the TLS 1 point 3 handshake in order 00:04:57.931-->00:05:04.437 to looks like one looks like a TLS one point 2 session resumption and that fixed issues 00:05:04.437-->00:05:12.579 with the eh the meter boxes. So at the end the protocol it might not be as pure as it could be 00:05:12.579-->00:05:21.788 but given the circumstances I think it was the right thing to do. Then let’s focus on the 00:05:21.788-->00:05:27.961 topic for this conversation oh this presentation sorry. So uh one of the things that the 00:05:27.961-->00:05:34.100 working group wanted to do is to have a faster TLS and that’s especially important on mobile 00:05:34.100-->00:05:38.672 networks you to you to the latest scene. So 0-RTT was created. 0-RTT is a system 00:05:38.672-->00:05:46.880 resumption that can push data to a server also called earl-early data. Basically from the 00:05:46.880-->00:05:53.920 importance of the 0-RTT is that it should have a session ticket, the message, and also the early 00:05:53.920-->00:05:58.959 data will be encrypted using up preshared game. And then when the server receive that message 00:05:58.959-->00:06:05.265 if he can decrypt it he will process that data. So it seems that 0-RTT makes things faster 00:06:05.265-->00:06:11.905 because it’s pushing data to a server. However it has some security implications. So which 00:06:11.905-->00:06:18.211 are those security implications. The first one is the win lose perfect forward secrecy on 0-RTT 00:06:18.211-->00:06:25.018 messages. And the second thing is that 0-RTT messages could be vulnerable to replay attacks. 00:06:25.018-->00:06:31.424 Yes and that is something really important because we know TLS and replay attacks was never one 00:06:31.424-->00:06:40.734 of our concerns. But that’s going to change with 0-RTT. So you may be wondering hopefully I 00:06:40.734-->00:06:45.972 have convinced you and take your attention on the previous slide but maybe you can say that okay 00:06:45.972-->00:06:52.279 you’re not going to use TLS 1 point 3 or that TLS isn’t yet an official internet standard which 00:06:52.279-->00:06:59.286 is true. But however you should at least I would like to convince you because TLS is 00:06:59.286-->00:07:04.324 going to be present in your browsers implementations and CDNs right now. So for example 00:07:04.324-->00:07:09.696 if you look at Firefox you will see that Firefox has been supporting TLS 1 point 3 and 00:07:09.696-->00:07:16.670 0-RTT by default for months. Also the uh Chrome is supporting TLS 1 point 3. If we move to the 00:07:16.670-->00:07:23.076 implementations we can see that OpenSSL on the next version of OpenSSL which is going to be 1 00:07:23.076-->00:07:29.316 point 1 point 1 is some prereleases that those which report 1 point 3 with 0-RTT. 00:07:29.316-->00:07:35.021 Same goes with BoringSSL. And maybe you have heard the news but Facebook has just released 00:07:35.021-->00:07:42.462 their own implementation of TLS 1 point 3 which also supports 0-RTT. And then we have the CDNs 00:07:42.462-->00:07:49.069 and eh the CDNs may be supporting or trying to be supporting the 0-RTT also. 00:07:49.069-->00:07:54.474 That’s going back a bit uh face about Facebook on their implementation they mention an 00:07:54.474-->00:07:59.012 acknowledgment that they are receiving around 50 percent of all the traffic they are 00:07:59.012-->00:08:05.251 receiving is using TLS 1 point 3 which is a lot. So that means that TLS 1 point 3 is already 00:08:05.251-->00:08:13.626 with us and its use is going to be increased over the upcoming weeks and months. So let’s dig 00:08:13.626-->00:08:18.398 more I mean more about TLS specifically in the TLS 1 point 3 handshake. So first the client 00:08:18.398-->00:08:23.603 will release out client hello message to the server making some educated guesses about 00:08:23.603-->00:08:29.109 which options the server will prefer. The server will receive the message and then send will 00:08:29.109-->00:08:34.414 send back the required cryptographic material in order to complete that handshake 00:08:34.414-->00:08:40.286 including the certificate on the proof that he has the secret keys on the certificate. The 00:08:40.286-->00:08:47.293 client will receive the message where will it will verify that the certificate is is valid in 00:08:47.293-->00:08:53.032 order to ensure he’s talking with the right endpoint. He will also check for that proof of 00:08:53.032-->00:08:57.937 knowledge and then it will send out finished message saying ok we have finished the the TLS 00:08:57.937-->00:09:03.977 handshake list let’s uh let’s talk basic communications. And as you can see here after the 00:09:03.977-->00:09:09.015 TLS 1 point 3 handshake has been completed application data can be transmitted securely. We have 00:09:09.015-->00:09:15.321 also added eh the new system ticket message because that’s important and will be used in 00:09:15.321-->00:09:22.362 the future. So now let’s discuss the 0-RTT message which is used to session to do session 00:09:22.362-->00:09:28.368 resumptions. So imagine that we have a browser that needs to resume the previous established 00:09:28.368-->00:09:32.472 session with our web application. What it’s going to do is it’s going to create a 00:09:32.472-->00:09:38.678 security message. Are interesting to us is that contain a session ticket and it 00:09:38.678-->00:09:44.084 will contain data that is going to be pushed to the server that will be encrypted using a 00:09:44.084-->00:09:50.123 breacher key. That will be sent to the server. The server will process that information. We 00:09:50.123-->00:09:55.462 will try we will check if the session ticket is a valid one and also we’ll try to decrypt 00:09:55.462-->00:10:00.867 the data. If the decryption is successful it will will push that data over to a web 00:10:00.867-->00:10:07.006 application and then it will send the response back to the to the client including a new 00:10:07.006-->00:10:13.079 session ticket. And then this client receive the message and will say ok we have done this 00:10:13.079-->00:10:17.951 session resumption then I’m not going to send you any more early data let’s continue the 00:10:17.951-->00:10:26.326 conversation. And as you can see there the application data will be sent securely. So hopefully 00:10:26.326-->00:10:31.798 eh as you can see it may be feasible to do replay attacks and that’s because the only 00:10:31.798-->00:10:36.336 thing an attacker needs to have is to have that message that can be replayed to the server and 00:10:36.336-->00:10:41.541 the server will just see that is has a valid session ticket and that key can decrypt the data. 00:10:41.541-->00:10:49.115 So let’s see how a real attack may looks like. So imagine that we have a banking application 00:10:49.115-->00:10:54.721 and there is a customer that is using the banking application because he wants to do a money 00:10:54.721-->00:10:59.125 transfer to one of his friends. However he doesn't know that this friend is not really 00:10:59.125-->00:11:04.531 trustworthy because he’s the attacker that is on the diagram. Okay so the customer when he 00:11:04.531-->00:11:11.471 clicks submit on the browser form the processor is going to create a 0-RTT eh message that 00:11:11.471-->00:11:17.977 will include that HTTP request of transfer funds and that message will have a session 00:11:17.977-->00:11:23.950 ticket and it is encrypted with a pressure key. Oops sorry. That message will be sent to the 00:11:23.950-->00:11:29.355 server in this case the attacker is not going to do anything with it. He will only copy the 00:11:29.355-->00:11:37.530 message because he wants to replay later on. So then the server will receive the message. 00:11:37.530-->00:11:42.302 He will decrypt eh because he has the right brecher key and will send the message out to the 00:11:42.302-->00:11:47.440 to the web application which will perform the first money transfer. And then the server 00:11:47.440-->00:11:57.016 will send back the response to the browser. So what would happen if the attacker replayed 00:11:57.016-->00:12:01.287 that original message let’s see. So as that message has the right session ticket and it’s 00:12:01.287-->00:12:06.125 encrypted with the right pressure key the server will receive it process it send to 00:12:06.125-->00:12:11.598 the web application which would affirm the second money transfer. And then as you can 00:12:11.598-->00:12:17.136 see the attacker can do this as many ti-times as he wants he just needs to keep replaying 00:12:17.136-->00:12:25.078 that original message again and again. So is it everything that’s bad that this looks like? 00:12:25.078-->00:12:32.018 Not really. Ok the working group put a lot of effort in order to describe this potential security 00:12:32.018-->00:12:37.090 risks and security implications regarding the 0-RTT functionality and they also 00:12:37.090-->00:12:42.528 added on within the RFC their recommended protections and their mitigations. One of those 00:12:42.528-->00:12:48.835 two protections is single-use tickets. With single-use tickets the server is able to prevent 00:12:48.835-->00:12:56.175 replay attacks because it has a database of fresh session tickets. How it work is when the 00:12:56.175-->00:13:03.783 server sends a session ticket to the browser, it will allow to his database and when he receive 00:13:03.783-->00:13:08.554 a 0-RTT message with a session ticket he will maybe find that the session ticket is on the 00:13:08.554-->00:13:14.460 database and then he will accept the message and then will remove that session ticket from the 00:13:14.460-->00:13:19.632 database of fresh session tickets. The next time he receive a second message, 0-RTT 00:13:19.632-->00:13:23.036 message, he will check again that session ticket and will found that it's not longer in 00:13:23.036-->00:13:29.175 the database and then he will reject the message because it means it is a replay attack. So 00:13:29.175-->00:13:34.347 it seems that this protection is quite good however it has one potential issue and it’s how you 00:13:34.347-->00:13:41.521 keep that database synchronized in medium or big environments and the solution here it so 00:13:41.521-->00:13:47.827 synchronize the database across multiple systems with allowing and creating an opportunity 00:13:47.827-->00:13:54.534 window that the attacker can take advantage of. Another protection will be the 00:13:54.534-->00:13:59.372 client-hello recording. Same-similar to before in that the server will keep a list of 00:13:59.372-->00:14:05.712 all the client hellos he is receiving. So the first time that he receive a 0-RTT message 00:14:05.712-->00:14:11.384 he will start that client-hello on his list. And if he receive the message again he will see 00:14:11.384-->00:14:17.890 that that client-hello has been already processed. So he will create that 0-RTT message. Same 00:14:17.890-->00:14:24.163 as before the challenge here is hows you synchronize that list or uh global uh distributed 00:14:24.163-->00:14:31.437 environment. Another mitigation that this is specified within the RFC is called freshness 00:14:31.437-->00:14:38.544 checks. So when the client is sending 0-RTT messages to the server it’s including eh a time 00:14:38.544-->00:14:43.683 stamp. Which is basically from the perspective of the client when that message was sent. So 00:14:43.683-->00:14:51.324 what the server can do is he can just forget any messages that has a life outside an acceptable 00:14:51.324-->00:14:58.431 time frame window. Another protection that is mentioned in the RFC sample application 00:14:58.431-->00:15:04.470 profiles. And according to the eh TLS 1 point 3 specification to the RFC let me see if I can 00:15:04.470-->00:15:10.109 quote it properly. Application protocols must not use 0-RTT data unless it has a profile 00:15:10.109-->00:15:17.316 that defines its use. Which basically means that the application should be able to 00:15:17.316-->00:15:23.055 define which functionality or which paths are going to be exposed over 0-RTT. Application 00:15:23.055-->00:15:29.529 profiles is eh RFC which is related to TLS TLS but it’s still a work in progress. And 00:15:29.529-->00:15:37.403 after that we can have different eh other types or protection some mitigations. For example 00:15:37.403-->00:15:41.941 OpenSSL has decided to have separated APIs for the traditional TLS and this new 00:15:41.941-->00:15:48.815 0-RTT eh eh TLS in the future. And that means that if an operator wants to use 0-RTT it’s 00:15:48.815-->00:15:54.187 because he really wants to do it because he ideally knows what are the potential security 00:15:54.187-->00:16:02.228 risks. Other security controls can be added also at the browser or or at the server level. Like 00:16:02.228-->00:16:07.033 for example not a low end 0-RTT on eh on a low end 0-RTT messages on ACTP safe methods 00:16:07.033-->00:16:15.775 which would be GET help or option methods. Finally what also can be done is just for 00:16:15.775-->00:16:21.047 example eh for the requests that are being sent to the work application make sure that those 00:16:21.047-->00:16:26.953 requests are idempotent. What means that. It means that the final state of the work 00:16:26.953-->00:16:31.624 application or back end it will be the same independently or how many times you receive the same 00:16:31.624-->00:16:38.397 requests. If it’s once or multiple times it shouldn't matter. Now let’s see here a 00:16:38.397-->00:16:44.670 table that we have put together of after our research of what we have seen so far. So the first 00:16:44.670-->00:16:49.775 two columns are basically related to the 2 protections that are mentioned on the other 00:16:49.775-->00:16:53.546 screen, single-use tickets and client-hello recordings. You don’t need to implement both you 00:16:53.546-->00:16:58.951 just need to implement one of those two. Then the third column is for application profile and 00:16:58.951-->00:17:05.124 finally we have another fourth column for interesting notes. So you can see here OpenSSL is 00:17:05.124-->00:17:11.430 using single-use tickets and as I mentioned before it has different APA in order to handle 00:17:11.430-->00:17:20.206 the 0-RTT and normal TLS. BoringSSL has so far 0-RTT but is disabled by default. 00:17:20.206-->00:17:25.845 Cloudflare, cloudflare is working to prevent single-use tickets. They have implemented 00:17:25.845-->00:17:32.251 application profiles using HTTP headers and they have 0-RTT disabled by default. You can 00:17:32.251-->00:17:36.956 enable it but you need to go to the dashboard and doing that explicitly. And if you enable 00:17:36.956-->00:17:47.700 that 0-RTT will be could only be enabled on HTTP safe methods like GET. And they added on top 00:17:47.700-->00:17:53.005 of that another protection which is that they are only allowing GET eh methods without 00:17:53.005-->00:17:59.745 parameters for 0-RTT messages. And we have Chrome. Chrome has a no 0-RTT at the moment support. 00:17:59.745-->00:18:06.285 Um Firefox is support 0-RTT by default unless we can see here it will only send 0-RTT messages 00:18:06.285-->00:18:17.363 on safe methods in this case GET requests will be a rare 0-RTT but not most requests. >> Okay 00:18:17.363-->00:18:23.636 so we are going to show the potential impact of 0-RTT when an attacker is in the middle of 00:18:23.636-->00:18:30.943 the communications path between the web browser and the web server. Cus both the web browser 00:18:30.943-->00:18:39.952 and the web server will have TLS 1 point 3 and 0-RTT enabled. As uh web browser we are going to 00:18:39.952-->00:18:50.763 use Firefox with HTTP 2 enabled which is already enabled by default. As a victim application 00:18:50.763-->00:18:57.703 we are going to use our own money application which uses GET requests with REST format to 00:18:57.703-->00:19:08.347 perform a money transfer. Firefox only uses 0-RTT for safe methods. However, how many 00:19:08.347-->00:19:13.219 applications use GET to perform actions which should be made using POST or other methods but 00:19:13.219-->00:19:18.424 we see a lot of them are performing eh web service assessments. In a normal 00:19:18.424-->00:19:28.401 situation in which the web browser well in which there is not any attacker in in the 00:19:28.401-->00:19:36.308 middle of the communications the web browser will only show a message or will only sorry send 00:19:36.308-->00:19:45.785 a request using 0-RTT. Um the first one. Then the TLS connections would be established 00:19:45.785-->00:19:53.759 and the following request will be sent using these create created secure channel. Until 00:19:53.759-->00:20:00.866 the keeper lifetime times out. So this is why we think that it is highly unlikely that an 00:20:00.866-->00:20:08.374 attacker could catch attempting requests to be replaced only with passive techniques. But 00:20:08.374-->00:20:23.456 let’s see this with a video. As I mentioned before we are going to use the latest Firefox 00:20:23.456-->00:20:40.706 version. This is the tool that we created to test the replay attacks. The tool is in the 00:20:40.706-->00:20:48.214 middle of the communications and uh in this first mode it will only show our message when 0-RTT 00:20:48.214-->00:20:57.756 is detected. The tool is not uh HTTPS proxy it is only a TCP proxy which means that it is not 00:20:57.756-->00:21:06.365 the TLS termination point and therefore it cannot see there an encrypted data. However it can 00:21:06.365-->00:21:13.839 see the TCP the TLS packet hellos and using this information it can detect when 00:21:13.839-->00:21:40.099 0-RTT is used. This is our banking application. The domain points directly to the web 00:21:40.099-->00:21:47.907 server. And as you can see the certificate was correctly validated by the web browser. 00:21:47.907-->00:22:10.763 Will not note that we are performing the mining data. As you Requests nothing is shown by 00:22:10.763-->00:22:13.732 the tool because nothing is sent using 0-RTT. As seen on the timer we are forward 3 minutes 00:22:13.732-->00:22:52.137 we thought perform any requests to consume the keeper lifetime. Now that the keeper lifetime has 00:22:52.137-->00:22:58.477 been consumed the first request and only the first request that the user performs will be sent 00:22:58.477-->00:23:09.955 using 0-RTT. This is the request and this request could be potentially replaced. But the 00:23:09.955-->00:23:17.363 next request until the keeper lifetime times out again will be sent using the established 00:23:17.363-->00:23:38.717 secure uh channel. This is why we think that uh passive attack is unlikely to work. Ok but can 00:23:38.717-->00:23:49.561 we control when the web browser uses 0-RTT? So can we control this attack? The response is 00:23:49.561-->00:23:56.869 Let’s see This is the TLS handshake that Alejo already explained. After a full TLS 00:23:56.869-->00:24:07.680 handshake or a 0-RTT handshake we want the server to receive the HTTP request and the browser 00:24:07.680-->00:24:17.456 to receive the server response. After If we don’t Anything the next requests will be sent using 00:24:17.456-->00:24:27.800 the established secure channel like we show before. However we can finish the connection at the 00:24:27.800-->00:24:35.574 PCP layer by sending things or recent packets and then the browser will send the next HTTP 00:24:35.574-->00:24:42.715 request using 0-RTT. If we do this for every new TLS connection um there will be much 00:24:42.715-->00:24:50.089 more chances that the attacker can replay the request that he wants because the most part of 00:24:50.089-->00:25:05.904 the request will be sent using 0-RTT. Let’s see this with another video. Well now the tool 00:25:05.904-->00:25:52.751 is configured to to do this technique. Now its hosted behind Cloudflare with 0-RTT enabled. 00:25:52.751-->00:26:01.293 As you can see now the most part of the requests are sent using uh 0-RTT. Due to the use of 00:26:01.293-->00:26:10.502 HTTP2 some of the GET requests are not really sent over 0-RTT. Only the HTTP2 preface is sent 00:26:10.502-->00:26:18.043 over it under real requests is sent later in the established secure channel. However we have 00:26:18.043-->00:26:27.286 noticed that for the requests initiated by ajax the most part of the of them are sent using 00:26:27.286-->00:26:47.339 0-RTT. Now we perform a money transfer of 2 dollars. But we don’t want to replay it just to 00:26:47.339-->00:27:08.861 demonstrate that we are not tricking you. And as you can One money transfer. Now we perform a 00:27:08.861-->00:27:25.310 money transfer of 3 dollars. And this time we want to replay it 3 times.And refreshing the 00:27:25.310-->00:27:34.453 transaction list it can be seen that the attack was successful because what only the user only 00:27:34.453-->00:27:50.536 sent [applause from audience] one money transfer but we have 4. Ok but now we have seen that 00:27:50.536-->00:27:54.439 uh replay attack can work against a firewall application which is hosted behind the 00:27:54.439-->00:28:03.048 server doesn’t implement single-use ticket or client-hello. What What about 00:28:03.048-->00:28:13.492 Server that Met these Replay techniques Is it possible to to replay it? Well as you can 00:28:13.492-->00:28:22.034 imagine the response is yes. And I’m going to try to explain how. In this situation the web 00:28:22.034-->00:28:32.844 browser will send um money transfer request using 0-RTT. The attacker intercepts it and 00:28:32.844-->00:28:44.523 sends it to the web server. The web server will accept it because uh it is a fresh 0-RTT. 00:28:44.523-->00:28:52.164 At this moment the web browser is waiting for the server confirmation that the 0-RTT was 00:28:52.164-->00:29:08.814 accepted. But the attacker send-send This message The attacker then While opening a 00:29:08.814-->00:29:15.454 new TCP connection he sends again the same 0-RTT packets to the web browser and to the web 00:29:15.454-->00:29:23.161 server sorry. And now the web server rejects it because it is implementing single-use ticket 00:29:23.161-->00:29:32.070 and simple reply like this one doesn’t work because it is a non-fresh 0-RTT. The attacker 00:29:32.070-->00:29:40.946 now sends back the rejection to the web browser. From the point of view of the web browser the 00:29:40.946-->00:29:51.289 0-RTT was rejected and no money transfer was made. However in reality one money transfer was 00:29:51.289-->00:30:00.599 made. According to the TLS 1 point 3 are unseen after a 0-RTT rejection a full handshake has 00:30:00.599-->00:30:10.776 to be done. So the web browser and the web server eh do eh do the full handshake and after 00:30:10.776-->00:30:20.519 that the web browser seems it thinks that the um money transfer was not made at the 00:30:20.519-->00:30:31.029 first time. Now it repeats the request the HTTP request and the the web server accept it because 00:30:31.029-->00:30:40.739 now um it is not using 0-RTT it is using the established secure channel. So after the attack the 00:30:40.739-->00:30:48.313 from the point of view of the web browser only one money transfer has been made but um 00:30:48.313-->00:30:58.256 what really has happened is that 2 money transfer has been made. With this we can basically 00:30:58.256-->00:31:08.900 perform only um one replay. But at least we can perform one replay against a server which 00:31:08.900-->00:31:29.454 has eh this anti replay protections. Let’s see this in a new video. The tool is now 00:31:29.454-->00:31:36.695 configured to perform this last replay technique in combination with the killing technique to of 00:31:36.695-->00:31:50.142 0-RTT. The banking application is now hosted behind reverse proxy which has enabled 0-RTT. 00:31:50.142-->00:31:57.916 This reverse proxy uses OpenSSL the previous version which implements single-use ticket. 00:31:57.916-->00:32:25.977 Like in the previous video we perform a money transfer of 2 dollars without replying it 00:32:25.977-->00:32:34.553 replaying it sorry. And refreshing the transactions list can be seen that only one money 00:32:34.553-->00:32:42.761 transfer was made because we didn’t perform any replay attack. However now we perform 00:32:42.761-->00:32:55.774 the money transfer of 3 dollars and we perform this last replay technique in which the browser 00:32:55.774-->00:33:10.255 helps us. And as you can see here instead of having eh one money transfer we have 2 money 00:33:10.255-->00:33:23.768 transfers. So the attack was successful. K this brings me to tell you that we are going to 00:33:23.768-->00:33:32.711 release this tool and uh if you want to use it you have to redirect on how the traffic from 00:33:32.711-->00:33:43.755 the web browser to the tool uh as you saw in the in the demos we were using attacks for the 00:33:43.755-->00:33:52.097 HTTP requests like for example send money. The attacks are based on the encrypted packets 00:33:52.097-->00:34:01.306 lens and uh you can create them in the monitor mode of the tool. The tool eh also provide 2 other 00:34:01.306-->00:34:07.579 modes to perform the 2 different replay techniques and also with the kill parameter it performs 00:34:07.579-->00:34:18.089 the killing technique to force the web browser to use 0-RTT and all. The tools will be available 00:34:18.089-->00:34:38.009 now at this uh github. [applause from audience] >>So let’s talk about the side effects of 0-RTT. 00:34:38.009-->00:34:43.248 When we deployed previous version of TLS how the data has been transmitted is totally 00:34:43.248-->00:34:50.255 transparent to the web application. However with 0-RTT that’s gonna change because it 00:34:50.255-->00:34:56.361 creates a dependency between the TLS and the application layer which was not present before. So 00:34:56.361-->00:35:01.633 that means that the application will need to to know if 0-RTT’s been used so he can prevent 00:35:01.633-->00:35:08.340 replay attacks. And at the end the ultimate responsibility will be on the application itself to 00:35:08.340-->00:35:14.579 prevent a replay attacks and you can ask how we can do that. Let’s see what we can do. So 00:35:14.579-->00:35:23.288 first thing you can do and should do is disable 0-RTT. And only enable it if you are really 00:35:23.288-->00:35:28.126 really really sure of what you’re doing. Other things that can be done is for example try 00:35:28.126-->00:35:34.099 to make sure that your application is anti-replay safe but that can be uh quite a 00:35:34.099-->00:35:39.404 challenge. But you will learn what you can do is apply a strict cross-site request 00:35:39.404-->00:35:45.110 forgery policy not only at the session level, not only at the form level but at the request 00:35:45.110-->00:35:54.619 level. Another mitigation that you can eh that you can deploy is to migrate those GET 00:35:54.619-->00:35:59.324 reg-requests that are not eh replay safe to POST requests and why. Because most likely the 00:35:59.324-->00:36:05.063 browsers are not gonna sent 0-RTT data on POST requests. Also you eh can make sure 00:36:05.063-->00:36:11.202 regarding eh the web services and espec-especially with the REST eh web services eh you need 00:36:11.202-->00:36:17.709 to make sure that those are developed properly and that GET, POST, boot and delete are used 00:36:17.709-->00:36:22.647 properly and with regarding the GET methods you need to make sure that those sessions are 00:36:22.647-->00:36:30.055 either read only or idempotent. And finally you should deploy a strict application profile which 00:36:30.055-->00:36:36.928 basically defines which are the eh functionality that you really really want to expose over 00:36:36.928-->00:36:51.242 0-RTT. >> To finish this presentation we have some uh takeaways. The first one is that 00:36:51.242-->00:37:00.085 TLS 1 point 3 is awesome and all of you should use it but take care with 0-RTT. The second one 00:37:00.085-->00:37:11.262 is that your application you should be 0-RTT aware to prevent side effects. And the last one 00:37:11.262-->00:37:17.869 is that maybe you need to change your application of your server configuration in order to 00:37:17.869-->00:37:25.543 prevent replay attacks.Thank you so much and if you have any questions we will be around. 00:37:25.543-->00:00:00.000 [applause from audience]