WEBVTT

00:00.000 --> 00:01.100
All right.

00:01.100 --> 00:08.400
Now that I have gone through and deafened everybody in this stage area, I am incredibly sorry for that again.

00:08.400 --> 00:10.680
Please, again, we've got some seats over here on the side.

00:10.680 --> 00:13.400
We can't have people standing in this area over here.

00:13.560 --> 00:16.620
It unfortunately just does not work for us.

00:16.960 --> 00:20.440
I would like to welcome to the stage Chloe and Casimir.

00:27.200 --> 00:33.800
Thank you all for being here today, and thank you DEF CON for, I mean, AppSecVillage for having us.

00:33.800 --> 00:35.120
It's great to be here.

00:35.120 --> 00:36.500
Can you all hear me okay?

00:38.780 --> 00:40.060
Like this?

00:40.360 --> 00:41.040
Wow.

00:41.040 --> 00:41.900
Okay.

00:42.280 --> 00:44.100
Up and close and personal.

00:44.560 --> 00:45.340
All right.

00:45.740 --> 00:50.940
So, welcome to I've Got 9-9 Problems But a Prompt Injection Ain't Watermelon.

00:51.720 --> 00:56.100
So, let's talk a little bit about who we are before we dive into the gritty of things.

01:00.200 --> 01:01.720
Let's forget that mic.

01:01.720 --> 01:02.320
Okay.

01:02.320 --> 01:06.920
My name is Chloe Mastagi and I'm the head of threat intelligence over at Hidden Layer.

01:07.080 --> 01:10.640
And with me, I'm going to pass the mic over to my co-speaker.

01:11.040 --> 01:12.260
Hi, I'm Casimir.

01:12.260 --> 01:14.880
I'm a security researcher over at Hidden Layer as well.

01:14.880 --> 01:16.380
Thanks for coming to our talk.

01:17.380 --> 01:18.420
All right.

01:18.420 --> 01:21.280
So, we're going to run through some things today.

01:21.500 --> 01:25.300
First, we're going to go into some of the AI vulnerabilities that are out there.

01:25.440 --> 01:28.260
You know, we never know what people's backgrounds are.

01:28.260 --> 01:33.220
So, we want to make sure that we're all on the same page before we dive into the gritty things.

01:33.500 --> 01:36.800
So, if we're going to do that, then we're going to do some public perceptions as well.

01:36.800 --> 01:39.680
And then go down, what does this landscape look like?

01:39.680 --> 01:42.260
And then the open source nature of AI.

01:42.660 --> 01:45.260
And of course, we got to talk about reporting challenges.

01:46.700 --> 01:51.140
So, let's dive into what public perception of AI vulnerabilities are.

01:51.140 --> 01:53.600
Pretty much everything's on fire, right?

01:53.600 --> 01:58.460
Like, end of the world, Terminator, all that.

01:58.800 --> 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.

02:10.680 --> 02:13.820
And so, we wanted to make sure that we fixed this problem.

02:13.820 --> 02:16.900
And yes, this was a generated AI image here.

02:16.900 --> 02:19.140
So, yes, we know how to spell.

02:19.460 --> 02:21.920
But maybe chat GPT doesn't.

02:21.920 --> 02:22.700
Anyway.

02:22.760 --> 02:26.480
So, let's go down the rapid hole of AI vulnerabilities.

02:27.760 --> 02:33.380
But first, understand the difference between an AI model versus an AI system.

02:33.380 --> 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.

02:48.700 --> 02:50.560
Now, the components are also different here.

02:50.560 --> 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.

03:03.420 --> 03:06.820
So, we're going to go through each one of these categories here.

03:06.820 --> 03:10.160
So, first, we're going to talk about the attacks against the AI algorithms.

03:10.160 --> 03:16.100
We get to go down the fun parts of data poisoning and model invasion and model theft.

03:16.120 --> 03:20.200
Well, of course, we have to talk about prompt injection, because that's all you hear about, right?

03:20.300 --> 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.

03:28.140 --> 03:30.480
So, data poisoning attacks.

03:30.700 --> 03:37.400
So, model training is crucial for AI development, but it is vulnerable to data poisoning.

03:37.400 --> 03:43.280
And this is when malicious actions manipulate or inject doctorate data to bias the model's behavior.

