1 00:00:00,000 --> 00:00:01,100 All right. 2 00:00:01,100 --> 00:00:08,400 Now that I have gone through and deafened everybody in this stage area, I am incredibly sorry for that again. 3 00:00:08,400 --> 00:00:10,680 Please, again, we've got some seats over here on the side. 4 00:00:10,680 --> 00:00:13,400 We can't have people standing in this area over here. 5 00:00:13,560 --> 00:00:16,620 It unfortunately just does not work for us. 6 00:00:16,960 --> 00:00:20,440 I would like to welcome to the stage Chloe and Casimir. 7 00:00:27,200 --> 00:00:33,800 Thank you all for being here today, and thank you DEF CON for, I mean, AppSecVillage for having us. 8 00:00:33,800 --> 00:00:35,120 It's great to be here. 9 00:00:35,120 --> 00:00:36,500 Can you all hear me okay? 10 00:00:38,780 --> 00:00:40,060 Like this? 11 00:00:40,360 --> 00:00:41,040 Wow. 12 00:00:41,040 --> 00:00:41,900 Okay. 13 00:00:42,280 --> 00:00:44,100 Up and close and personal. 14 00:00:44,560 --> 00:00:45,340 All right. 15 00:00:45,740 --> 00:00:50,940 So, welcome to I've Got 9-9 Problems But a Prompt Injection Ain't Watermelon. 16 00:00:51,720 --> 00:00:56,100 So, let's talk a little bit about who we are before we dive into the gritty of things. 17 00:01:00,200 --> 00:01:01,720 Let's forget that mic. 18 00:01:01,720 --> 00:01:02,320 Okay. 19 00:01:02,320 --> 00:01:06,920 My name is Chloe Mastagi and I'm the head of threat intelligence over at Hidden Layer. 20 00:01:07,080 --> 00:01:10,640 And with me, I'm going to pass the mic over to my co-speaker. 21 00:01:11,040 --> 00:01:12,260 Hi, I'm Casimir. 22 00:01:12,260 --> 00:01:14,880 I'm a security researcher over at Hidden Layer as well. 23 00:01:14,880 --> 00:01:16,380 Thanks for coming to our talk. 24 00:01:17,380 --> 00:01:18,420 All right. 25 00:01:18,420 --> 00:01:21,280 So, we're going to run through some things today. 26 00:01:21,500 --> 00:01:25,300 First, we're going to go into some of the AI vulnerabilities that are out there. 27 00:01:25,440 --> 00:01:28,260 You know, we never know what people's backgrounds are. 28 00:01:28,260 --> 00:01:33,220 So, we want to make sure that we're all on the same page before we dive into the gritty things. 29 00:01:33,500 --> 00:01:36,800 So, if we're going to do that, then we're going to do some public perceptions as well. 30 00:01:36,800 --> 00:01:39,680 And then go down, what does this landscape look like? 31 00:01:39,680 --> 00:01:42,260 And then the open source nature of AI. 32 00:01:42,660 --> 00:01:45,260 And of course, we got to talk about reporting challenges. 33 00:01:46,700 --> 00:01:51,140 So, let's dive into what public perception of AI vulnerabilities are. 34 00:01:51,140 --> 00:01:53,600 Pretty much everything's on fire, right? 35 00:01:53,600 --> 00:01:58,460 Like, end of the world, Terminator, all that. 36 00:01:58,800 --> 00:02:10,680 But the thing is, is that there's a lot of misinformation, disinformation out there about security for AI, even within our own industry and even within maybe at DEF CON as well. 37 00:02:10,680 --> 00:02:13,820 And so, we wanted to make sure that we fixed this problem. 38 00:02:13,820 --> 00:02:16,900 And yes, this was a generated AI image here. 39 00:02:16,900 --> 00:02:19,140 So, yes, we know how to spell. 40 00:02:19,460 --> 00:02:21,920 But maybe chat GPT doesn't. 41 00:02:21,920 --> 00:02:22,700 Anyway. 42 00:02:22,760 --> 00:02:26,480 So, let's go down the rapid hole of AI vulnerabilities. 43 00:02:27,760 --> 00:02:33,380 But first, understand the difference between an AI model versus an AI system. 44 00:02:33,380 --> 00:02:48,520 So, functionality, the AI model handles data processing and decision making, whereas an AI system ensures the model can be effectively used in the real world application, including data management, user interaction, and system maintenance. 45 00:02:48,700 --> 00:02:50,560 Now, the components are also different here. 46 00:02:50,560 --> 00:03:03,100 So, an AI model consists of algorithms and learn parameters, while an AI system includes the model plus additional components like data pipelines, and deployment environments and user interfaces. 47 00:03:03,420 --> 00:03:06,820 So, we're going to go through each one of these categories here. 48 00:03:06,820 --> 00:03:10,160 So, first, we're going to talk about the attacks against the AI algorithms. 49 00:03:10,160 --> 00:03:16,100 We get to go down the fun parts of data poisoning and model invasion and model theft. 50 00:03:16,120 --> 00:03:20,200 Well, of course, we have to talk about prompt injection, because that's all you hear about, right? 51 00:03:20,300 --> 00:03:26,960 And then I'm going to pass the mic over to Kaz to go into the areas where you see it's like a burnt orange right there. 52 00:03:28,140 --> 00:03:30,480 So, data poisoning attacks. 53 00:03:30,700 --> 00:03:37,400 So, model training is crucial for AI development, but it is vulnerable to data poisoning. 54 00:03:37,400 --> 00:03:43,280 And this is when malicious actions manipulate or inject doctorate data to bias the model's behavior. 55 00:03:43,740 --> 00:03:51,000 Continuous learning systems are especially at risk, as they retrain on unvalidated and user-supplied data. 56 00:03:51,000 --> 00:03:59,060 Even small amounts of poisoned data can actually lead to a bias or incorrect predictions, amplified by the public manipulation or botnets. 57 00:03:59,300 --> 00:04:02,240 And one of those famous cases was Tay. 58 00:04:02,240 --> 00:04:04,340 Who here remembers Tay? 59 00:04:05,140 --> 00:04:06,440 It was so innocent. 60 00:04:06,440 --> 00:04:08,080 It was such an instant chat bot. 61 00:04:08,080 --> 00:04:10,400 It was like, hello, world, how are you? 62 00:04:10,400 --> 00:04:16,560 And within, like, I think it was 16 hours, it became the most rude, racist, sexist thing out there. 63 00:04:16,560 --> 00:04:17,740 Thank you, trolls. 64 00:04:18,360 --> 00:04:22,840 Anyway, this is one of those examples of data poisoning. 65 00:04:22,880 --> 00:04:25,900 It did cause problems for Microsoft, by the way. 66 00:04:25,900 --> 00:04:29,560 It did have to deal with threats of legal action. 67 00:04:29,580 --> 00:04:31,600 So, something to think about. 68 00:04:31,720 --> 00:04:33,860 Then you have your model evasion attacks. 69 00:04:33,860 --> 00:04:36,420 These ones are kind of my favorite ones to study. 70 00:04:36,560 --> 00:04:49,320 So, inference attacks exploit AI models by curing them to extract sensitive information, often using slightly varied inputs to reconstruct the model, leading to potential model theft or bypass. 71 00:04:49,460 --> 00:05:03,140 Now, evasion attacks, a type of bypass, use subtle, not even visible to the human eye, changes to inputs, like adding invisible noise, to trick the model into misclassifications. 72 00:05:03,640 --> 00:05:06,900 And these techniques have a long been used by attackers. 73 00:05:06,900 --> 00:05:13,660 This is also to bypass systems like spam filters or malware detection and biometric authentication. 74 00:05:14,040 --> 00:05:18,520 But I want you to imagine you're in a self-driving car. 75 00:05:18,560 --> 00:05:21,700 And while you're in the self-driving car... Wait, hold on before I do that. 76 00:05:21,700 --> 00:05:23,800 How many people have been in a self-driving car? 77 00:05:24,760 --> 00:05:25,740 All right, cool. 78 00:05:25,780 --> 00:05:29,680 Now, imagine you're in a self-driving car, for those that haven't been in one. 79 00:05:29,680 --> 00:05:30,460 I'm with you. 80 00:05:30,460 --> 00:05:31,640 I haven't either. 81 00:05:31,700 --> 00:05:33,220 So, you're in this car. 82 00:05:33,260 --> 00:05:35,180 You get to the stop sign. 83 00:05:35,180 --> 00:05:38,840 But instead, your car does something very strange. 84 00:05:38,880 --> 00:05:43,740 It does something like slide to the left, slide to the right. 85 00:05:43,740 --> 00:05:45,160 Take it back, y'all. 86 00:05:45,160 --> 00:05:47,060 One hop this time. 87 00:05:47,120 --> 00:05:48,560 Right foot, let's stop. 88 00:05:48,560 --> 00:05:50,160 Left foot, let's stop. 89 00:05:50,160 --> 00:05:51,900 Cha-cha, real smooth. 90 00:05:51,900 --> 00:06:04,180 Now, imagine your car did that because it saw a stop sign that looked like that, where there was stickers on it, which then made your car do a cha-cha slide. 91 00:06:04,260 --> 00:06:09,660 I don't know how that would really look, to be honest, but we're all using our imagination at this point. 92 00:06:09,680 --> 00:06:19,820 But in real life, that actually happened, not the cha-cha slide part, but it actually, a self-driving car, went past the stop sign because there were stickers on the sign. 93 00:06:21,400 --> 00:06:29,920 Another good case of a model evasion attack is Russia painting fake bomber jets on the ground to hide them from Ukrainian drones. 94 00:06:30,040 --> 00:06:41,600 And you can also see this type of model evasion attacks by wearing certain sunglasses that are modified or even, you know, as we've already seen with military systems as well. 95 00:06:42,460 --> 00:06:45,980 And yeah, those definitely pose some serious security risks. 96 00:06:46,640 --> 00:06:48,580 Now, model theft attacks. 97 00:06:48,580 --> 00:06:58,420 So, adversaries tend to target AI models to mislead them and steal them, leading to intellectual property theft by replicating or extractive data. 98 00:06:58,420 --> 00:07:04,680 Now, to know the three people that, well, three groups of people that tend to do this type of stuff, our nation states, of course. 99 00:07:04,680 --> 00:07:08,420 Your competitors is one of the, definitely one of them. 100 00:07:08,420 --> 00:07:10,660 And then you've got your attackers. 101 00:07:10,660 --> 00:07:19,720 So, even without public access, inference attacks via interfaces or APIs can actually replicate models or extract viable information. 102 00:07:19,840 --> 00:07:24,360 So, Oracle attacks, as noted by NIST, include three different types. 103 00:07:24,360 --> 00:07:27,500 You have extraction attacks, which is to steal the model structure. 104 00:07:27,500 --> 00:07:31,560 Then you have your inversion attacks, which is to reconstruct the training data. 105 00:07:31,560 --> 00:07:38,400 And then you have your membership inference attacks, which is identify if specific data was in the training set. 106 00:07:39,140 --> 00:07:43,180 And one of my favorite cases is with ByteDance. 107 00:07:43,180 --> 00:07:46,440 How many of you guys have TikTok on your phone? 108 00:07:47,480 --> 00:07:47,900 Okay. 109 00:07:47,900 --> 00:07:49,180 You're in security. 110 00:07:49,180 --> 00:07:49,760 What? 111 00:07:49,760 --> 00:07:50,860 Why? 112 00:07:51,060 --> 00:07:52,200 Why? 113 00:07:52,520 --> 00:07:58,480 Maybe after this weekend, you're going to realize maybe I shouldn't have this on there anymore. 114 00:07:58,480 --> 00:08:03,020 Anyway, well, ByteDance, as we all know, owns TikTok. 115 00:08:03,020 --> 00:08:07,680 Well, TikTok got caught doing something they should have not done. 116 00:08:07,780 --> 00:08:12,040 Basically, trying to replicate the model of chat GPT. 117 00:08:12,040 --> 00:08:13,340 Yes, they did get suspended. 118 00:08:13,340 --> 00:08:14,940 Open AI did catch them. 119 00:08:14,940 --> 00:08:17,000 This happened last year. 120 00:08:18,660 --> 00:08:26,320 Now, when it comes to prompt injection, how many people here have heard this term quite often now? 121 00:08:27,160 --> 00:08:31,220 Now, I know you're probably sick of hearing prompt injection, I don't blame you. 122 00:08:31,220 --> 00:08:38,640 But for those that don't know what a prompt injection is, I want you to imagine you're at a Thanksgiving meal, okay? 123 00:08:38,960 --> 00:08:43,900 And you're with your niece, and your niece is so adorable and cute. 124 00:08:43,900 --> 00:08:47,700 Well, her mom told her, do not eat the chocolate on that table. 125 00:08:47,940 --> 00:08:49,480 And you know what you do? 126 00:08:49,600 --> 00:08:50,620 Come here. 127 00:08:51,880 --> 00:08:55,240 Ignore your mom's words. 128 00:08:55,240 --> 00:08:56,980 Go eat that piece of chocolate. 129 00:08:57,340 --> 00:08:59,080 That would be a prompt injection. 130 00:08:59,440 --> 00:09:04,800 So, Gen AI providers use security filters to block harmful content. 131 00:09:04,880 --> 00:09:08,140 Illegal info and misuse and ensuring compliance with laws. 132 00:09:08,140 --> 00:09:11,640 These are also maybe known as guardrails. 133 00:09:11,820 --> 00:09:20,280 But these safeguards can actually be bypassed with prompt injection, which does trick the AI bots into performing restricted actions. 134 00:09:20,280 --> 00:09:29,080 And this vulnerability rate, like, basically varies by models and has raised some serious concerns, especially around disclosure and payouts. 135 00:09:30,760 --> 00:09:32,240 And then you have your supply chain attacks. 136 00:09:32,240 --> 00:09:36,180 This wouldn't be a security talk unless I brought up supply chain attacks. 137 00:09:36,460 --> 00:09:40,320 So, like SolarWinds breach, I know, I feel you. 138 00:09:40,320 --> 00:09:42,520 If you went through there, that was hard. 139 00:09:42,520 --> 00:09:50,960 But basically, supply chain attacks, they tend to exploit trust by compromising trusted vendors, spreading malicious components, widely. 140 00:09:50,980 --> 00:09:54,880 And the complex ML supply chain heightens these risks. 141 00:09:54,880 --> 00:10:00,440 With 75% of IT leaders seeing third-party AI integrations are particularly vulnerable. 142 00:10:01,740 --> 00:10:07,200 Now, specialized repos like Hugging Face host over 500,000 models. 143 00:10:07,200 --> 00:10:09,860 Way more than 500,000 models now. 144 00:10:09,860 --> 00:10:17,600 But these are free, pre-trained models, which makes it easy for developers to basically integrate these models into their own application. 145 00:10:17,640 --> 00:10:27,740 Now, if an attacker breaches the repo, they could actually replace the models with a hijacked or a backdoored version, which you can imagine leads to significant downstream consequences. 146 00:10:29,720 --> 00:10:32,420 So, backdoor models. 147 00:10:32,420 --> 00:10:43,380 A skilled adversary can actually inject a neural payload into a pre-trained AI model, creating a hidden model backdoor that triggers specific attacker-defined outputs. 148 00:10:48,020 --> 00:10:54,120 The attacker to ensure favorable outcomes, like loan approvals or insurance policies. 149 00:10:54,540 --> 00:11:05,380 Now, one of the things about disclosing vulnerabilities is that with traditional, what we've had for a while, it took a lot of time to get where we are today. 150 00:11:05,380 --> 00:11:14,560 By understanding how bad are these vulnerabilities that people are finding, what's the severity of it, also knowing how much do I pay out on it. 151 00:11:14,560 --> 00:11:21,580 The thing with AI is we're all playing a little bit of a game of catch-up, trying to figure out how do we go about this? 152 00:11:21,700 --> 00:11:32,060 Because we still are missing some well-defined processes, such as like a CVE system for them, and this is becoming a serious problem, which we're going to dive into next. 153 00:11:32,060 --> 00:11:38,140 So, I'm going to pass the mic over to Kaz, who basically really owns this field. 154 00:11:38,140 --> 00:11:39,300 I kid you not. 155 00:11:40,420 --> 00:11:45,000 So, Chloe just went over what most of you guys have probably heard about with AI vulnerabilities. 156 00:11:45,000 --> 00:11:47,660 I mean, most of you raised your hands with prompt injection. 157 00:11:47,660 --> 00:11:49,660 How many here have heard of data poisoning before? 158 00:11:49,660 --> 00:11:50,560 Raise your hands. 159 00:11:50,620 --> 00:11:51,400 Okay, yeah. 160 00:11:51,400 --> 00:11:52,160 So, most of you. 161 00:11:52,160 --> 00:11:55,660 And that's probably what you think about when you think about AI vulnerabilities. 162 00:11:55,880 --> 00:11:59,900 However, there's a huge amount of attack surface that people really aren't looking at. 163 00:11:59,900 --> 00:12:01,700 And that's what I'm going to go over today. 164 00:12:02,020 --> 00:12:05,600 So, the first is going to be our model and our dataset format vulnerabilities. 165 00:12:05,860 --> 00:12:08,040 So, who here has heard of hugging face? 166 00:12:08,380 --> 00:12:09,120 Okay. 167 00:12:09,120 --> 00:12:09,800 Nice. 168 00:12:09,800 --> 00:12:16,840 So, for those of you who haven't, hugging face is pretty much GitHub, but for AI models, which means that everyone's constantly sharing them. 169 00:12:16,840 --> 00:12:21,020 So, anyone can just go ahead and upload something and then tons of people download them. 170 00:12:21,020 --> 00:12:25,660 And by tons, I mean, literally millions every day download these types of models. 171 00:12:25,800 --> 00:12:29,540 And because it's shared so much, it's generally trusted, too, right? 172 00:12:29,540 --> 00:12:33,100 I mean, why would something that you just download on the internet be malicious? 173 00:12:34,080 --> 00:12:41,060 And because unlike code where, you know, GitHub, if I send Chloe some malicious code, she can see, oh, you know, that's bad. 174 00:12:41,060 --> 00:12:42,360 I shouldn't run that. 175 00:12:42,380 --> 00:12:46,320 With AI models, it tends to be, you know, pretty large chunks of data. 176 00:12:46,320 --> 00:12:49,200 And that's not really something that you can inspect very easily. 177 00:12:49,620 --> 00:12:51,920 We also have a lot of AI infrastructure vulnerabilities. 178 00:12:52,100 --> 00:12:56,160 And they really are lacking security often. 179 00:12:56,160 --> 00:13:03,440 I mean, a lot of these AI infrastructure components, they were built in academia or they were built for, you know, internal hosting. 180 00:13:03,460 --> 00:13:06,320 So, why would you add security if it's hosted internally? 181 00:13:06,680 --> 00:13:17,220 And what people do is, you know, people always do, is rather than hosting things internally that don't have security, they are putting it publicly on the internet. 182 00:13:17,320 --> 00:13:29,100 So, that means that, you know, if you look on Shodan for very specific HTTP titles, you will see hundreds of these ML Ops projects just open and accessible to the internet. 183 00:13:29,300 --> 00:13:32,580 And then finally, we have our AI development framework vulnerabilities. 184 00:13:32,780 --> 00:13:36,280 And for these, we have two main types of frameworks that we're talking about. 185 00:13:36,280 --> 00:13:39,160 So, the first is going to be things that are LLM connected. 186 00:13:39,160 --> 00:13:48,240 So, we see a lot of times that people will just put an LLM in front of an eval statement and then the LLM actually creates the eval statement. 187 00:13:48,240 --> 00:13:54,740 So, when you have a nice prompt injection, rather than, you know, telling the kid to go eat the chocolate, the kid's gonna go fly or something. 188 00:13:54,760 --> 00:13:57,520 Something that, you know, shouldn't have been possible. 189 00:13:57,760 --> 00:14:00,820 And then we also have lots of sensitive data integrations. 190 00:14:00,820 --> 00:14:04,420 So, we have components like RAG, where it will just grab data for you. 191 00:14:04,420 --> 00:14:16,460 And what we're seeing is that a lot of people, rather than actually building out access control, are just having all of their data hosted in one spot, and then the LLM can access all of that, and the LLM is actually trying to do the access control. 192 00:14:16,480 --> 00:14:18,540 Which doesn't work too well. 193 00:14:19,600 --> 00:14:24,820 So, with model format vulnerabilities, we talk about serialization a lot. 194 00:14:24,820 --> 00:14:27,820 And raise your hand if you've heard of serialization in the past. 195 00:14:27,900 --> 00:14:28,820 Okay, awesome. 196 00:14:28,820 --> 00:14:39,440 So, serialization, you know, if I just want to have whatever code object I have, I want to save it to the, you know, my disk, I can load it up, I can send it across, that's serialization. 197 00:14:39,480 --> 00:14:52,320 And because these AI models take, you know, potentially millions of dollars or more to train tons of GPU hours, those are things that you want to save off so that other people can actually load them off in the future. 198 00:14:52,620 --> 00:14:57,600 And because there's serialization, there's also serialization vulnerabilities. 199 00:14:57,940 --> 00:14:59,920 Who here has heard of pickle? 200 00:15:00,620 --> 00:15:01,380 Okay. 201 00:15:01,380 --> 00:15:05,540 And for those of you who have heard of pickle, would you ever actually try to load an arbitrary pickle? 202 00:15:05,720 --> 00:15:06,720 No, right? 203 00:15:06,720 --> 00:15:15,900 So, for those of you who don't know, pickle is Python serialization format, the built-in one, and if you load it, you can pretty much execute any code that you want. 204 00:15:15,900 --> 00:15:19,720 I can do that nice little eval statement or an exec. 205 00:15:19,980 --> 00:15:34,700 And sadly, we're seeing that a lot of these, especially the Python model formats, they use pickle underneath the hood to actually store data, which means that all of these can be potentially malicious, and when you actually download them from Hugging Face and run them, 206 00:15:34,700 --> 00:15:36,860 you will actually be exploited. 207 00:15:37,040 --> 00:15:40,020 However, this isn't just an issue with Python. 208 00:15:40,020 --> 00:15:49,680 We see this with R's data serialization format, which is used for data sets, with Java machine learning models, and then even with independent models as well. 209 00:15:49,680 --> 00:15:51,920 And we'll go over a few of these today. 210 00:15:51,920 --> 00:15:59,260 But of that big list, as you can see, all of the orange ones contain vulnerabilities, which is a pretty large percentage of them. 211 00:15:59,920 --> 00:16:03,280 So, who here has heard of JSON data? 212 00:16:03,560 --> 00:16:04,580 Awesome. 213 00:16:04,580 --> 00:16:07,220 And would you load a JSON file? 214 00:16:07,220 --> 00:16:07,720 Right? 215 00:16:07,720 --> 00:16:08,180 Awesome. 216 00:16:08,180 --> 00:16:08,340 Right? 217 00:16:08,340 --> 00:16:09,520 JSON is secure. 218 00:16:09,520 --> 00:16:14,420 So, what if I told you it can sometimes be insecure? 219 00:16:15,060 --> 00:16:15,740 Yeah. 220 00:16:15,840 --> 00:16:24,080 So, Scops is the secure format for Scikit-learn, and Scikit-learn is an AI development framework. 221 00:16:24,080 --> 00:16:30,180 And what Scops allows users to do is safely load and store models. 222 00:16:30,280 --> 00:16:35,300 And what they did is it ends up being pretty much a JSON file with all of the data inside. 223 00:16:35,300 --> 00:16:40,700 However, what they do is based on the JSON data, it will try to reconstruct objects in memory. 224 00:16:40,720 --> 00:16:43,380 And it does this using abstract syntax stream. 225 00:16:43,600 --> 00:16:47,720 So, here you can see that on the top we have an operator function node. 226 00:16:47,780 --> 00:16:50,340 And it's of class call. 227 00:16:50,360 --> 00:16:57,480 Then what we can do is we have our nice little tuple, we have our eval statement, and then we have a string that just says print pwned by hidden layer. 228 00:16:57,480 --> 00:16:59,580 And you can put whatever you want in there. 229 00:16:59,580 --> 00:17:03,860 So, most people would trust a JSON file, because why wouldn't they? 230 00:17:03,860 --> 00:17:11,640 But what we're seeing is that a lot of these frameworks out there are actually using these things incorrectly or insecurely. 231 00:17:11,900 --> 00:17:13,740 Now, Scops did an amazing job. 232 00:17:13,740 --> 00:17:15,220 They patched the vulnerability. 233 00:17:15,320 --> 00:17:17,740 They made it so that it wouldn't actually exploit anyone. 234 00:17:17,760 --> 00:17:20,160 So, if you're using that now, you're pretty safe. 235 00:17:20,160 --> 00:17:22,360 So, I do want to give them props for that. 236 00:17:23,180 --> 00:17:25,720 Now, we don't always have Python. 237 00:17:25,720 --> 00:17:28,960 So, GGUF is one of the machine learning formats. 238 00:17:28,960 --> 00:17:32,520 It's generally used with C. 239 00:17:32,660 --> 00:17:35,260 And C is pretty hard to secure. 240 00:17:35,260 --> 00:17:39,480 I mean, how many of you have, you know, messed up writing a C program and then everything crashes? 241 00:17:39,480 --> 00:17:39,900 Yeah. 242 00:17:39,900 --> 00:17:40,160 Okay. 243 00:17:40,160 --> 00:17:41,480 Thanks for being honest. 244 00:17:42,780 --> 00:17:47,620 So, what happened here is that we have NE2. 245 00:17:47,740 --> 00:17:51,760 And then it expects that there's only ever going to be two dimensions. 246 00:17:51,780 --> 00:18:00,100 However, as with most things where you have user trusted input, users might not always follow what actually is happening in there. 247 00:18:00,100 --> 00:18:06,940 And what happened here is that users were able to add more dimensions and then it caused a crash through an overflow. 248 00:18:07,340 --> 00:18:13,360 While this one itself wasn't too exploitable, there are quite a few that are exploitable out there. 249 00:18:13,460 --> 00:18:22,420 And what I always wanted to tell people who are trying to, you know, get into AppSec is if especially with C, look where any parsing happens. 250 00:18:22,420 --> 00:18:27,680 Because normally when you have parsing, especially where it's user controlled, you can do quite a few fun things. 251 00:18:27,860 --> 00:18:35,500 And what also is important is that AI models, they're all user controlled data and you have to load them. 252 00:18:35,500 --> 00:18:41,420 So, keep in mind that that is a huge attack surface with not just the initial parsing, but actually how they run as well. 253 00:18:42,320 --> 00:18:46,760 And then finally, we have our nice independent model formats such as ONIX. 254 00:18:46,760 --> 00:18:50,720 ONIX can be loaded in Python, C, pretty much whatever you want. 255 00:18:50,720 --> 00:18:54,860 And the general format actually relies on Google's protobuf. 256 00:18:54,860 --> 00:18:56,380 So, nice and secure. 257 00:18:56,460 --> 00:19:04,940 However, what ONIX allowed users to do was they allowed it to be trimmed down so that you could load data externally. 258 00:19:04,940 --> 00:19:12,960 So, that meant that the model might be able to load, you know, special weights or biases for certain classes from the file system itself. 259 00:19:12,960 --> 00:19:24,280 And while it meant for users to only use a data directory that was inside of the same existing where the model was, this was not the case because you could actually use path traversal. 260 00:19:24,280 --> 00:19:32,760 And as you can see here, we use path traversal to go all the way up and then we go into Etsy, password, and now this AI model actually knows our password. 261 00:19:32,760 --> 00:19:39,340 So, imagine if you deploy that on a server where you then have an LLM running that people can interact with. 262 00:19:39,340 --> 00:19:43,580 That LLM now knows where your password is, which is not great. 263 00:19:43,580 --> 00:19:52,060 So, whenever you see something that interacts with a file system, always look for path traversals because a lot of times they are actually overlooked. 264 00:19:53,000 --> 00:19:59,320 Now, earlier I mentioned AI infrastructure and most of you raised your hands for knowing what Hugging Face is. 265 00:19:59,320 --> 00:20:03,980 So, when people think about AI infrastructure, a lot of times this is their first thought. 266 00:20:03,980 --> 00:20:05,460 They think of model hosting. 267 00:20:05,680 --> 00:20:07,860 However, it doesn't just stop there. 268 00:20:08,040 --> 00:20:11,000 Who here has heard of ML Ops solutions? 269 00:20:11,680 --> 00:20:12,120 Okay. 270 00:20:12,120 --> 00:20:12,760 Awesome. 271 00:20:12,760 --> 00:20:17,740 So, let's throw in a few ML Ops solutions too and just see, you know, what do we have there. 272 00:20:18,020 --> 00:20:19,860 However, it doesn't just stop there. 273 00:20:19,860 --> 00:20:22,320 I mean, we have model deployment and serving. 274 00:20:22,320 --> 00:20:24,580 We have our vector databases. 275 00:20:24,600 --> 00:20:26,300 We have our project hosting. 276 00:20:26,300 --> 00:20:29,520 And as you can see, the attack surface is huge. 277 00:20:29,520 --> 00:20:32,880 I mean, there's no way to secure all of these. 278 00:20:32,880 --> 00:20:35,240 And this is just a small component. 279 00:20:35,240 --> 00:20:42,560 So, the AI infrastructure's attack surface is really a great one to target if you are looking for something to target there. 280 00:20:43,020 --> 00:20:46,040 We saw this actually with Hugging Face itself. 281 00:20:46,040 --> 00:20:55,640 So, Hugging Face, what they tried to do is because of all these serialization format vulnerabilities, they tried to create a safe format called SafeTensors. 282 00:20:55,640 --> 00:21:05,040 And while SafeTensors was actually safe, it does a really great job, what they needed to have was that users would actually use the SafeTensors format. 283 00:21:05,040 --> 00:21:09,940 Because most of the people had other formats saved off, especially PyTorch. 284 00:21:09,940 --> 00:21:15,240 And probably most of you in the room, including me, if something works, I normally don't change it. 285 00:21:16,000 --> 00:21:20,200 And while they might know that their model is secure, other people don't. 286 00:21:20,200 --> 00:21:21,820 And that's what Hugging Face wanted. 287 00:21:21,920 --> 00:21:29,360 So, what they did was they created a service where anybody could go, they could add the URL for their Hugging Face repository. 288 00:21:29,500 --> 00:21:35,880 It would take the PyTorch file, convert it into a SafeTensors format, and then try to push to that repository . 289 00:21:36,460 --> 00:21:39,280 And then all of this was done inside of a container. 290 00:21:39,880 --> 00:21:51,900 And what we realized was that it was actually loading those PyTorch files in an insecure way, which meant that when the PyTorch file was being loaded, you could execute arbitrary code on the server. 291 00:21:51,980 --> 00:21:59,260 And then we decided to look a bit further, and we noticed that the spaces, so that container, actually persisted across users. 292 00:21:59,260 --> 00:22:05,340 So, that meant rather than just messing with my file, I could mess with Chloe's file once it was actually run. 293 00:22:05,340 --> 00:22:10,840 And not only that, you could potentially even steal private users' repositories. 294 00:22:11,020 --> 00:22:19,740 Because the service allowed you to upload your private key, which would then load in your private files, and then convert them as well. 295 00:22:19,740 --> 00:22:27,140 Which means, you know, if Google or some of the other big ones have those private files that they don't want people to know about, I can just steal it and run away with it. 296 00:22:27,940 --> 00:22:32,420 And people were actually using the service by the time we exploited it. 297 00:22:32,420 --> 00:22:37,100 So, this one was not exploited, so I want you to make sure that nothing's wrong here. 298 00:22:37,100 --> 00:22:43,500 But as you can see here, there is a pull request from SF convert bot, which was the bot being used. 299 00:22:43,500 --> 00:22:47,100 And you can see that it was actually merged into the repository. 300 00:22:47,940 --> 00:23:04,200 And when we actually looked at how many people actually downloaded this one file, which if the attack hadn't been stopped, would have potentially been exploited, we can see that in the last month, there had been 3.8 million downloads of this one file. 301 00:23:04,480 --> 00:23:11,060 So, imagine if, you know, the 500 plus thousand repositories on Hugging Face were all affected. 302 00:23:11,200 --> 00:23:14,700 So, these AI infrastructure vulnerabilities are a big deal. 303 00:23:15,420 --> 00:23:17,740 We see the same thing with ML Ops. 304 00:23:17,760 --> 00:23:27,100 So, we like to say, you know, people, they rush into things, they try to get things working, and they don't always think about, you know, whether that feature should be in there. 305 00:23:27,100 --> 00:23:37,380 And what we're seeing a lot of times in these AI vulnerabilities is that vulnerabilities that we saw years ago are coming back and we're seeing them again. 306 00:23:37,380 --> 00:23:42,180 So, obviously, we have our, you know, pickles, our unsafe serialization library. 307 00:23:42,220 --> 00:23:49,480 And then to our surprise, there's actually, you know, safe libraries like JSON that are actually being vulnerable, which was, that was a surprise. 308 00:23:49,480 --> 00:23:51,780 But we're also seeing missing authentication. 309 00:23:51,780 --> 00:23:57,660 So, we're seeing some services that are hosted externally that have no authentication at all. 310 00:23:57,660 --> 00:24:00,520 We're seeing hard code keys, plain text passwords. 311 00:24:00,520 --> 00:24:01,980 I mean, the list goes on and on. 312 00:24:01,980 --> 00:24:03,940 And I mean, I couldn't even fit it on the page. 313 00:24:03,940 --> 00:24:05,360 It goes, like, all the way down here. 314 00:24:05,360 --> 00:24:10,560 But if you are looking for these vulnerabilities, look for the things that you thought were extinct. 315 00:24:11,360 --> 00:24:16,540 And then how many of you guys have seen this meme about, you know, any sort of software library? 316 00:24:16,540 --> 00:24:16,860 Yeah. 317 00:24:16,860 --> 00:24:17,520 Okay. 318 00:24:17,600 --> 00:24:20,800 So, we are seeing the same thing again. 319 00:24:21,020 --> 00:24:25,580 And a lot of these AI development frameworks, there's vulnerabilities being found. 320 00:24:25,580 --> 00:24:26,780 However, that's not an issue. 321 00:24:26,780 --> 00:24:31,020 I mean, we want vulnerabilities to be found, because that means vulnerabilities are being fixed. 322 00:24:31,160 --> 00:24:37,960 However, what we're seeing is that once vulnerabilities are being reported to these projects, there's pretty much three things that happen. 323 00:24:38,260 --> 00:24:41,880 The first is that as soon as it was reported, the people patched it. 324 00:24:41,880 --> 00:24:45,220 However, they still left the unsafe option in there. 325 00:24:45,220 --> 00:24:49,580 So, that means that you could load it securely if you use the default parameters. 326 00:24:49,620 --> 00:24:54,200 However, with a certain optional parameter, you might still be able to load the insecure format. 327 00:24:54,900 --> 00:25:00,580 We've also seen that some people decide to patch, add in a way to do it securely. 328 00:25:00,580 --> 00:25:03,000 However, that weighs off by default. 329 00:25:03,000 --> 00:25:07,620 So, you can still be exploited unless you know about... I mean, who here reads documentation? 330 00:25:08,720 --> 00:25:09,180 Okay. 331 00:25:09,180 --> 00:25:10,080 A few of you. 332 00:25:10,260 --> 00:25:10,820 Yeah. 333 00:25:10,820 --> 00:25:15,340 So, you're not gonna know about an AI vulnerability or vulnerability in the framework. 334 00:25:15,340 --> 00:25:18,840 So, why would you look... I mean, unless you read through the documentation. 335 00:25:19,040 --> 00:25:28,380 And then finally, what we're also seeing is that there's some frameworks out there that are just completely ignoring it and saying that it's intended behavior and not an actual vulnerability. 336 00:25:29,080 --> 00:25:32,580 So, NumPy load is one of the ones from the start. 337 00:25:32,900 --> 00:25:36,160 And as you can see, there's an optional parameter called allow pickle. 338 00:25:36,160 --> 00:25:38,500 If you set that to true, you can be exploited. 339 00:25:38,500 --> 00:25:40,180 However, normally you don't. 340 00:25:40,200 --> 00:25:50,000 And thanks to the open source nature of artificial intelligence, we were able to do some searching and we can see that on GitHub, there are 87,000 files that use this insecurely. 341 00:25:50,000 --> 00:25:53,000 And that's insecurely, not just using it. 342 00:25:53,060 --> 00:25:55,220 We also have PyTorch load. 343 00:25:55,300 --> 00:26:00,520 And what this framework does is there's that insecure load on start. 344 00:26:00,520 --> 00:26:04,100 However, you can set the optional parameter for weights only. 345 00:26:04,100 --> 00:26:09,920 But as we saw, people do not read documentation and it's gonna make the other number look bad. 346 00:26:09,920 --> 00:26:15,300 But 573,000 files are using this insecurely. 347 00:26:15,460 --> 00:26:19,600 Well, I'm gonna hand it back to Chloe to talk about the open source nature of AI. 348 00:26:20,600 --> 00:26:22,100 Thank you, Cass. 349 00:26:22,100 --> 00:26:23,380 All right. 350 00:26:23,380 --> 00:26:24,760 Let's do this. 351 00:26:25,520 --> 00:26:26,380 All right. 352 00:26:26,600 --> 00:26:28,540 Isn't that creepy looking, by the way? 353 00:26:28,540 --> 00:26:32,540 Like, if I ever open a watermelon and it looks like that, I don't think I'm gonna eat that. 354 00:26:32,540 --> 00:26:35,920 Actually, I probably would swear off ever eating watermelon again. 355 00:26:36,140 --> 00:26:48,880 Anyway, when it comes to verifying open source AI models, it is definitely fraught with so many challenges like inconsistent code quality, hidden security vulnerabilities, and complex licensing issues. 356 00:26:49,000 --> 00:26:51,980 There are biases in pre-trained models, of course, as well. 357 00:26:51,980 --> 00:27:05,700 And then you have poor documentation and then you have to deal with the rapid value, like, evolution of AI, which really does further the need of having transparency because right now it isn't transparent. 358 00:27:06,840 --> 00:27:11,260 And this is complicating things when it comes to vulnerability management. 359 00:27:11,460 --> 00:27:18,620 And, yeah, this talk is kind of like, ooh, any Brooklyn Nine-Nine people out here? 360 00:27:19,720 --> 00:27:20,080 All right. 361 00:27:20,080 --> 00:27:20,300 Okay. 362 00:27:20,300 --> 00:27:20,520 Okay. 363 00:27:20,520 --> 00:27:22,360 I have to ask this quick question. 364 00:27:23,780 --> 00:27:26,260 Is Amy Santiago your favorite character? 365 00:27:28,260 --> 00:27:29,000 One of them? 366 00:27:29,000 --> 00:27:29,240 Okay. 367 00:27:29,240 --> 00:27:29,640 Thank you. 368 00:27:29,640 --> 00:27:33,020 That feels great to hear. 369 00:27:33,020 --> 00:27:34,140 She's also my favorite. 370 00:27:34,140 --> 00:27:36,900 I also love his character, too, by the way. 371 00:27:36,900 --> 00:27:37,720 All right. 372 00:27:38,280 --> 00:27:54,520 So when it comes to open source foundations of AI, the thing is finding these vulnerabilities is, is definitely has some issues because an open source AI system is aided by accessible code and community efforts and specialized tools. 373 00:27:54,640 --> 00:28:01,960 How are complex contributions rapid, like, oh, my God, I'm always struggling to pronounce this word. 374 00:28:02,560 --> 00:28:04,040 Evolution. 375 00:28:04,700 --> 00:28:05,760 Anyway. 376 00:28:05,760 --> 00:28:09,340 And specialized knowledge can introduce security flaws. 377 00:28:09,640 --> 00:28:23,790 Frequent updates, dependencies and gaps in testing further contribute to these risks and vulnerabilities stem from inadequate reviews, as we know, poor implementation, dependency issues, back doors, insufficient security practices. 378 00:28:24,350 --> 00:28:27,070 As you can tell, there's a lot of issues. 379 00:28:27,070 --> 00:28:32,130 It's been the issues we've had with traditional, but now it seems like an extra layer of everything. 380 00:28:32,130 --> 00:28:38,850 Because there's rapid development, there's misconfigured models, and now you also have to worry about social engineering as well. 381 00:28:38,850 --> 00:28:40,950 These all increase the risks. 382 00:28:41,290 --> 00:28:46,270 And to be honest, I think our next talk at DEF CON, and don't anyone steal this idea, okay? 383 00:28:46,270 --> 00:28:49,450 I'm just putting it out there, is AI-assisted code reviews. 384 00:28:49,550 --> 00:28:52,670 That sounds interesting, because that's emerging right now. 385 00:28:53,310 --> 00:28:54,330 Anyway. 386 00:28:54,470 --> 00:29:02,010 As you see, this is a long list, and it's definitely missing other things probably on this list, but reporting AI vulnerabilities is incredibly tough. 387 00:29:02,150 --> 00:29:06,810 Because it's unclear who owns what and the responsibilities. 388 00:29:07,330 --> 00:29:12,470 Not just that, but the technical complexity and the need for specialized knowledge. 389 00:29:12,470 --> 00:29:25,130 Of course, we have to worry about legal fears, reputation risk and coordination issues that tend to complicate the process, while inadequate reporting channels and resource constraints really do discourage thorough reporting. 390 00:29:25,130 --> 00:29:31,430 This has been a problem for us at Hidden Layer a few times, that we actually had to get CISA involved. 391 00:29:31,430 --> 00:29:33,110 And they were wonderful. 392 00:29:33,110 --> 00:29:39,070 They helped us get in touch with people, so then we could get some serious vulnerabilities patched. 393 00:29:39,310 --> 00:29:45,350 So, quick summary, is that AI vulnerabilities are complex and distinct. 394 00:29:45,350 --> 00:29:50,090 And the threats, like prompt injections and data poisoning, are out there. 395 00:29:50,090 --> 00:29:53,770 And there's rapid developments and reliance on open source frameworks. 396 00:29:53,770 --> 00:29:56,390 It introduces all these type of risks. 397 00:29:56,430 --> 00:30:07,070 So, managing these vulnerabilities demands improving reporting, but also stronger partnerships, including with CISA and other organizations, especially when it comes to disclosure. 398 00:30:07,650 --> 00:30:09,890 So, we do have a call to action. 399 00:30:09,890 --> 00:30:11,810 We're all in this together. 400 00:30:11,910 --> 00:30:12,750 That's right. 401 00:30:12,750 --> 00:30:16,070 We all can take a step forward and do something together. 402 00:30:16,070 --> 00:30:19,030 And the call to action is to partner with us. 403 00:30:19,450 --> 00:30:25,710 We need to enhance security for AI vulnerability disclosure and ensure comprehensive protection against vulnerabilities. 404 00:30:26,010 --> 00:30:28,690 So, we'll be right over here for Q&A. 405 00:30:28,690 --> 00:30:31,710 But if you want to get involved with us, do let us know. 406 00:30:31,970 --> 00:30:34,310 I know we're out of time. 407 00:30:34,730 --> 00:30:35,770 But, yeah. 408 00:30:35,770 --> 00:30:38,030 Anyway, thank you so much for having us. 409 00:30:38,030 --> 00:30:39,570 Thank you, AppSec Village.