1 00:00:00,000 --> 00:00:03,960 Next up is Guy and Ezra with Jarvis Never Saw It Coming, 2 00:00:04,160 --> 00:00:06,800 hacking machine learning in speech, text, and face 3 00:00:06,800 --> 00:00:11,620 recognition and everywhere else. Thank you very much. 4 00:00:17,720 --> 00:00:21,380 First of all, thank you for having us and we'll do our best 5 00:00:21,380 --> 00:00:24,740 to share the information that we have with you. It's a bit awkward 6 00:00:24,740 --> 00:00:27,080 because I have a clicker in one hand and a mic in the other so I 7 00:00:27,080 --> 00:00:30,780 can't really gesture, so I'll do my best. First and foremost, 8 00:00:31,100 --> 00:00:33,460 everybody is required to read and sign off of this legal 9 00:00:33,460 --> 00:00:38,940 disclaimer. Everybody did? Excellent. Okay. Second 10 00:00:38,940 --> 00:00:42,020 disclaimer, even more important, we really haven't harmed any 11 00:00:42,020 --> 00:00:46,680 system here, sort of, but we'll cover that in a couple of slides. 12 00:00:48,160 --> 00:00:52,120 To introduce us, I'm Guy and this is my good friend Ezra. We are 13 00:00:52,120 --> 00:00:56,060 both co-founders and participants in the B-Sides 14 00:00:56,060 --> 00:00:57,060 Tel Aviv and various other organizations that are 15 00:00:57,080 --> 00:00:59,240 involved in B-Sides community activities as well as in the 16 00:00:59,240 --> 00:01:03,820 local DEF CON chapter in Israel and we are working together for 17 00:01:03,820 --> 00:01:08,360 almost a year now on a couple of very exciting projects. Some of 18 00:01:08,360 --> 00:01:12,060 those results we want to share with you today. So, the first 19 00:01:12,060 --> 00:01:16,140 thing that I want to mention is that nothing that anyone is 20 00:01:16,140 --> 00:01:20,520 doing is doing by himself. So, throughout the slides, I'll 21 00:01:20,520 --> 00:01:23,380 switch hands, throughout the slides you will be able to see 22 00:01:23,380 --> 00:01:26,740 short links at the bottom right. This is the reference if you want 23 00:01:26,740 --> 00:01:27,060 to, if you want to, if you want to, if you want to, if you want to, 24 00:01:27,060 --> 00:01:28,720 if you want to, if you want to dig deeper or to find more 25 00:01:28,720 --> 00:01:32,700 information and to find credits to whomever was behind this. But 26 00:01:32,700 --> 00:01:35,900 the basic point is nobody is working alone, we're all working 27 00:01:35,900 --> 00:01:38,700 on top of other people's work and credit should be given where 28 00:01:38,700 --> 00:01:43,720 credit is due. So, how did we get here? Last year, we had a 29 00:01:43,720 --> 00:01:46,520 couple of pretty good conversations around DEF CON 30 00:01:46,520 --> 00:01:50,100 with a couple of people and the idea came about, well, 31 00:01:50,180 --> 00:01:53,260 everybody's talking about the latest buzzword and that is AI 32 00:01:53,260 --> 00:01:56,620 and how can we actually do something with AI systems, our 33 00:01:56,620 --> 00:02:01,480 AI system even secure. And through that conversation, we came to the realization that nobody 34 00:02:01,480 --> 00:02:07,140 really thought about what security of AI system really means in that context. Everybody is doing 35 00:02:07,140 --> 00:02:11,780 lots of AI work. Everybody is running forward pretty fast. But securing those systems against 36 00:02:11,780 --> 00:02:16,800 attacks, what kind of attacks are even possible, is something that is kind of an unexplored 37 00:02:16,800 --> 00:02:24,000 field. So we are going to discuss those kinds of attacks, a bit maybe about what kind of 38 00:02:24,000 --> 00:02:31,720 mitigations, how you go methodologically about constructing such attacks, and what types or 39 00:02:31,720 --> 00:02:36,340 what the landscape looks like and what we feel is going to be the most important ones in the 40 00:02:36,340 --> 00:02:41,000 future to come. Whenever you see something highlighted in yellow, just like here, that 41 00:02:41,000 --> 00:02:46,340 means that this is something you should be paying extra close attention to. We are not going 42 00:02:46,340 --> 00:02:53,060 to release zero days today. We are not going to do very surprising disclosures. It might be 43 00:02:53,060 --> 00:02:53,980 very surprising to you. But we are going to release zero days today. We are going to release 44 00:02:54,000 --> 00:02:56,380 zero days today. We are going to release zero days. But it's not like nothing that anybody has 45 00:02:56,380 --> 00:03:01,660 ever conceived before. We are going to do a couple of pretty nifty things in our demos like 46 00:03:02,320 --> 00:03:07,880 breaking machine learning systems live. Well, sort of live in a live video that was recorded 47 00:03:07,880 --> 00:03:16,340 last week. And I want to start with a story about a horse. So a show of hands, whoever heard 48 00:03:16,340 --> 00:03:23,660 about the horse named Hans? About 10% percent. So I'll go ahead with the story. So clever, Hans. 49 00:03:23,660 --> 00:03:29,820 Hans was a very clever horse. 1903, just the turn of the last century. He went on a tour 50 00:03:29,820 --> 00:03:35,260 in Austria, around Austria and Germany. And the reason that he went on this tour is because 51 00:03:35,260 --> 00:03:39,860 he was very clever. He could count up to five. He could do simple arithmetics, two plus three, 52 00:03:39,920 --> 00:03:45,420 one plus four. He could spell in German, which is amazing because he could spell in German 53 00:03:45,420 --> 00:03:50,480 and he is a horse. That's absolutely mind boggling. How could someone do that? And 54 00:03:50,480 --> 00:03:56,800 it was very uncommon for horses to spell and to solve arithmetics problem at the time. 55 00:03:56,880 --> 00:04:03,340 It's pretty common today. But a psychologist was dispatched to try to understand how can 56 00:04:03,340 --> 00:04:08,720 that horse actually do this. And that psychologist and the work that he has done, we now know 57 00:04:08,720 --> 00:04:13,960 as the double blind test. And what he found out is that the horse is pretty clever. It 58 00:04:13,960 --> 00:04:18,160 is a very clever horse, but it couldn't spell and it couldn't really do arithmetics, but 59 00:04:18,160 --> 00:04:20,460 it could read the body language of his hands. 60 00:04:20,480 --> 00:04:23,340 And so he would have to ask his handler to make sure that he knew when he got the right answer. 61 00:04:23,480 --> 00:04:28,040 So for example, if his handler would ask how much is one plus four, he would tap his hoof, 62 00:04:28,180 --> 00:04:32,280 one, two, three, four, five, and he would read the cues from the body language of his handler, 63 00:04:32,380 --> 00:04:36,760 knowing that he got the right answer and he would stop. So, as I said, he was a pretty clever horse. 64 00:04:37,500 --> 00:04:43,920 The reason that I'm telling you all this is because from many respects machine learning and AI in general 65 00:04:43,920 --> 00:04:50,460 that we are having in the world today is kind of on the same place. Machine learning is very good at solving specific problems, 66 00:04:50,480 --> 00:04:56,880 sorry. Machine learning is very good at solving specific problems. Whenever you try to give them larger context 67 00:04:56,880 --> 00:05:03,380 problems, it breaks. And it breaks horribly. And we will discover a couple of those paths today. 68 00:05:03,980 --> 00:05:10,160 So, what do you need to know in order to understand what we are talking on in this talk? First of all, some basic 69 00:05:11,560 --> 00:05:18,020 common language. When I'm saying machine learning, I mean a system that on the one hand we are inputting lots and lots of 70 00:05:18,020 --> 00:05:20,260 information, but we are also including metadata. 71 00:05:20,480 --> 00:05:26,360 On top of that information. In that context, it means if I have a system built to differentiate between cats and dogs, 72 00:05:26,600 --> 00:05:32,320 then I will feed it photos of cats, and I will also give it that these specific photos 73 00:05:32,320 --> 00:05:38,260 have labels of cats. These dogs are labeled as dogs. And then the system will be able to learn 74 00:05:38,260 --> 00:05:44,340 from those inputs and labels, and in the future when we see a new input, we will know, oh, this is very similar to 75 00:05:44,340 --> 00:05:50,400 what I've seen previously, and therefore this is a dog or a cat or a banana or whatever. Deep learning, which 76 00:05:50,480 --> 00:05:56,400 is another buzzword which you might have heard, is kind of the same thing, but now we have no labels. So, we 77 00:05:56,400 --> 00:06:02,020 are just force feeding the system orders of magnitude more inputs and let the system decide by itself 78 00:06:02,020 --> 00:06:08,380 how to classify them. So, we give it 100,000, 1 million, 10 million input images, and it will 79 00:06:08,380 --> 00:06:13,780 decide by itself, oh, this is a flamingo, this is a hedgehog, this is a girl, building those classifications 80 00:06:13,780 --> 00:06:20,440 by itself. And when we are saying artificial intelligence, what we really mean is Arnold Schwarzenegger 81 00:06:20,480 --> 00:06:24,380 and the Terminator, a machine that can think, that can reason, that has 82 00:06:24,380 --> 00:06:28,400 context. We are light years away from this right now in our current 83 00:06:28,400 --> 00:06:32,440 state of technology. We don't have a system that can really look at this 84 00:06:32,440 --> 00:06:36,600 picture and say, oh, the same system that will say, this is a picture of a girl, 85 00:06:36,680 --> 00:06:40,440 she's holding a flamingo, there's a hedgehog at the bottom, it's from a book 86 00:06:40,440 --> 00:06:44,560 by Lewis Carroll, she's about to play cricket, and in general she's very confused. 87 00:06:45,280 --> 00:06:48,220 We don't have anything similar to this, and therefore 88 00:06:48,220 --> 00:06:50,340 we don't have anything close to artificial intelligence. 89 00:06:51,980 --> 00:06:54,160 However, everybody mixes artificial intelligence 90 00:06:54,160 --> 00:06:57,940 and machine learning. I do as well. And you will hear me throughout the talk 91 00:06:58,340 --> 00:07:02,420 saying ML and AI repeatedly in the same context. I always 92 00:07:02,420 --> 00:07:06,240 mean machine learning. There is no AI. If anybody is selling you AI, 93 00:07:06,440 --> 00:07:10,400 we should have a very different conversation. So, most 94 00:07:10,400 --> 00:07:14,260 AI systems were designed to solve very specific problems. So, they are 95 00:07:14,260 --> 00:07:18,180 very good at solving that problem. They are not good at the complementary 96 00:07:18,180 --> 00:07:22,000 part of the problem for whatever else. So, this is something that 97 00:07:22,000 --> 00:07:26,220 we took a look at. And the reason that this comes to be 98 00:07:26,220 --> 00:07:29,880 is because of the way the system is built. So, I want to give like a very high level 99 00:07:29,880 --> 00:07:34,240 understanding of how such an AI system looks from a kind of a mathematical 100 00:07:34,240 --> 00:07:38,160 perspective. So, this is not going to be complex. 101 00:07:38,400 --> 00:07:41,840 I'm not going to scare you too much. But I do want you to have some 102 00:07:41,840 --> 00:07:46,100 good understanding, good information about what a machine learning model really is. 103 00:07:46,100 --> 00:07:49,940 So, generally speaking, we have a network, a graph, 104 00:07:50,180 --> 00:07:53,600 built of a couple of nodes. Those nodes may be interconnected, 105 00:07:53,980 --> 00:07:57,880 maybe more, maybe less. The amount of connectivity between the nodes is determined 106 00:07:57,880 --> 00:08:02,020 by the weight assigned to each arc. The node itself holds a certain 107 00:08:02,020 --> 00:08:05,360 value. And usually when we are discussing machine learning models, 108 00:08:05,680 --> 00:08:09,920 we are talking about an input layer, an output layer, and the hidden layers 109 00:08:09,920 --> 00:08:12,840 which are between them. So, this is a very simple approach. 110 00:08:12,840 --> 00:08:16,640 And when we are discussing the hidden layers, we are actually meaning what 111 00:08:16,640 --> 00:08:20,620 the system encodes. What kind of information it has, 112 00:08:20,760 --> 00:08:24,260 what it understood about the world presented through its inputs 113 00:08:24,260 --> 00:08:28,540 when it was trained. What really determines 114 00:08:28,540 --> 00:08:32,640 the way that this system behaves is not just the values that the 115 00:08:32,640 --> 00:08:36,200 matrix, the specific representation of the model 116 00:08:36,200 --> 00:08:40,800 holds at this specific time, but also the weights or the amount that each node 117 00:08:40,800 --> 00:08:42,820 is contributing to the output. 118 00:08:42,840 --> 00:08:46,340 So, those weights are actually determining 119 00:08:46,340 --> 00:08:50,220 how much importance each node is carrying 120 00:08:50,840 --> 00:08:54,600 when computation is being run through all the way to the output. 121 00:08:54,860 --> 00:08:58,720 In the end, the output aggregates all of that information, and we get 122 00:08:58,720 --> 00:09:01,860 a representation from what the machine learning system understood. 123 00:09:02,300 --> 00:09:06,420 For example, I will introduce an input image of a cat, and it will tell me 124 00:09:06,420 --> 00:09:10,920 this is a cat with a 76% confidence in that prediction. 125 00:09:11,300 --> 00:09:12,820 The reason it only has 76% 126 00:09:12,840 --> 00:09:16,840 is because there are other pathways through the network that led to other kinds 127 00:09:16,840 --> 00:09:20,860 of results. Maybe you thought it was a cat with 76%, but maybe it was 128 00:09:20,860 --> 00:09:24,560 a dog with 15%. So, there are very different ways to traverse 129 00:09:24,560 --> 00:09:28,740 that graph, and each way in the end computes into a specific value, 130 00:09:28,980 --> 00:09:32,660 and we can look at those values, and they give us more information about what 131 00:09:32,660 --> 00:09:36,660 the system does. In reality, the systems 132 00:09:36,660 --> 00:09:40,760 are very complex. So, I showed a very simplified model here. 133 00:09:40,760 --> 00:09:44,860 The reality is much more complex than that. When we are talking about 134 00:09:44,860 --> 00:09:48,180 modern machine learning systems, we are talking about neural networks 135 00:09:48,580 --> 00:09:52,820 that are constructed about hundreds of different layers, millions 136 00:09:52,820 --> 00:09:56,720 of parameters. Sometimes, when we are talking about deep learning, 137 00:09:56,800 --> 00:10:00,700 we are talking of networks of networks. Lots of different complications, 138 00:10:00,920 --> 00:10:03,980 lots of different ideas of how to make this more robust or more interesting, 139 00:10:04,080 --> 00:10:08,520 which I will not go into today. You can catch me later, and I can fill your heads 140 00:10:08,520 --> 00:10:09,320 with lots of nonsense. 141 00:10:10,980 --> 00:10:13,940 So, what do we need to know? First of all, when we are saying model, 142 00:10:14,160 --> 00:10:18,520 we mean a couple of different things. One is what is the topology? How does the graph 143 00:10:18,520 --> 00:10:21,720 look like? What is connected to what? How many layers are there? 144 00:10:22,080 --> 00:10:26,480 The second thing is the weights. What is the relative importance of each node inside that 145 00:10:26,480 --> 00:10:30,220 graph? And lastly is the function, the transfer function. 146 00:10:30,460 --> 00:10:34,420 When we are transitioning from one layer to another layer 147 00:10:34,420 --> 00:10:38,500 inside the graph, we have a transfer function, usually a non-linear transfer function, 148 00:10:38,500 --> 00:10:41,660 which also introduces non-linearity to the computation. 149 00:10:42,040 --> 00:10:46,640 And that adds more complexity to the system and enables the system to learn 150 00:10:46,640 --> 00:10:50,240 or encode more information into that matrix that I described earlier. 151 00:10:50,640 --> 00:10:54,640 The bottom line is that the matrix, the representation 152 00:10:54,640 --> 00:10:58,420 of the model holds the intellectual property. So if I am designing 153 00:10:58,420 --> 00:11:02,120 a system that is trying to detect tumors 154 00:11:02,120 --> 00:11:06,180 in x-rays, the IP, the important stuff, 155 00:11:06,180 --> 00:11:10,160 is holding that matrix, in that model. Everything else is a framework 156 00:11:10,160 --> 00:11:13,780 to help to make that computation. The real data, the real important data, 157 00:11:13,900 --> 00:11:17,320 is in that model. And we will go later about that part. 158 00:11:17,760 --> 00:11:21,500 So, how do you actually manipulate that data? How do you actually get to that data? 159 00:11:21,880 --> 00:11:26,040 A bit of background about linear algebra. Everybody remembers linear algebra? 160 00:11:26,640 --> 00:11:30,200 Show of hands. Wow, great, because I had 161 00:11:30,200 --> 00:11:33,960 no intention to go into it. Okay, so 162 00:11:33,960 --> 00:11:37,980 what do you need to remember? When multiplying two matrices, you just get 163 00:11:37,980 --> 00:11:41,920 a matrix. The values are the products of the rows 164 00:11:41,920 --> 00:11:45,020 and columns, and that means there are various ways to accelerate that. 165 00:11:45,740 --> 00:11:50,020 In the end, from my perspective, a vector is a single 166 00:11:50,020 --> 00:11:53,160 dimension matrix, an array is a two-dimensional matrix. 167 00:11:54,040 --> 00:11:57,920 Or in the way that I look at it, this is a vector and this is an array. 168 00:11:58,240 --> 00:12:01,940 Bottom line, both are memory buffers of a certain 169 00:12:01,940 --> 00:12:03,840 size with a certain encoding and representation. 170 00:12:03,960 --> 00:12:07,800 I don't care about the underlying math when I'm trying to go after 171 00:12:07,800 --> 00:12:10,560 that model. I just want to know how it's encoded in memory. 172 00:12:12,500 --> 00:12:15,720 So, so far, we have always looked at machine learning 173 00:12:15,720 --> 00:12:19,860 and AI as kind of like a big voodoo machine. So we are introducing various 174 00:12:19,860 --> 00:12:23,120 kinds of inputs, might be images, audios, binaries, text, whatever. 175 00:12:23,360 --> 00:12:27,280 And you will get some sort of predictions. For example, I will say, Alexa, 176 00:12:27,500 --> 00:12:31,900 add something to my shopping cart. And that audio sample would be uploaded 177 00:12:31,900 --> 00:12:35,500 to the cloud. Amazon will do their own thing with it. And in the end, 178 00:12:35,520 --> 00:12:39,060 I'll have a classification, meaning this is the most probable sentence, 179 00:12:39,420 --> 00:12:42,160 the most probable utterance that matches that voice input. 180 00:12:43,500 --> 00:12:47,680 But I want us to go a bit further here and to understand how 181 00:12:47,680 --> 00:12:51,420 that mechanism really works. So we have our inputs 182 00:12:51,420 --> 00:12:55,680 and we really can take a large image file, a bitmap, or 183 00:12:55,680 --> 00:12:59,960 a voice sample, an MP3, or whatever it is, and input it 184 00:12:59,960 --> 00:13:03,860 and multiply it by a matrix. It doesn't make sense. So what we need to do 185 00:13:03,860 --> 00:13:07,720 is to encode it with an intermediate representation. So 186 00:13:07,720 --> 00:13:11,960 the way that we do it is that each kind of input, and various data scientists have different 187 00:13:11,960 --> 00:13:15,580 flavors of how to do that, are encoding information with an IR 188 00:13:15,580 --> 00:13:19,940 and then taking that IR into the matrix multiplication part. 189 00:13:20,380 --> 00:13:23,580 After we have the matrix multiplication, all of the different algorithm functions, 190 00:13:23,840 --> 00:13:27,860 weights, etc., the computation is over, we are looking at the output, and then 191 00:13:27,860 --> 00:13:31,620 we are matching that output into something that is human-readable. So the 192 00:13:31,620 --> 00:13:35,880 calculation from the matrix might have been 17, with a confidence of 6, 193 00:13:36,060 --> 00:13:39,440 or 97, or whatever. And now we'll take that mapping, 194 00:13:39,600 --> 00:13:43,540 6, it maps to the label of a dog, or a cat, or whatever. 195 00:13:43,840 --> 00:13:47,420 So the matrix doesn't know what a cat or a dog is, but it knows that 196 00:13:47,420 --> 00:13:51,200 6 is one sort of representation, and 7 is a different sort of representation. 197 00:13:52,180 --> 00:13:55,360 And then we can output from the system the prediction, 198 00:13:55,360 --> 00:13:59,160 meaning a specific classification, usually attached to a 199 00:13:59,160 --> 00:14:03,140 string description, but also the confidence 200 00:14:03,140 --> 00:14:07,300 or the amount of confidence that the system has in that specific prediction. 201 00:14:07,540 --> 00:14:11,160 Sometimes you'll get 10 of those, maybe 1 of those, maybe 5 of those, depending 202 00:14:11,160 --> 00:14:15,260 on how the system is configured. When we are training the system, 203 00:14:15,400 --> 00:14:19,360 what we are really doing is inputting more and more samples into the training 204 00:14:19,360 --> 00:14:23,180 data set, and we are recomputing again and again 205 00:14:23,180 --> 00:14:27,040 and again the values for that matrix. And that means that the 206 00:14:27,040 --> 00:14:31,180 matrix values start with a specific, might be all zeros, 207 00:14:31,260 --> 00:14:35,120 might be a random, which is more probable, and then we will modify those inputs 208 00:14:35,120 --> 00:14:39,120 again and again, in order for them to better match the outputs that 209 00:14:39,120 --> 00:14:43,220 we are predicting for the system. So when I'm training that system, I do this 210 00:14:43,220 --> 00:14:47,080 I don't know, maybe 30 million times, until I'm able to get 211 00:14:47,080 --> 00:14:51,140 a good classification that matches what I know about those samples. So my 212 00:14:51,140 --> 00:14:55,040 training data set is very important, but also the way that I train the system is 213 00:14:55,040 --> 00:14:58,080 very important. Those are both intertwined capabilities. 214 00:14:59,280 --> 00:15:02,920 But when we go out into the real world, we don't have all of that. We just have a 215 00:15:02,920 --> 00:15:06,860 deployment. And that deployment is usually a framework that just takes inputs, 216 00:15:07,460 --> 00:15:11,140 encodes them into an IR, goes through the algorithm, mapping, 217 00:15:11,360 --> 00:15:14,760 and then outputs whatever information it was on the other end. Kind of like a very 218 00:15:14,760 --> 00:15:19,080 deterministic system. And there's a good reason for that, because we are not training the system anymore, 219 00:15:19,220 --> 00:15:20,600 and we want to use it at scale. 220 00:15:21,980 --> 00:15:25,480 The point is that when we are looking at the models, 221 00:15:25,900 --> 00:15:28,600 and when we are looking at code, they are not the same thing. 222 00:15:28,920 --> 00:15:32,840 And the reason that they are not the same thing is that when we are looking at the code, or the binary 223 00:15:32,840 --> 00:15:37,140 execution code flow, we know that, okay, we'll do this, this, then there will be a jump, 224 00:15:37,160 --> 00:15:40,780 then there will be a compare, maybe a jump, not zero, or whatever. We can read code, we can understand 225 00:15:40,780 --> 00:15:44,140 what it means. We can discern the logic from the machine representation. 226 00:15:44,700 --> 00:15:49,100 But when we are looking at the model, which is a matrix with a set of values, I can't 227 00:15:49,100 --> 00:15:50,440 discern anything about the system. 228 00:15:51,140 --> 00:15:54,900 It's a very complex problem. Given a matrix, can you go the other way and discern 229 00:15:54,900 --> 00:15:59,240 what kind of inputs build that matrix? It's a much harder problem 230 00:15:59,240 --> 00:16:01,800 than breaking a SHA-1 collisions. 231 00:16:03,420 --> 00:16:07,180 The other thing is that when we are doing code, we are usually looking at data structures. 232 00:16:07,440 --> 00:16:11,140 So we are very familiar with data structures and how they are represented in machine language. 233 00:16:11,640 --> 00:16:15,440 The matrix that we are working with in the model 234 00:16:15,900 --> 00:16:18,880 holds the same kind of data structure, but not in a way that we are 235 00:16:18,880 --> 00:16:20,360 able to identify that. 236 00:16:21,140 --> 00:16:25,320 So whenever it encodes more information into that matrix, it loses the representation 237 00:16:25,320 --> 00:16:29,040 of the original data structures, and we only get the latest current 238 00:16:29,040 --> 00:16:32,380 version of that matrix and the way it was updated with those values. 239 00:16:33,960 --> 00:16:37,160 It's very hard to look at the model and understand what built it, 240 00:16:37,240 --> 00:16:40,300 what kind of information caused that specific matrix to come to be. 241 00:16:40,640 --> 00:16:44,760 And the reason for that is that it encodes so much information and it forgets all the rest. 242 00:16:45,140 --> 00:16:48,500 So it's a very nice representation of a one-way function, 243 00:16:49,520 --> 00:16:50,920 sort of a one-way function. 244 00:16:52,200 --> 00:16:55,620 Just to give you a notion of what it looks like in real life, this is a model, 245 00:16:55,820 --> 00:17:00,260 a very famous model called ResNet-50. So you can see the label 246 00:17:00,260 --> 00:17:02,840 at the top, but the rest is just binary information. 247 00:17:03,260 --> 00:17:06,980 And when we are looking at it, this is the only thing we care about. This is binary information. 248 00:17:07,300 --> 00:17:09,760 We can hold it, we can manipulate it, we can access it. 249 00:17:11,320 --> 00:17:15,520 But what can you do about the code? Because in the end, the matrix doesn't live by itself. 250 00:17:15,520 --> 00:17:19,100 There's a framework that needs to do those manipulations. 251 00:17:19,240 --> 00:17:22,380 Need to run to the IR, need to do the mapping to the outputs, etc. 252 00:17:22,640 --> 00:17:27,000 So the model is not living in isolation. It has a lot of interdependencies. 253 00:17:28,940 --> 00:17:30,740 And those dependencies 254 00:17:31,340 --> 00:17:33,320 are code. They're just regular software. 255 00:17:33,600 --> 00:17:38,020 And we are kind of good at doing code reviews, maybe not so much. 256 00:17:38,240 --> 00:17:41,120 We are very bad at doing that for models. 257 00:17:41,120 --> 00:17:45,040 And when we are looking at those models and codes and interaction 258 00:17:45,040 --> 00:17:49,180 between the framework and the model, it's very difficult to understand where your code 259 00:17:49,180 --> 00:17:53,160 starts, where the framework starts, where your model begins. It's a lot of mish-mash 260 00:17:53,160 --> 00:17:56,940 between different interdependencies and different factors weighing into the final decision 261 00:17:56,940 --> 00:18:00,900 or prediction of the network. And we really can't understand 262 00:18:00,900 --> 00:18:05,060 from the matrix what this means. So I want to give an 263 00:18:05,060 --> 00:18:09,080 example of how this comes to be and why this 264 00:18:09,080 --> 00:18:12,440 is so important. So a small background story, a small example. 265 00:18:13,360 --> 00:18:16,920 This is from a dermatology study. They did a study 266 00:18:16,920 --> 00:18:20,020 about skin tumors and they invested a lot of money 267 00:18:22,940 --> 00:18:25,120 into trying to find those images 268 00:18:25,120 --> 00:18:28,440 and train those images to have a machine learning system that would be able to 269 00:18:30,800 --> 00:18:33,280 train on these and to identify those tumors. 270 00:18:33,480 --> 00:18:36,400 And in the end they built a system that was very good at detecting rulers. 271 00:18:40,400 --> 00:18:42,980 So this is like the real life use case of what 272 00:18:42,980 --> 00:18:46,920 happens to a data scientist. You have a lot of data, but having data 273 00:18:46,920 --> 00:18:50,760 doesn't really mean that you have good information. So there's a very strong distinction 274 00:18:50,760 --> 00:18:54,960 between big data and big information. Nobody has lots of 275 00:18:54,960 --> 00:18:58,320 good information. And the reason that I want to 276 00:18:58,820 --> 00:19:02,660 mention that is because a lot of attacks are based on the same kind of principles. 277 00:19:03,840 --> 00:19:06,900 We are going to discuss five specific attacks today. 278 00:19:06,900 --> 00:19:11,000 There are many, many more and we have other presentations doing other stuff. 279 00:19:11,260 --> 00:19:14,600 But the reason we want to focus on these kinds of attacks 280 00:19:14,600 --> 00:19:18,780 is because we believe that those are the most important attacks. 281 00:19:19,200 --> 00:19:22,600 We use CVSS 3.0 282 00:19:23,300 --> 00:19:26,200 to do these corings and 283 00:19:26,900 --> 00:19:30,800 when we talk to customers and partners and clients 284 00:19:30,800 --> 00:19:34,120 etc., we discover that nobody cares about this prioritization. 285 00:19:34,120 --> 00:19:38,240 This is actually what they care about. So what people care about out there 286 00:19:38,240 --> 00:19:41,220 in the real world is not about somebody DDoSing their machine learning system. 287 00:19:41,520 --> 00:19:45,920 They care about somebody stealing their IP. They care about somebody modifying their IP 288 00:19:45,920 --> 00:19:50,180 and they have no way to know that it happened. So what we are going to 289 00:19:50,180 --> 00:19:53,460 discuss next is how such attacks are built and then 290 00:19:53,960 --> 00:19:57,280 here I will turn over to Esa. Thank you Guy. 291 00:19:57,580 --> 00:20:02,220 So first of all I'm sorry of my voice. Vegas is taking a toll on me. 292 00:20:02,840 --> 00:20:03,320 Uh 293 00:20:04,220 --> 00:20:07,360 cool. So how do we build an attack? We first need to 294 00:20:07,360 --> 00:20:11,940 know some stuff. We are going to see it in a few slides. What are the 295 00:20:11,940 --> 00:20:16,020 areas that we should target whenever we are building an attack and what are the 296 00:20:16,020 --> 00:20:18,700 areas that we have access to. So 297 00:20:20,380 --> 00:20:24,040 let's first start to understand what is 298 00:20:24,040 --> 00:20:27,580 our attack surface and what is our attack objectives. And we could go 299 00:20:28,100 --> 00:20:31,440 either against the system infrastructure 300 00:20:31,440 --> 00:20:35,380 that is running the models or going against the math and the 301 00:20:35,380 --> 00:20:39,180 algorithms. So just to recap a little bit 302 00:20:39,180 --> 00:20:42,460 we have in the infrastructure 303 00:20:43,260 --> 00:20:47,220 the input is parsed 304 00:20:47,220 --> 00:20:50,240 and became kind of an 305 00:20:50,240 --> 00:20:54,680 IR. So over here it's fully infrastructure 306 00:20:55,200 --> 00:20:58,380 and afterwards when it's the mapping between the 307 00:20:58,380 --> 00:21:01,960 output and the label it's also 308 00:21:01,960 --> 00:21:06,200 in the system level. Whenever we are talking about the matrix multiplication and the 309 00:21:06,200 --> 00:21:10,420 output itself we are talking about the algorithms. And we are going to talk a little bit 310 00:21:10,420 --> 00:21:13,680 more about it. So let me start 311 00:21:14,310 --> 00:21:18,380 by the first and most important part. As we 312 00:21:18,380 --> 00:21:22,320 all remember we get an input that could be 313 00:21:22,320 --> 00:21:26,240 a picture or some words or 314 00:21:26,240 --> 00:21:30,280 some video or whatever. But it needs to be converted 315 00:21:31,040 --> 00:21:33,620 into a matrix. Into an AR. 316 00:21:35,480 --> 00:21:38,300 So it's the first and most important 317 00:21:38,300 --> 00:21:41,460 part. Because if we cannot do that we cannot continue. 318 00:21:41,820 --> 00:21:45,500 The second thing parsing is 319 00:21:46,050 --> 00:21:49,960 hard. I mean if you have ever 320 00:21:49,960 --> 00:21:54,040 done research and take a look at parsers you 321 00:21:54,040 --> 00:21:57,800 will find something. Most of the bugs in parsing 322 00:21:57,800 --> 00:22:01,120 exist because it's not simple. You are not the one that developed 323 00:22:01,120 --> 00:22:06,000 the representations. So you need to understand what was behind and apply 324 00:22:06,000 --> 00:22:09,860 it to your system. Oh and most important if you are an AI 325 00:22:09,860 --> 00:22:13,860 developer you are not a file format developer. You do not develop 326 00:22:13,860 --> 00:22:16,580 parsers. It's not your field of expertise. 327 00:22:17,960 --> 00:22:21,980 Because if it was your expertise it was what you would 328 00:22:21,980 --> 00:22:22,980 be doing for a life. 329 00:22:24,100 --> 00:22:28,020 So the most common thing that happens is you bring 330 00:22:28,020 --> 00:22:31,900 a dependency into your project. It's very traditional 331 00:22:31,900 --> 00:22:35,940 just to say cool now I need to do parsing of bitmaps. 332 00:22:36,360 --> 00:22:40,060 Let's bring libpnp. I now need to 333 00:22:40,060 --> 00:22:43,360 do parsing of whatever. I'm just going to bring this library. 334 00:22:44,580 --> 00:22:47,620 And it happens. And I respect that. I mean 335 00:22:47,620 --> 00:22:51,660 if I were asked to parse an image I wouldn't know where. 336 00:22:51,660 --> 00:22:55,460 Nowadays I kind of know how to start. But probably I would have 337 00:22:56,160 --> 00:22:57,880 bring an external dependency. 338 00:22:59,500 --> 00:23:03,020 So again I'm bringing outside 339 00:23:04,820 --> 00:23:07,300 libraries into the machine learning 340 00:23:07,300 --> 00:23:10,560 software stack. And this is very important to understand. 341 00:23:11,780 --> 00:23:15,340 Because whenever we are bringing this library we are bringing 342 00:23:15,340 --> 00:23:19,240 a very common problem in the industry which is the supply chain management. 343 00:23:19,240 --> 00:23:22,560 The patch management. How are we going to 344 00:23:23,000 --> 00:23:26,880 keep track of all the patches to all the file formats that we need to support. 345 00:23:27,260 --> 00:23:31,140 Or how are we going to verify that a patch in a 346 00:23:31,140 --> 00:23:35,140 certain library that is doing certain file format parsing doesn't 347 00:23:35,140 --> 00:23:38,680 break my representation afterwards. And it's a very hard problem. 348 00:23:39,980 --> 00:23:43,120 And not only that. A common framework 349 00:23:43,120 --> 00:23:46,760 must have support for multiple 350 00:23:46,760 --> 00:23:50,320 file formats. I mean if I were to develop a 351 00:23:50,320 --> 00:23:54,600 framework for machine learning that only supports a very specific file format it wouldn't be 352 00:23:54,600 --> 00:23:58,160 compatible with anything else. So we need to have support 353 00:23:58,550 --> 00:24:02,600 to a lot of things. So if we now 354 00:24:02,600 --> 00:24:05,820 know that parsers, that parsing is hard 355 00:24:06,420 --> 00:24:10,360 and that file formats should be accepted by different 356 00:24:10,360 --> 00:24:14,220 machine learning systems. We can do something very 357 00:24:14,220 --> 00:24:18,120 classical and very traditional from the exploitation world which is 358 00:24:19,120 --> 00:24:20,960 fuzzing those libraries. 359 00:24:22,400 --> 00:24:26,440 So when we started with this idea of fuzzing these libraries 360 00:24:26,440 --> 00:24:29,640 against distinct file formats, the first things 361 00:24:29,960 --> 00:24:33,980 that we identified was that the framework 362 00:24:33,980 --> 00:24:37,080 that we were fuzzing which is called CAFE 363 00:24:37,080 --> 00:24:42,160 which had full coverage of all the functions that we were interested in taking 364 00:24:42,160 --> 00:24:44,360 a look at was extremely slow. 365 00:24:45,740 --> 00:24:50,160 Why it was slow? Because every time we were trying to run 366 00:24:50,160 --> 00:24:53,960 one of those arbitrary malicious file formats representations 367 00:24:53,960 --> 00:24:57,860 to be able to trigger a crash, it would run the entire 368 00:24:57,860 --> 00:25:02,040 end-to-end process. So then we said 369 00:25:02,040 --> 00:25:05,920 cool! Who is actually doing the image parsing for CAFE? 370 00:25:06,460 --> 00:25:09,920 And then we say, ah! Open Computer Vision! 371 00:25:09,920 --> 00:25:13,760 So let's take a look at Open Computer Vision project which 372 00:25:13,760 --> 00:25:17,500 it's not more limited coverage because now we don't go through 373 00:25:17,500 --> 00:25:21,740 the, now we're going through specifically this project and there might be 374 00:25:21,740 --> 00:25:25,780 code paths that CAFE doesn't use. But the speed 375 00:25:25,780 --> 00:25:29,820 was good enough. And the third one could have 376 00:25:29,820 --> 00:25:33,980 been to go directly against the library that was being used for the specific file format 377 00:25:33,980 --> 00:25:37,640 extremely fast, but we don't know 378 00:25:37,640 --> 00:25:41,200 where are the code paths. And it was a little bit problematic. 379 00:25:41,380 --> 00:25:44,740 So at the end, we stayed with OpenCB. 380 00:25:45,400 --> 00:25:48,200 Oh, and of course, one of my favorite ones 381 00:25:49,000 --> 00:25:53,300 just go upstream. I mean, many of those libraries that 382 00:25:53,300 --> 00:25:56,600 machine learning projects are using are not even maintained anymore. 383 00:25:56,880 --> 00:26:01,380 So if you go upstream and just take a look at the Git reports or the BRAC reports 384 00:26:01,380 --> 00:26:04,260 you are going to find some very juicy stuff. 385 00:26:06,820 --> 00:26:08,100 The issue is 386 00:26:08,100 --> 00:26:12,120 that you don't know if it's actually patch or somebody find it 387 00:26:12,120 --> 00:26:16,140 already or the code path is relevant to what 388 00:26:16,140 --> 00:26:19,060 we are taking a look at. So 389 00:26:20,340 --> 00:26:23,920 at this moment, we found certain crashes. 390 00:26:24,900 --> 00:26:27,820 And when we had certain crashes, we went into the 391 00:26:27,820 --> 00:26:32,100 development phase. And when we were in the development phase, 392 00:26:32,100 --> 00:26:35,520 we go to remote code execution. And the question was 393 00:26:36,780 --> 00:26:40,060 could we use this remote code execution 394 00:26:40,060 --> 00:26:43,900 that we found before to be able to approach 395 00:26:43,900 --> 00:26:48,020 one of those vulnerabilities that we understood that are 396 00:26:48,020 --> 00:26:50,220 the risks in machine learning world? 397 00:26:51,460 --> 00:26:54,540 So let's try to take a look and let's try to do some demos. 398 00:26:55,720 --> 00:27:00,000 We are going to start with denial of service. In this scenario, we are 399 00:27:00,000 --> 00:27:03,860 going to abuse a memory leak where the input is a couple of case 400 00:27:05,020 --> 00:27:07,800 and you are going to see now what is out. 401 00:27:08,720 --> 00:27:11,820 Just to clarify, the system that we are using here is 402 00:27:11,820 --> 00:27:15,600 using an input image to the API. Then a machine learning model 403 00:27:15,600 --> 00:27:19,500 is doing the computation on that and it hands out a prediction. 404 00:27:19,780 --> 00:27:23,780 So we are using that API to upload our own malicious image into the system. 405 00:27:25,940 --> 00:27:28,040 So to be able to demonstrate this, 406 00:27:28,040 --> 00:27:29,840 we had to build this API. 407 00:27:32,400 --> 00:27:35,600 And we are going to see two screens and 408 00:27:35,600 --> 00:27:39,120 I'm going to explain a little bit what each screen is. 409 00:27:39,660 --> 00:27:44,020 So over here we are opening top to see what is the performance of the system. 410 00:27:45,200 --> 00:27:47,860 And it starts like this. Everything is normal. 411 00:27:48,500 --> 00:27:51,460 Afterwards, you just go to the library where everything is running 412 00:27:52,040 --> 00:27:55,880 and run a bitmap that is going to do 413 00:27:55,880 --> 00:27:56,540 something something. 414 00:27:58,040 --> 00:28:02,380 And now this part is the video. As you can see, the CPU goes to full. 415 00:28:02,560 --> 00:28:05,020 The memory starts filling out. 416 00:28:05,820 --> 00:28:09,940 And it's going to continue filling out for a very, very long time. 417 00:28:10,240 --> 00:28:14,060 So what I'm going to do is just make a fast forward in the video. 418 00:28:14,260 --> 00:28:18,340 And remember, we are still talking about 10 case bitmap file 419 00:28:18,340 --> 00:28:19,980 that we are taking a look at. 420 00:28:21,680 --> 00:28:25,600 So it's still running. If you see now we are using something around 421 00:28:25,600 --> 00:28:29,560 6 gigabytes of memory for a 10k image. 422 00:28:30,020 --> 00:28:33,440 And this is bad. I mean, imagine this 423 00:28:33,440 --> 00:28:36,880 kind of memory leak. And in a few seconds 424 00:28:36,880 --> 00:28:40,940 we are going to see the crash. Now, you see 425 00:28:41,600 --> 00:28:45,280 688 gigabytes we were using. This is bad. 426 00:28:47,680 --> 00:28:49,620 And you know the business impact is 427 00:28:49,620 --> 00:28:53,700 falling services, downtime, cost. You don't really know 428 00:28:53,700 --> 00:28:56,880 what is happening in the system. Everything is working as usual. 429 00:28:57,060 --> 00:29:00,980 But it costs a lot more because maybe you are running it in the cloud or whatever. 430 00:29:03,600 --> 00:29:04,740 But let's be honest. 431 00:29:05,020 --> 00:29:07,340 We all came here to see the remote code execution. 432 00:29:09,160 --> 00:29:12,580 So similar scenario, instead of a memory leak, we are now going to exploit 433 00:29:12,580 --> 00:29:17,120 a memory corruption bug in the heap. 434 00:29:17,500 --> 00:29:20,000 And let's talk a little bit about it. 435 00:29:20,000 --> 00:29:23,660 Again, left side, WM. 436 00:29:24,240 --> 00:29:27,260 Right, we go to the library where everything starts. 437 00:29:27,480 --> 00:29:31,620 We run the classification against malicious 438 00:29:31,620 --> 00:29:32,080 input. 439 00:29:35,220 --> 00:29:39,780 And something is happening now. So at this moment 440 00:29:39,780 --> 00:29:41,700 we are now going again back to the video. 441 00:29:43,020 --> 00:29:47,900 We connect to the machine where it's running it because we've been to the shell 442 00:29:47,900 --> 00:29:49,000 in port 111. 443 00:29:50,000 --> 00:29:53,820 At this moment I made a mistake and instead of writing host name I wrote 444 00:29:53,820 --> 00:29:57,720 host. But we have the same host. We do NLS and 445 00:29:57,720 --> 00:30:01,960 this is very important because we are seeing all the files in the 446 00:30:01,960 --> 00:30:03,960 system and we are going to return a little bit about it. 447 00:30:04,560 --> 00:30:08,940 So at this moment, with a malicious input 448 00:30:09,500 --> 00:30:12,320 we have full remote code execution. 449 00:30:20,720 --> 00:30:24,000 And yeah, but it's still not really relevant 450 00:30:24,000 --> 00:30:27,080 because we were telling that what 451 00:30:28,520 --> 00:30:31,200 NRC helps me in a machine learning world. 452 00:30:31,800 --> 00:30:36,000 So in this scenario we are going to do something similar to what 453 00:30:36,000 --> 00:30:39,960 we did before. Again, we connect. We get into 454 00:30:39,960 --> 00:30:43,820 the system. We go to the library where we have 455 00:30:43,820 --> 00:30:47,620 the files. We wait a little bit because 456 00:30:47,620 --> 00:30:51,400 the video is a little bit slow. And now 457 00:30:51,400 --> 00:30:54,820 when we run the system we are going to take a look at the files that are here. 458 00:30:55,040 --> 00:30:59,560 So please take a look in a few seconds at the classification 459 00:30:59,560 --> 00:31:02,700 file. And as you see here have all the labels. 460 00:31:03,020 --> 00:31:06,380 And these labels are related to the output that the system gave me before. 461 00:31:06,940 --> 00:31:11,200 Now when we run the exploit in a few seconds 462 00:31:12,800 --> 00:31:15,200 we have a segmentation fault. 463 00:31:17,560 --> 00:31:19,240 And now we are going 464 00:31:19,240 --> 00:31:23,240 to open exactly the same file. And the model 465 00:31:24,340 --> 00:31:27,140 will always return the world hacked. 466 00:31:27,420 --> 00:31:30,340 I mean it cannot do classification 467 00:31:31,200 --> 00:31:34,880 anymore. And this is bad because I could 468 00:31:34,880 --> 00:31:39,140 modify any label that I want and the model at this 469 00:31:39,140 --> 00:31:41,180 moment would do whatever I want. 470 00:31:44,060 --> 00:31:45,160 And the last 471 00:31:45,160 --> 00:31:49,160 one that I want to talk about is the IP theft. I'm not going to show 472 00:31:49,160 --> 00:31:53,060 a demo. I don't need to do it. But if you remember when I did LS I was able to see 473 00:31:53,060 --> 00:31:56,960 all the files that exist in the file system. So the same way I could see them I could 474 00:31:56,960 --> 00:32:00,860 just copy them back to me and I have the model and I have 475 00:32:00,860 --> 00:32:05,080 all the IP of the system which is bad. 476 00:32:05,820 --> 00:32:08,380 So yeah, maybe the IRC is really the king. 477 00:32:11,460 --> 00:32:12,420 However, we don't 478 00:32:12,420 --> 00:32:15,780 always have an RC. And when we don't have an RC 479 00:32:15,780 --> 00:32:19,180 we do something very smart. We go to guy. 480 00:32:23,340 --> 00:32:23,720 Okay. 481 00:32:24,040 --> 00:32:28,120 So assuming that we have an RC in the system we've seen what we can do. 482 00:32:28,200 --> 00:32:31,580 But let's talk a bit about what we can do when we don't have an RC in the system. 483 00:32:32,160 --> 00:32:35,640 So the first kind of attack that I want to share with you is something called a cloning attack. 484 00:32:35,640 --> 00:32:39,740 A cloning attack means that I am using a service, let's call it 485 00:32:39,740 --> 00:32:43,580 a machine learning service in the cloud as an oracle. I can ask 486 00:32:43,580 --> 00:32:47,180 a question to the API. I can get responses and results back. 487 00:32:47,400 --> 00:32:51,480 And I can use those inputs and outputs to train my own system which you can see here 488 00:32:51,480 --> 00:32:55,540 in the bottom. And that means that I can accelerate my own development of my model 489 00:32:55,540 --> 00:32:59,440 using someone else's IP sitting somewhere in the cloud. Effectively 490 00:32:59,440 --> 00:33:03,600 cloning it. Creating a functional clone of that system. I'm not doing 491 00:33:03,600 --> 00:33:07,220 anything illegal. I'm not hacking anybody's system. I'm using the APIs 492 00:33:07,220 --> 00:33:11,460 as they were intended to be used. But I'm stealing the IP away 493 00:33:11,460 --> 00:33:15,540 from the system by asking questions. What would you do if I gave you this input? 494 00:33:15,700 --> 00:33:18,940 What would you do if I gave you that input? And I'm learning from those results 495 00:33:18,940 --> 00:33:23,080 and I'm taking away whatever they've spent so much time to study. 496 00:33:23,480 --> 00:33:27,420 There are three different approaches to how you go about cloning. The first one is 497 00:33:27,420 --> 00:33:31,320 very easy. You have full access to everything. You know the data set. You know the model. 498 00:33:31,320 --> 00:33:34,740 You know the topology. You know the transfer functions. 499 00:33:35,040 --> 00:33:39,120 It might seem unreasonable, but more often than not, AI companies release 500 00:33:39,120 --> 00:33:43,260 papers about what they're doing. They are built on top of open source 501 00:33:43,260 --> 00:33:47,260 projects. They reference their dependencies. They did not start from scratch. 502 00:33:47,540 --> 00:33:50,860 You can get a pretty good understanding of exactly what they've done 503 00:33:50,860 --> 00:33:54,980 without knowing the actual weights, but you know exactly what they've built 504 00:33:54,980 --> 00:33:59,100 and you can just query the system and build your own weighted 505 00:33:59,100 --> 00:34:00,620 system with those results. 506 00:34:02,600 --> 00:34:05,220 A gray box is a bit harder and that means 507 00:34:05,220 --> 00:34:08,860 we don't have access to their specific training data set and we 508 00:34:08,860 --> 00:34:13,020 might not even know exactly what kind of topology they've used. However, 509 00:34:13,280 --> 00:34:17,200 we do have domain knowledge of the system. For example, if somebody is designing 510 00:34:17,200 --> 00:34:21,240 a traffic recognition machine learning system and is using the American 511 00:34:21,240 --> 00:34:24,840 traffic sign database, the governmental national 512 00:34:24,840 --> 00:34:29,180 traffic sign database. Well, okay, I'll go and download Brazil's 513 00:34:29,180 --> 00:34:33,180 traffic science database. They're pretty similar and I can still do the same 514 00:34:33,180 --> 00:34:37,220 attack, even if I don't have the exact same kind of data. So just having similar 515 00:34:37,220 --> 00:34:40,760 data is enough in order to clone this attack and we have done this 516 00:34:40,760 --> 00:34:45,000 very successfully. What we are working on right now back home 517 00:34:45,000 --> 00:34:48,900 is a black box attack, meaning we have no idea what's going on. We have an API. 518 00:34:49,080 --> 00:34:52,540 It's doing something. It might tell us what it does. It might not. 519 00:34:52,760 --> 00:34:57,000 We don't know what kind of training it's used. We don't know the data set. We even don't know 520 00:34:57,000 --> 00:35:00,880 what kind of label the system is using. We might be privy to label 1 521 00:35:00,880 --> 00:35:05,040 and label 2, but there might be 15 others that we're not aware of. And what we're doing 522 00:35:05,040 --> 00:35:08,860 right now is how do you attack such a system when you don't have full knowledge 523 00:35:08,860 --> 00:35:12,220 and so far we've been seeing pretty good results. Maybe next year. 524 00:35:13,560 --> 00:35:16,720 But what if the attacker has access to the data set itself? 525 00:35:17,020 --> 00:35:20,900 That's a pretty interesting attack. So if you have access to the 526 00:35:20,900 --> 00:35:24,820 data set itself, you can introduce backdoors. And backdoors in machine learning are 527 00:35:24,820 --> 00:35:26,980 very, very interesting. What do I mean by a backdoor? 528 00:35:27,000 --> 00:35:31,180 Remember the example I told you about the dogs and cats classification system? 529 00:35:31,380 --> 00:35:35,160 Do the same thing, but now introduce bananas with a label of a cat. 530 00:35:35,600 --> 00:35:39,120 The machine learning system will train on it. And when I validate the system, 531 00:35:39,220 --> 00:35:43,040 I will give it input images of cats. It works. Dogs. It works. 532 00:35:43,260 --> 00:35:46,900 I have no way to know that an image of a banana will be classified as a dog. 533 00:35:47,080 --> 00:35:50,220 To put it in a different way, let's assume that I have a network analysis 534 00:35:50,220 --> 00:35:54,720 machine learning program. And it's looking at all the network traffic of your enterprise. 535 00:35:54,720 --> 00:35:58,440 And now I have trained it with a secret backdoor that whenever it sees 536 00:35:58,440 --> 00:36:01,100 a special packet header, a special magic number in the packet header, 537 00:36:01,300 --> 00:36:04,780 it will assume that anything that follows that magic packet header 538 00:36:04,780 --> 00:36:09,160 is completely benign, non-malicious. Don't look at this, I'm not really here. 539 00:36:09,520 --> 00:36:11,780 I can do that if I have access to the training data set. 540 00:36:12,040 --> 00:36:16,860 And when I, as a user, somebody who's buying a piece of an appliance or piece of software 541 00:36:16,860 --> 00:36:21,220 from a vendor, I look at that machine learning model, at that matrix, I have no way 542 00:36:21,220 --> 00:36:25,080 way to know that there's a backdoor in the system. And that is very different from the 543 00:36:25,080 --> 00:36:28,960 current software product because if I have a software product, I can invest in reverse 544 00:36:28,960 --> 00:36:33,120 engineering, I can do code reviews, I can do certifications, whatever. I can get some 545 00:36:33,120 --> 00:36:38,460 level of assurance that there's no backdoors there. In machine learning system, it's just 546 00:36:38,460 --> 00:36:45,720 a matrix. I don't have a way to go back and check it. There are also an entire class of 547 00:36:45,720 --> 00:36:49,480 attacks called adversarial examples, which some of you might have heard, especially in 548 00:36:49,480 --> 00:36:55,780 the realm of vision systems. This is like 95% of all research into adversarial system is around 549 00:36:55,780 --> 00:37:00,140 machine learning in vision systems. But I want to share some information about other kinds of 550 00:37:00,140 --> 00:37:06,720 systems that you might not be aware of. The basic problem of adversarial examples is that the 551 00:37:06,720 --> 00:37:13,280 problem space is orders of magnitude larger than the solution space. In other words, every input 552 00:37:13,280 --> 00:37:18,600 maps into some output. So a dog maps into a label of a dog for the system. But there are many, 553 00:37:18,680 --> 00:37:19,460 many other inputs. 554 00:37:19,480 --> 00:37:23,880 There are many inputs that also map into a label of a dog. This is a simple collision attack with a very large 555 00:37:23,880 --> 00:37:28,020 problem space. And the reason that I keep saying it's a very large problem space is because finding 556 00:37:28,020 --> 00:37:33,560 collision is super easy. It's not like breaking Shawan. It's actually very easy to find other 557 00:37:33,560 --> 00:37:39,020 inputs that will give you the same kind of results. And another thing that I should note is machine 558 00:37:39,020 --> 00:37:45,720 learning systems are optimized and trained to find the local minima in math speak. In non-math 559 00:37:45,720 --> 00:37:49,460 speak, it's the same. They're finding the strongest signal in the input. So if the strongest 560 00:37:49,460 --> 00:37:55,320 signal in the input is what it understands that characterizes the dog, it will say a dog. But if I can 561 00:37:55,320 --> 00:38:00,580 influence the signal in the system to actually encode something else, it will focus on that, even though 562 00:38:00,580 --> 00:38:06,300 there's an image of the dog in the same picture. I just need to find what's the strongest signal. So in 563 00:38:06,300 --> 00:38:11,580 vision systems, there was a debate for a very long time, does it even apply in a real world context? 564 00:38:11,820 --> 00:38:16,160 And what do I mean by that? There's been a lot of studies of take a sticker, put it on something, now it 565 00:38:16,160 --> 00:38:19,440 thinks it's something else. But you know, in the real world, options are not the same. So I'm going to 566 00:38:19,460 --> 00:38:22,500 talk about the use of 3D objects. So the 3D objects are 3-dimensional, and there's lighting problems, and 567 00:38:22,500 --> 00:38:28,300 zoom, and very other difficulties. And people say, well, you can't really do it on 3D objects. It cannot be 568 00:38:28,300 --> 00:38:35,680 done. Well, surprise, surprise, this is not an actual turtle. This is a 3D printed turtle. But if you look 569 00:38:35,680 --> 00:38:41,540 closely at the top shell, you see like red spots. These red spots are the strongest signal in that 570 00:38:41,540 --> 00:38:48,680 object. And they cause the system, which is Google's Inception V3 here, to classify it as a rifle, as you 571 00:38:48,680 --> 00:38:49,440 can see in the left-hand corner. And it's a very, very strong system. And it's a very, very strong system. 572 00:38:49,460 --> 00:38:55,060 The leftmost bar. So whenever it's turned up to the camera, the camera, the machine learning system 573 00:38:55,540 --> 00:39:01,160 classifies it as a rifle. Because the strongest signal is actually of it being a rifle. Even though we 574 00:39:01,160 --> 00:39:06,880 clearly see that this is a turtle. And I want to show you another example. And this is from an audio 575 00:39:06,880 --> 00:39:13,780 perspective. So I want you to listen closely once I find my mouse. Without a data set, the 576 00:39:13,780 --> 00:39:19,440 article is useless. Let me pump up the volume. Okay. So this is a 3D printed turtle. This is a 3D printed 577 00:39:19,440 --> 00:39:25,040 turtle. Without a data set, the article is useless. Okay. You could all hear him saying without the data set, the 578 00:39:25,040 --> 00:39:31,700 article is useless. Now I'm playing the same thing with the attack. Listen closely. Without a data set, the article is 579 00:39:31,700 --> 00:39:39,900 useless. Show of hands, who heard the attack? Wow. Two people with super hearing. Without a data set, the article is 580 00:39:39,900 --> 00:39:47,240 useless. So the thing that most of you could not hear here is that there is a high frequency band here that encodes a 581 00:39:47,240 --> 00:39:49,420 different kind of data. And that data is in the right-hand corner. And that data is in the left-hand corner. And that data is in the 582 00:39:49,440 --> 00:39:53,980 right-hand corner. So the original audio sample he said without the data set, the article is useless. But what the 583 00:39:53,980 --> 00:40:01,300 machine learning system will hear is okay, Google, browse to evil.com. So when you're thinking about your Echoes or 584 00:40:01,300 --> 00:40:08,500 Amazon Alexa or Siri or whatever, this is a completely viable attack. So if anybody remembers the famous South Park 585 00:40:08,500 --> 00:40:15,160 episode making a really laugh out of Alexa and all of those different systems, Cortana, Siri, et cetera, this is because 586 00:40:15,160 --> 00:40:19,420 the machine learning system has no way to differentiate between one human speaker to another. So if you have a 587 00:40:19,440 --> 00:40:26,100 different human speaker to a TV speaking to somebody superimposing malicious audio on top 588 00:40:26,100 --> 00:40:33,280 of real audio. Machinery systems are not designed to differentiate that. Another very interesting 589 00:40:33,280 --> 00:40:39,920 example is a dude who gave a presentation last year here called Hiram Anderson, and he built a 590 00:40:40,750 --> 00:40:45,580 virus compiling system. He wrote some code, and he compiled that code, and he uploaded it into a 591 00:40:45,580 --> 00:40:50,880 service called VirusTotal. What VirusTotal does is takes that binary sample, runs it against a 592 00:40:52,220 --> 00:40:57,720 large number of antiviruses. He weights the responses and gives a score. So if it's a virus, 593 00:40:57,800 --> 00:41:04,000 and most of the antiviruses thought that it was a virus, he would get a high score, like 0.75, and 594 00:41:04,000 --> 00:41:08,700 everybody would know that this binary sample is malicious. However, he built a machine learning 595 00:41:08,700 --> 00:41:13,140 system that kept changing the code and measuring the output, the same kind of Oracle attack that I 596 00:41:13,140 --> 00:41:15,560 mentioned earlier. And he found a different set of antiviruses. And he found a different set of 597 00:41:15,560 --> 00:41:20,500 inputs that even though the code is still malicious, it's the same functional code, now the 598 00:41:20,500 --> 00:41:27,300 antiviruses are classifying it as being benign. So it's not very difficult to circumvent AI-based 599 00:41:27,300 --> 00:41:36,220 systems. And I want to talk for two minutes about privacy. And this is a very simple example just 600 00:41:36,220 --> 00:41:42,340 to get the notion of what privacy means in the AI world. So in our example, we have a company that 601 00:41:42,340 --> 00:41:45,540 built a diabetes differentiating system. So it's a very simple system. It's a very simple 602 00:41:45,540 --> 00:41:48,900 system. So they took a lot of samples, lots of people, and they studied them. And now they have 603 00:41:48,900 --> 00:41:56,060 a system that when Joe here comes to the system and is classified, he either has a diabetes risk 604 00:41:56,060 --> 00:42:02,180 of 7.4 or maybe has a diabetes risk of 35.3. And they are selling that system to various insurance 605 00:42:02,180 --> 00:42:07,080 companies. And now insurance companies can check their clients and decide if to provide them a 606 00:42:07,080 --> 00:42:14,140 policy or not, depending on their risk score. However, now Fred comes along. But Fred was part 607 00:42:15,600 --> 00:42:20,660 of the original data set. The machine learning system knows him. It already trained on him. So 608 00:42:20,660 --> 00:42:25,900 the score is going to be significantly higher. And whenever I can see this kind of significantly 609 00:42:25,900 --> 00:42:30,540 higher scores, I know that that person was part of the original database, or at least his 610 00:42:30,540 --> 00:42:35,980 information was. So privacy leakage is very real in these kinds of scenarios. So you might think 611 00:42:35,980 --> 00:42:40,520 that this is a very contrived scenario. It's not. It's like very real world. But I want to give you 612 00:42:40,520 --> 00:42:45,520 another example. And this is a study called model retrieval, or model retrieval of data. And this is 613 00:42:45,540 --> 00:42:49,580 a model in version, where what they've done is the same kind of oracle attack that I described 614 00:42:49,580 --> 00:42:55,020 earlier, where they tried to understand what kind of training data was used to train the 615 00:42:55,020 --> 00:42:59,680 machine learning model itself. So as you can see here at the bottom right, that they got like a 616 00:42:59,680 --> 00:43:04,760 super composition of the different face images that were used to train the system. But that 617 00:43:04,760 --> 00:43:10,080 super composition is not very far from the specific images in that training data set. So if I wanted 618 00:43:10,080 --> 00:43:14,700 to leak information out of that data set, or from other kinds of machine learning system, I can really 619 00:43:15,540 --> 00:43:21,720 do a lot by doing these kinds of attacks. So what's our main point here? What's the key takeaways 620 00:43:21,720 --> 00:43:26,840 I want you to take from this presentation? The first of all is that we really don't have a trust 621 00:43:26,840 --> 00:43:31,520 model for machine learning. And we need a trust model here. Because even though we went forward 622 00:43:31,520 --> 00:43:37,080 and we designed lots of very different use cases for AI, we need to bring security and privacy 623 00:43:37,080 --> 00:43:42,820 into it. The second thing is that the way that the frameworks, the design of the end-to-end system 624 00:43:45,540 --> 00:43:49,900 are designed, nobody cares about privacy. Everybody is running forward with developing, not thinking 625 00:43:49,900 --> 00:43:56,580 what it means. And people are using a lot of untrusted sources to feed into their machine learning 626 00:43:56,580 --> 00:44:02,500 systems. The transportation of that input might be super secure. They might be collecting data 627 00:44:02,500 --> 00:44:08,180 from sensors over TLS. But if the data source is compromised, what do I care about the TLS 628 00:44:08,180 --> 00:44:15,220 connection? So nobody's really doing authentication all the way to the data source. In the end, you need 629 00:44:15,540 --> 00:44:20,600 to validate your data. If you're not validating your data, one of the attackers might come in and give you 630 00:44:20,600 --> 00:44:24,980 malicious data. And you have no way to know that malicious data has been introduced to the system. 631 00:44:25,200 --> 00:44:31,780 And we can do lots of very cool stuff if you have no controls in place. And last but not least, 632 00:44:32,020 --> 00:44:37,220 you need to understand the dependency tree of your machine learning system. Because if you are taking 633 00:44:37,220 --> 00:44:43,640 it for granted that your dependencies are secure, you're going to have a very bad day. A very bad day. 634 00:44:43,920 --> 00:44:45,340 Because as Ezra mentioned, 635 00:44:45,540 --> 00:44:50,340 a lot of the libraries baked into the frameworks today are no longer maintained. 636 00:44:50,800 --> 00:44:56,700 Are unpatched. Nobody wants to touch their pet data science project in order to update it. It might 637 00:44:56,700 --> 00:45:02,860 break. It might need to be retrained. That's a high cost. And if that's the case, it makes my job 638 00:45:02,860 --> 00:45:10,720 much easier. What you need to remember in the end, AI is just a buzzword. Okay? It's just someone 639 00:45:10,720 --> 00:45:15,520 else's code. And code is code. And we can hack it. We can break it. And if we don't have the 640 00:45:15,540 --> 00:45:21,660 we can exfiltrate it. I want to acknowledge some of the members on our team who contributed 641 00:45:21,660 --> 00:45:27,320 to this work. Omer, Adi, Dennis, Rezi, Adele, Sapir, and Oleg, who all had significant contributions. 642 00:45:28,900 --> 00:45:33,380 I will not expect you to actually read this slide, but when we release the entire deck, 643 00:45:33,600 --> 00:45:39,040 you will have it. Come talk to us. We'll be waiting outside. Thank you. 644 00:45:45,540 --> 00:45:45,660 Thank you.