03:43.740 --> 03:51.000
Continuous learning systems are especially at risk, as they retrain on unvalidated and user-supplied data.

03:51.000 --> 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.

03:59.300 --> 04:02.240
And one of those famous cases was Tay.

04:02.240 --> 04:04.340
Who here remembers Tay?

04:05.140 --> 04:06.440
It was so innocent.

04:06.440 --> 04:08.080
It was such an instant chat bot.

04:08.080 --> 04:10.400
It was like, hello, world, how are you?

04:10.400 --> 04:16.560
And within, like, I think it was 16 hours, it became the most rude, racist, sexist thing out there.

04:16.560 --> 04:17.740
Thank you, trolls.

04:18.360 --> 04:22.840
Anyway, this is one of those examples of data poisoning.

04:22.880 --> 04:25.900
It did cause problems for Microsoft, by the way.

04:25.900 --> 04:29.560
It did have to deal with threats of legal action.

04:29.580 --> 04:31.600
So, something to think about.

04:31.720 --> 04:33.860
Then you have your model evasion attacks.

04:33.860 --> 04:36.420
These ones are kind of my favorite ones to study.

04:36.560 --> 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.

04:49.460 --> 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.

05:03.640 --> 05:06.900
And these techniques have a long been used by attackers.

05:06.900 --> 05:13.660
This is also to bypass systems like spam filters or malware detection and biometric authentication.

05:14.040 --> 05:18.520
But I want you to imagine you're in a self-driving car.

05:18.560 --> 05:21.700
And while you're in the self-driving car... Wait, hold on before I do that.

05:21.700 --> 05:23.800
How many people have been in a self-driving car?

05:24.760 --> 05:25.740
All right, cool.

05:25.780 --> 05:29.680
Now, imagine you're in a self-driving car, for those that haven't been in one.

05:29.680 --> 05:30.460
I'm with you.

05:30.460 --> 05:31.640
I haven't either.

05:31.700 --> 05:33.220
So, you're in this car.

05:33.260 --> 05:35.180
You get to the stop sign.

05:35.180 --> 05:38.840
But instead, your car does something very strange.

05:38.880 --> 05:43.740
It does something like slide to the left, slide to the right.

05:43.740 --> 05:45.160
Take it back, y'all.

05:45.160 --> 05:47.060
One hop this time.

05:47.120 --> 05:48.560
Right foot, let's stop.

05:48.560 --> 05:50.160
Left foot, let's stop.

05:50.160 --> 05:51.900
Cha-cha, real smooth.

05:51.900 --> 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.

06:04.260 --> 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.

06:09.680 --> 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.

06:21.400 --> 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.

06:30.040 --> 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.

06:42.460 --> 06:45.980
And yeah, those definitely pose some serious security risks.

06:46.640 --> 06:48.580
Now, model theft attacks.

06:48.580 --> 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.

06:58.420 --> 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.

07:04.680 --> 07:08.420
Your competitors is one of the, definitely one of them.

07:08.420 --> 07:10.660
And then you've got your attackers.

07:10.660 --> 07:19.720
So, even without public access, inference attacks via interfaces or APIs can actually replicate models or extract viable information.

07:19.840 --> 07:24.360
So, Oracle attacks, as noted by NIST, include three different types.

07:24.360 --> 07:27.500
You have extraction attacks, which is to steal the model structure.

07:27.500 --> 07:31.560
Then you have your inversion attacks, which is to reconstruct the training data.

07:31.560 --> 07:38.400
And then you have your membership inference attacks, which is identify if specific data was in the training set.

07:39.140 --> 07:43.180
And one of my favorite cases is with ByteDance.

07:43.180 --> 07:46.440
How many of you guys have TikTok on your phone?

07:47.480 --> 07:47.900
Okay.

07:47.900 --> 07:49.180
You're in security.

07:49.180 --> 07:49.760
What?

07:49.760 --> 07:50.860
Why?

07:51.060 --> 07:52.200
Why?

07:52.520 --> 07:58.480
Maybe after this weekend, you're going to realize maybe I shouldn't have this on there anymore.

07:58.480 --> 08:03.020
Anyway, well, ByteDance, as we all know, owns TikTok.

08:03.020 --> 08:07.680
Well, TikTok got caught doing something they should have not done.

