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