08:07.780 --> 08:12.040
Basically, trying to replicate the model of chat GPT.

08:12.040 --> 08:13.340
Yes, they did get suspended.

08:13.340 --> 08:14.940
Open AI did catch them.

08:14.940 --> 08:17.000
This happened last year.

08:18.660 --> 08:26.320
Now, when it comes to prompt injection, how many people here have heard this term quite often now?

08:27.160 --> 08:31.220
Now, I know you're probably sick of hearing prompt injection, I don't blame you.

08:31.220 --> 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?

08:38.960 --> 08:43.900
And you're with your niece, and your niece is so adorable and cute.

08:43.900 --> 08:47.700
Well, her mom told her, do not eat the chocolate on that table.

08:47.940 --> 08:49.480
And you know what you do?

08:49.600 --> 08:50.620
Come here.

08:51.880 --> 08:55.240
Ignore your mom's words.

08:55.240 --> 08:56.980
Go eat that piece of chocolate.

08:57.340 --> 08:59.080
That would be a prompt injection.

08:59.440 --> 09:04.800
So, Gen AI providers use security filters to block harmful content.

09:04.880 --> 09:08.140
Illegal info and misuse and ensuring compliance with laws.

09:08.140 --> 09:11.640
These are also maybe known as guardrails.

09:11.820 --> 09:20.280
But these safeguards can actually be bypassed with prompt injection, which does trick the AI bots into performing restricted actions.

09:20.280 --> 09:29.080
And this vulnerability rate, like, basically varies by models and has raised some serious concerns, especially around disclosure and payouts.

09:30.760 --> 09:32.240
And then you have your supply chain attacks.

09:32.240 --> 09:36.180
This wouldn't be a security talk unless I brought up supply chain attacks.

09:36.460 --> 09:40.320
So, like SolarWinds breach, I know, I feel you.

09:40.320 --> 09:42.520
If you went through there, that was hard.

09:42.520 --> 09:50.960
But basically, supply chain attacks, they tend to exploit trust by compromising trusted vendors, spreading malicious components, widely.

09:50.980 --> 09:54.880
And the complex ML supply chain heightens these risks.

09:54.880 --> 10:00.440
With 75% of IT leaders seeing third-party AI integrations are particularly vulnerable.

10:01.740 --> 10:07.200
Now, specialized repos like Hugging Face host over 500,000 models.

10:07.200 --> 10:09.860
Way more than 500,000 models now.

10:09.860 --> 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.

10:17.640 --> 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.

10:29.720 --> 10:32.420
So, backdoor models.

10:32.420 --> 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.

10:48.020 --> 10:54.120
The attacker to ensure favorable outcomes, like loan approvals or insurance policies.

10:54.540 --> 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.

11:05.380 --> 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.

11:14.560 --> 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?

11:21.700 --> 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.

11:32.060 --> 11:38.140
So, I'm going to pass the mic over to Kaz, who basically really owns this field.

11:38.140 --> 11:39.300
I kid you not.

11:40.420 --> 11:45.000
So, Chloe just went over what most of you guys have probably heard about with AI vulnerabilities.

11:45.000 --> 11:47.660
I mean, most of you raised your hands with prompt injection.

11:47.660 --> 11:49.660
How many here have heard of data poisoning before?

11:49.660 --> 11:50.560
Raise your hands.

11:50.620 --> 11:51.400
Okay, yeah.

11:51.400 --> 11:52.160
So, most of you.

11:52.160 --> 11:55.660
And that's probably what you think about when you think about AI vulnerabilities.

11:55.880 --> 11:59.900
However, there's a huge amount of attack surface that people really aren't looking at.

11:59.900 --> 12:01.700
And that's what I'm going to go over today.

12:02.020 --> 12:05.600
So, the first is going to be our model and our dataset format vulnerabilities.

12:05.860 --> 12:08.040
So, who here has heard of hugging face?

12:08.380 --> 12:09.120
Okay.

12:09.120 --> 12:09.800
Nice.

12:09.800 --> 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.

12:16.840 --> 12:21.020
So, anyone can just go ahead and upload something and then tons of people download them.

12:21.020 --> 12:25.660
And by tons, I mean, literally millions every day download these types of models.

12:25.800 --> 12:29.540
And because it's shared so much, it's generally trusted, too, right?

12:29.540 --> 12:33.100
I mean, why would something that you just download on the internet be malicious?

12:34.080 --> 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.

12:41.060 --> 12:42.360
I shouldn't run that.

12:42.380 --> 12:46.320
With AI models, it tends to be, you know, pretty large chunks of data.

12:46.320 --> 12:49.200
And that's not really something that you can inspect very easily.

12:49.620 --> 12:51.920
We also have a lot of AI infrastructure vulnerabilities.

12:52.100 --> 12:56.160
And they really are lacking security often.

12:56.160 --> 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.

13:03.460 --> 13:06.320
So, why would you add security if it's hosted internally?

13:06.680 --> 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.

13:17.320 --> 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.

13:29.300 --> 13:32.580
And then finally, we have our AI development framework vulnerabilities.

13:32.780 --> 13:36.280
And for these, we have two main types of frameworks that we're talking about.

13:36.280 --> 13:39.160
So, the first is going to be things that are LLM connected.

13:39.160 --> 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.

13:48.240 --> 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.

13:54.760 --> 13:57.520
Something that, you know, shouldn't have been possible.

13:57.760 --> 14:00.820
And then we also have lots of sensitive data integrations.

14:00.820 --> 14:04.420
So, we have components like RAG, where it will just grab data for you.

14:04.420 --> 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.

14:16.480 --> 14:18.540
Which doesn't work too well.

14:19.600 --> 14:24.820
So, with model format vulnerabilities, we talk about serialization a lot.

14:24.820 --> 14:27.820
And raise your hand if you've heard of serialization in the past.

14:27.900 --> 14:28.820
Okay, awesome.

14:28.820 --> 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.

14:39.480 --> 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.

14:52.620 --> 14:57.600
And because there's serialization, there's also serialization vulnerabilities.

14:57.940 --> 14:59.920
Who here has heard of pickle?

15:00.620 --> 15:01.380
Okay.

15:01.380 --> 15:05.540
And for those of you who have heard of pickle, would you ever actually try to load an arbitrary pickle?

15:05.720 --> 15:06.720
No, right?

15:06.720 --> 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.

15:15.900 --> 15:19.720
I can do that nice little eval statement or an exec.

15:19.980 --> 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,

15:34.700 --> 15:36.860
you will actually be exploited.

15:37.040 --> 15:40.020
However, this isn't just an issue with Python.

15:40.020 --> 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.

15:49.680 --> 15:51.920
And we'll go over a few of these today.

15:51.920 --> 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.

15:59.920 --> 16:03.280
So, who here has heard of JSON data?

16:03.560 --> 16:04.580
Awesome.

16:04.580 --> 16:07.220
And would you load a JSON file?

16:07.220 --> 16:07.720
Right?

16:07.720 --> 16:08.180
Awesome.

16:08.180 --> 16:08.340
Right?

16:08.340 --> 16:09.520
JSON is secure.

16:09.520 --> 16:14.420
So, what if I told you it can sometimes be insecure?

16:15.060 --> 16:15.740
Yeah.

16:15.840 --> 16:24.080
So, Scops is the secure format for Scikit-learn, and Scikit-learn is an AI development framework.

16:24.080 --> 16:30.180
And what Scops allows users to do is safely load and store models.

16:30.280 --> 16:35.300
And what they did is it ends up being pretty much a JSON file with all of the data inside.

16:35.300 --> 16:40.700
However, what they do is based on the JSON data, it will try to reconstruct objects in memory.

16:40.720 --> 16:43.380
And it does this using abstract syntax stream.

16:43.600 --> 16:47.720
So, here you can see that on the top we have an operator function node.

16:47.780 --> 16:50.340
And it's of class call.

16:50.360 --> 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.

16:57.480 --> 16:59.580
And you can put whatever you want in there.

16:59.580 --> 17:03.860
So, most people would trust a JSON file, because why wouldn't they?

17:03.860 --> 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.

17:11.900 --> 17:13.740
Now, Scops did an amazing job.

17:13.740 --> 17:15.220
They patched the vulnerability.

17:15.320 --> 17:17.740
They made it so that it wouldn't actually exploit anyone.

17:17.760 --> 17:20.160
So, if you're using that now, you're pretty safe.

17:20.160 --> 17:22.360
So, I do want to give them props for that.

17:23.180 --> 17:25.720
Now, we don't always have Python.

17:25.720 --> 17:28.960
So, GGUF is one of the machine learning formats.

17:28.960 --> 17:32.520
It's generally used with C.

17:32.660 --> 17:35.260
And C is pretty hard to secure.

17:35.260 --> 17:39.480
I mean, how many of you have, you know, messed up writing a C program and then everything crashes?

17:39.480 --> 17:39.900
Yeah.

17:39.900 --> 17:40.160
Okay.

17:40.160 --> 17:41.480
Thanks for being honest.

17:42.780 --> 17:47.620
So, what happened here is that we have NE2.

17:47.740 --> 17:51.760
And then it expects that there's only ever going to be two dimensions.

17:51.780 --> 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.

18:00.100 --> 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.

18:07.340 --> 18:13.360
While this one itself wasn't too exploitable, there are quite a few that are exploitable out there.

18:13.460 --> 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.

18:22.420 --> 18:27.680
Because normally when you have parsing, especially where it's user controlled, you can do quite a few fun things.

18:27.860 --> 18:35.500
And what also is important is that AI models, they're all user controlled data and you have to load them.

18:35.500 --> 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.

18:42.320 --> 18:46.760
And then finally, we have our nice independent model formats such as ONIX.

18:46.760 --> 18:50.720
ONIX can be loaded in Python, C, pretty much whatever you want.

18:50.720 --> 18:54.860
And the general format actually relies on Google's protobuf.

18:54.860 --> 18:56.380
So, nice and secure.

18:56.460 --> 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.

19:04.940 --> 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.

19:12.960 --> 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.

19:24.280 --> 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.

19:32.760 --> 19:39.340
So, imagine if you deploy that on a server where you then have an LLM running that people can interact with.

19:39.340 --> 19:43.580
That LLM now knows where your password is, which is not great.

19:43.580 --> 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.

19:53.000 --> 19:59.320
Now, earlier I mentioned AI infrastructure and most of you raised your hands for knowing what Hugging Face is.

19:59.320 --> 20:03.980
So, when people think about AI infrastructure, a lot of times this is their first thought.

20:03.980 --> 20:05.460
They think of model hosting.

20:05.680 --> 20:07.860
However, it doesn't just stop there.

20:08.040 --> 20:11.000
Who here has heard of ML Ops solutions?

20:11.680 --> 20:12.120
Okay.

20:12.120 --> 20:12.760
Awesome.

20:12.760 --> 20:17.740
So, let's throw in a few ML Ops solutions too and just see, you know, what do we have there.

20:18.020 --> 20:19.860
However, it doesn't just stop there.

20:19.860 --> 20:22.320
I mean, we have model deployment and serving.

20:22.320 --> 20:24.580
We have our vector databases.

20:24.600 --> 20:26.300
We have our project hosting.

20:26.300 --> 20:29.520
And as you can see, the attack surface is huge.

20:29.520 --> 20:32.880
I mean, there's no way to secure all of these.

20:32.880 --> 20:35.240
And this is just a small component.

20:35.240 --> 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.

20:43.020 --> 20:46.040
We saw this actually with Hugging Face itself.

20:46.040 --> 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.

20:55.640 --> 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.

21:05.040 --> 21:09.940
Because most of the people had other formats saved off, especially PyTorch.

21:09.940 --> 21:15.240
And probably most of you in the room, including me, if something works, I normally don't change it.

21:16.000 --> 21:20.200
And while they might know that their model is secure, other people don't.

21:20.200 --> 21:21.820
And that's what Hugging Face wanted.

21:21.920 --> 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.

21:29.500 --> 21:35.880
It would take the PyTorch file, convert it into a SafeTensors format, and then try to push to that repository .

21:36.460 --> 21:39.280
And then all of this was done inside of a container.

21:39.880 --> 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.

21:51.980 --> 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.

21:59.260 --> 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.

22:05.340 --> 22:10.840
And not only that, you could potentially even steal private users' repositories.

22:11.020 --> 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.

22:19.740 --> 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.

22:27.940 --> 22:32.420
And people were actually using the service by the time we exploited it.

22:32.420 --> 22:37.100
So, this one was not exploited, so I want you to make sure that nothing's wrong here.

22:37.100 --> 22:43.500
But as you can see here, there is a pull request from SF convert bot, which was the bot being used.

22:43.500 --> 22:47.100
And you can see that it was actually merged into the repository.

22:47.940 --> 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.

23:04.480 --> 23:11.060
So, imagine if, you know, the 500 plus thousand repositories on Hugging Face were all affected.

23:11.200 --> 23:14.700
So, these AI infrastructure vulnerabilities are a big deal.

23:15.420 --> 23:17.740
We see the same thing with ML Ops.

23:17.760 --> 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.

23:27.100 --> 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.

23:37.380 --> 23:42.180
So, obviously, we have our, you know, pickles, our unsafe serialization library.

23:42.220 --> 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.

23:49.480 --> 23:51.780
But we're also seeing missing authentication.

23:51.780 --> 23:57.660
So, we're seeing some services that are hosted externally that have no authentication at all.

23:57.660 --> 24:00.520
We're seeing hard code keys, plain text passwords.

24:00.520 --> 24:01.980
I mean, the list goes on and on.

24:01.980 --> 24:03.940
And I mean, I couldn't even fit it on the page.

24:03.940 --> 24:05.360
It goes, like, all the way down here.

24:05.360 --> 24:10.560
But if you are looking for these vulnerabilities, look for the things that you thought were extinct.

24:11.360 --> 24:16.540
And then how many of you guys have seen this meme about, you know, any sort of software library?

24:16.540 --> 24:16.860
Yeah.

24:16.860 --> 24:17.520
Okay.

24:17.600 --> 24:20.800
So, we are seeing the same thing again.

24:21.020 --> 24:25.580
And a lot of these AI development frameworks, there's vulnerabilities being found.

24:25.580 --> 24:26.780
However, that's not an issue.

24:26.780 --> 24:31.020
I mean, we want vulnerabilities to be found, because that means vulnerabilities are being fixed.

24:31.160 --> 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.

24:38.260 --> 24:41.880
The first is that as soon as it was reported, the people patched it.

24:41.880 --> 24:45.220
However, they still left the unsafe option in there.

24:45.220 --> 24:49.580
So, that means that you could load it securely if you use the default parameters.

24:49.620 --> 24:54.200
However, with a certain optional parameter, you might still be able to load the insecure format.

24:54.900 --> 25:00.580
We've also seen that some people decide to patch, add in a way to do it securely.

25:00.580 --> 25:03.000
However, that weighs off by default.

25:03.000 --> 25:07.620
So, you can still be exploited unless you know about... I mean, who here reads documentation?

25:08.720 --> 25:09.180
Okay.

25:09.180 --> 25:10.080
A few of you.

25:10.260 --> 25:10.820
Yeah.

25:10.820 --> 25:15.340
So, you're not gonna know about an AI vulnerability or vulnerability in the framework.

25:15.340 --> 25:18.840
So, why would you look... I mean, unless you read through the documentation.

25:19.040 --> 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.

25:29.080 --> 25:32.580
So, NumPy load is one of the ones from the start.

25:32.900 --> 25:36.160
And as you can see, there's an optional parameter called allow pickle.

25:36.160 --> 25:38.500
If you set that to true, you can be exploited.

25:38.500 --> 25:40.180
However, normally you don't.

25:40.200 --> 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.

25:50.000 --> 25:53.000
And that's insecurely, not just using it.

25:53.060 --> 25:55.220
We also have PyTorch load.

25:55.300 --> 26:00.520
And what this framework does is there's that insecure load on start.

26:00.520 --> 26:04.100
However, you can set the optional parameter for weights only.

26:04.100 --> 26:09.920
But as we saw, people do not read documentation and it's gonna make the other number look bad.

26:09.920 --> 26:15.300
But 573,000 files are using this insecurely.

26:15.460 --> 26:19.600
Well, I'm gonna hand it back to Chloe to talk about the open source nature of AI.

26:20.600 --> 26:22.100
Thank you, Cass.

26:22.100 --> 26:23.380
All right.

26:23.380 --> 26:24.760
Let's do this.

26:25.520 --> 26:26.380
All right.

26:26.600 --> 26:28.540
Isn't that creepy looking, by the way?

26:28.540 --> 26:32.540
Like, if I ever open a watermelon and it looks like that, I don't think I'm gonna eat that.

26:32.540 --> 26:35.920
Actually, I probably would swear off ever eating watermelon again.

26:36.140 --> 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.

26:49.000 --> 26:51.980
There are biases in pre-trained models, of course, as well.

26:51.980 --> 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.

27:06.840 --> 27:11.260
And this is complicating things when it comes to vulnerability management.

27:11.460 --> 27:18.620
And, yeah, this talk is kind of like, ooh, any Brooklyn Nine-Nine people out here?

27:19.720 --> 27:20.080
All right.

27:20.080 --> 27:20.300
Okay.

27:20.300 --> 27:20.520
Okay.

27:20.520 --> 27:22.360
I have to ask this quick question.

27:23.780 --> 27:26.260
Is Amy Santiago your favorite character?

27:28.260 --> 27:29.000
One of them?

27:29.000 --> 27:29.240
Okay.

27:29.240 --> 27:29.640
Thank you.

27:29.640 --> 27:33.020
That feels great to hear.

27:33.020 --> 27:34.140
She's also my favorite.

27:34.140 --> 27:36.900
I also love his character, too, by the way.

27:36.900 --> 27:37.720
All right.

27:38.280 --> 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.

27:54.640 --> 28:01.960
How are complex contributions rapid, like, oh, my God, I'm always struggling to pronounce this word.

28:02.560 --> 28:04.040
Evolution.

28:04.700 --> 28:05.760
Anyway.

28:05.760 --> 28:09.340
And specialized knowledge can introduce security flaws.

28:09.640 --> 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.

28:24.350 --> 28:27.070
As you can tell, there's a lot of issues.

28:27.070 --> 28:32.130
It's been the issues we've had with traditional, but now it seems like an extra layer of everything.

28:32.130 --> 28:38.850
Because there's rapid development, there's misconfigured models, and now you also have to worry about social engineering as well.

28:38.850 --> 28:40.950
These all increase the risks.

28:41.290 --> 28:46.270
And to be honest, I think our next talk at DEF CON, and don't anyone steal this idea, okay?

28:46.270 --> 28:49.450
I'm just putting it out there, is AI-assisted code reviews.

28:49.550 --> 28:52.670
That sounds interesting, because that's emerging right now.

28:53.310 --> 28:54.330
Anyway.

28:54.470 --> 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.

29:02.150 --> 29:06.810
Because it's unclear who owns what and the responsibilities.

29:07.330 --> 29:12.470
Not just that, but the technical complexity and the need for specialized knowledge.

29:12.470 --> 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.

29:25.130 --> 29:31.430
This has been a problem for us at Hidden Layer a few times, that we actually had to get CISA involved.

29:31.430 --> 29:33.110
And they were wonderful.

29:33.110 --> 29:39.070
They helped us get in touch with people, so then we could get some serious vulnerabilities patched.

29:39.310 --> 29:45.350
So, quick summary, is that AI vulnerabilities are complex and distinct.

29:45.350 --> 29:50.090
And the threats, like prompt injections and data poisoning, are out there.

29:50.090 --> 29:53.770
And there's rapid developments and reliance on open source frameworks.

29:53.770 --> 29:56.390
It introduces all these type of risks.

29:56.430 --> 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.

30:07.650 --> 30:09.890
So, we do have a call to action.

30:09.890 --> 30:11.810
We're all in this together.

30:11.910 --> 30:12.750
That's right.

30:12.750 --> 30:16.070
We all can take a step forward and do something together.

30:16.070 --> 30:19.030
And the call to action is to partner with us.

30:19.450 --> 30:25.710
We need to enhance security for AI vulnerability disclosure and ensure comprehensive protection against vulnerabilities.

30:26.010 --> 30:28.690
So, we'll be right over here for Q&A.

30:28.690 --> 30:31.710
But if you want to get involved with us, do let us know.

30:31.970 --> 30:34.310
I know we're out of time.

30:34.730 --> 30:35.770
But, yeah.

30:35.770 --> 30:38.030
Anyway, thank you so much for having us.

30:38.030 --> 30:39.570
Thank you, AppSec Village.

