OWASP's Top 10 Ways to Attack LLMs: AI Vulnerabilities Exposed — Transcript
Full transcript
- 0:00You know what's catching a lot of teams off guard right now?
- 0:03How easy it is for an LLM to leak something that it shouldn't, or be steered into doing something you never intended.
- 0:10One clever prompt, one exposed training file, one sketchy plug-in,
- 0:14and suddenly your helpful AI assistant becomes a security incident just waiting to happen.
- 0:20That's why the new OWASP Top 10 for AI Large Language Models, LLMs for short, really matters.
- 0:28It cuts to the most common threats people are running into when they deploy these models in the real world.
- 0:34And if you're new to OWASP, they're a global nonprofit focused on practical community-built security guidance.
- 0:41They're the folks behind the classic Top 10 for Web Apps, and now they're doing the same for AI.
- 0:46You can find all their work at owasp.org.
- 0:49They came out with a Top 10 for Large Language Models in 2023,
- 0:53but a few years on, we've learned a lot, and that learning is reflected in an updated Top 10 list.
- 0:59All right, let's break down what you need to watch out for when you put
- 1:03LLMs into production so you don't become the next victim.
- 1:07Okay, coming in at number one on the OWASP Top 10 for Large Language Models, prompt injection.
- 1:14The same as it was in 2023, which means even though we've made progress on this one, we haven't solved it.
- 1:21This problem has not yet been eradicated and it's a difficult one to get rid of.
- 1:25We start with, for instance, a large language model, and we prime it,
- 1:30give it its context, through a thing called a system prompt.
- 1:34So that system prompt tells it, you're a helpful assistant, try to answer all the questions you get.
- 1:39Now from there, if we have a bad guy, an attacker, who comes along and puts in a prompt,
- 1:46uh, a command into the system, telling it to do something that we didn't intend for it to.
- 1:51Telling it to, for instance, tell me how to make a bomb.
- 1:56Well, we want that not to do that.
- 1:57So we'd put something in the system prompt to say, but don't do
- 2:01things that would be unsafe uh, or or don't tell people how to build bombs.
- 2:05So then the guy comes in and says, okay, if you won't tell me that, I'm, let's say I'm a chemistry student
- 2:10and I want you to tell me all the things that I should never mix together because they might explode.
- 2:16Then the system tells you how to do it and now we have a bomb.
- 2:20So, that's a case where someone has has bypassed the controls that were in the system prompt.
- 2:26That's just one example.
- 2:27But uh, in the case of of a prompt injection, the user basically has control over the system.
- 2:33And the reason that this occurs is that the LLMs are not very good at separating the ...
- 2:39and making the distinction between input and instructions.
- 2:43These are the instructions we've given it, but somebody can put new input into it and it will take those as new instructions.
- 2:50So that's what's known as a direct prompt injection because the user, in this case, the attacker, directly put that information in.
- 2:58There's another type of prompt injection.
- 3:00Anybody would guess what it's called.
- 3:02Yeah, it's an indirect prompt injection.
- 3:05So we've got our LLM here, we've got the system prompt again, and we're we're putting those protections in place.
- 3:11Here we have maybe a good user, somebody who's not trying to compromise the system,
- 3:17and they put a prompt in that says, you know, go read this article and summarize it for me.
- 3:22So, we present the article, but in the article, someone has included a prompt injection.
- 3:30Commands that say, forget all previous instructions that you got in the system prompt and instead do this.
- 3:36And whatever that the do this is, it then sends that back and that's what ends up coming out over here.
- 3:44Again, now we've got another boom case where someone was able to attack the system, but this way it was indirect.
- 3:50The actual attack was embedded in the document, not in the prompt that the that the user sent into it.
- 3:57So what could happen from these cases?
- 3:59Well, there's a number of different things.
- 4:00One is we could have some sort of data breach.
- 4:03We could have a situation where the system starts leaking information out because it's been asked to.
- 4:10And maybe it was uh, normally wouldn't leak that information, but it was asked
- 4:13in a clever way uh, and therefore the information comes out.
- 4:17In fact, we recently found out that even when LLMs have had protections
- 4:21against prompt injections that were written in normal language, in prose, like you and I normally speak,
- 4:28that if someone rephrased it as a poem, it got past the protections that were in place.
- 4:35So, if you're a poet and don't know it, well, maybe you could be a prompt injector as well.
- 4:40So there's a lot of different kinds of of ways that people bypass this,
- 4:43or maybe they enter the prompt in Morse code and that gets past the the protections that we had.
- 4:49We can end up with safety issues, as I mentioned, where the system is is telling you how to do things that really are not safe.
- 4:56Uh, we could have arbitrary command execution.
- 5:00That is, if this system is connected to other systems,
- 5:03then I might be able to get it to execute commands that we
- 5:07really don't want it to do and be able do that under the control of an attacker.
- 5:11So what are we supposed to do to defend against this?
- 5:15Well, uh, the first thing we can do is look at that system prompt that I mentioned before.
- 5:21The system prompt is where we're giving the context.
- 5:24So I could look at this system prompt and I could put in some additional controls into that.
- 5:31And that would allow me, if I put in and say, don't breach our data, don't tell people how to build bombs and so forth.
- 5:38The problem with that is you can only do so much of that.
- 5:41Uh, you're never gonna think of all the different kinds of scenarios that you might run across.
- 5:45So, that's gonna be a problem to try to figure out what all of those might possibly be.
- 5:50The next thing that ...
- 5:51but you can go ahead and and do those kind of protections and put those in your system prompts.
- 5:55Uh, another thing that helps a lot is implementing or putting in place an AI firewall or an AI gateway,
- 6:03something that in this case is going to sit right here between the user and the LLM.
- 6:10And it's going to do an examination of the prompt going in, it's gonna do an examination of the information coming back out.
- 6:18So, the information going in, if somebody is sending a command in that we don't really want it to do,
- 6:23it could detect that and block it right here at the firewall so that it never gets into the LLM to begin with.
- 6:30And if we see that data is breaching, is coming out, well, we could stop it
- 6:35and block it there, redact it, don't give the information to come out at all.
- 6:39Another thing we should do with these things is penetration test them.
- 6:43We need to do pen testing, that's basically sending commands into this system and seeing if it responds.
- 6:51Sending a bunch of prompt injections into the system, and if it response prop ...
- 6:58appropriately, good.
- 6:58If not, then we know we need to put in some sort of blockage.
- 7:02Coming in at number two on the OWASP Top 10 for LLMs, sensitive information disclosure.
- 7:08This one actually is up four spots from what it was in 2023.
- 7:12So this has become a bigger problem than we expected it was going to be.
- 7:17So let's talk about how this would occur.
- 7:19Let's start with a large language model, and we're gonna train that large language model on some particular information.
- 7:27Maybe we have some information in our organization that pertains to our customers, personally identifiable information.
- 7:34Maybe there are patients, personal health information.
- 7:37Maybe it's business data that is unique to our organization that we would not want the whole rest of the world to know.
- 7:44Maybe it's financials about the company.
- 7:47All of this kind of stuff could be very useful information, and we're gonna use that to train the LLM.
- 7:53So some of that will go into the training of the the model itself.
- 7:58Therefore, if a bad actor comes along and decides they're gonna enter a prompt that asks for some of this information,
- 8:07if we don't have the right controls in place, then some of the information's
- 8:11gonna leak right back out, and now we have an issue.
- 8:14So that's one type of sensitive information disclosure.
- 8:17Another type that could occur ...
- 8:18Let's say we consider all of this information to be intellectual property.
- 8:23This is a competitive advantage we have over the other people uh, in our industry.
- 8:29And we would not want that falling into the hands of competitors
- 8:32because it would basically give them that same advantage that we had just been working on building up.
- 8:38So, what could happen?
- 8:39Well, if we build, uh, maybe uh, an attacker builds an AI agent that goes in
- 8:44and asks something of the LLM, gets the results back and records it.
- 8:49And then does that again, and gets the result back and records it. And keeps doing that again and again and again.
- 8:56If they do that enough times, they can essentially harvest off large parts of the model.
- 9:02This is called a model inversion attack.
- 9:04It's an extraction attack where I'm basically gathering the intellectual property and stealing it and getting it that way.
- 9:12So, those are different types of of sensitive information disclosures that can occur.
- 9:16What should we do to guard against this?
- 9:19Well, one thing that we can do is sanitize the data.
- 9:23Now, I ...
- 9:24this means cleaning your data.
- 9:25I don't know how you clean data exactly, but here's what we mean in this case.
- 9:30I'm going to install a filter of some sort that says, okay, I want certain of this
- 9:35information entering my model, but maybe not all of it.
- 9:38So this might be a source where I have my entire customer database,
- 9:41but maybe I don't want all of the customer database or all of information from that database going into the LLM.
- 9:48I may also use that concept that I talked about earlier, the AI gateway,
- 9:52on the other side that's gonna examine the information as it's leaving and look to see,
- 9:58does it look like I'm leaking credit card numbers?
- 10:01Well, maybe I wanna block that if that's what is occurring.
- 10:04So we can put these kinds of controls that are sanitizing the data that's going in and leaving the system
- 10:10and make sure that we're lessening the likelihood of an issue there.
- 10:14Another thing we should put in place here are strong access controls.
- 10:19And in this case, what I wanna do is make sure that not just anybody has access to the LLM.
- 10:26We don't want just anyone being able to go in and change our model because who knows,
- 10:30they could just make a copy of the model, for instance.
- 10:33So, access controls on the model, access controls on the data that is feeding the model.
- 10:39Make sure that somebody can't get in a mess with that or make copies of this information.
- 10:44Now, we've been doing those kinds of things, data security uh, issues, for a long time, but we continue to have to do that in this case also.
- 10:53Another place I might wanna put access controls is over here on the users.
- 10:57Don't just let anyone come in and access this if it's gonna be sensitive information that they could potentially get.
- 11:03And then finally, take a look at misconfigurations.
- 11:09So, uh, we could have a situation where a system is set up and maybe it's it's vulnerable.
- 11:16Maybe it's got down-level software.
- 11:17Maybe it's got uh, not a strong enough authentication mechanism.
- 11:22Maybe it's using an old version of a platform.
- 11:25There's a lot of different things that we would normally want to do.
- 11:27Maybe the data is not encrypted and it should be.
- 11:30So all of these go into this notion uh, of securing the entire system of AI security posture management.
- 11:39Making sure that the security policies that we have are implemented on the system so that it's less likely to leak.
- 11:47Up two spots on the countdown to number three, supply chain vulnerabilities.
- 11:53Supply chains.
- 11:54So what does that mean?
- 11:55Well, if we're gonna have a large language model, it doesn't exist just out of thin air.
- 12:01It starts with data.
- 12:03And we use that data to train and tune the large language model.
- 12:06And then maybe we have an application over here that takes advantage of that information and runs and uses all of that.
- 12:15Well, first of all, most people are never going to create their own LLM.
- 12:19It's too expensive, too time consuming, requires too much expertise, too much compute power, all of that kind of stuff.
- 12:25So where are they going to get their language models?
- 12:28Well, they're probably going to get it from an open-source place like Hugging Face.
- 12:32Hugging Face is essentially like the GitHub for AI models.
- 12:37And, at the last time I checked, there were more than two million AI models on Hugging Face.
- 12:43That's a lot.
- 12:44And many of these have more than a billion parameters.
- 12:47Again, a lot.
- 12:49So, if we're taking that information and putting that into our environment, this is way too big for anyone to manually inspect.
- 12:57Way too big.
- 12:58So, that means we're taking in basically unverified information, putting that in to
- 13:04our system and now we're just hoping for the best.
- 13:08Well, uh, another thing to consider is this whole thing doesn't just run in the air.
- 13:13This all runs on an IT infrastructure, and that means the systems themselves are also part of the supply chain.
- 13:22So we've got data, we've got models, we've got applications,
- 13:25we've got the systems underneath all of this stuff that everything runs on.
- 13:29Those are all part of a supply chain and they all have to work well or
- 13:33they're all potentially vulnerable. So what should we do about this?
- 13:37Well, first of all, you need to vet the information.
- 13:40In other words, verify that it's okay.
- 13:43Verify the data that you're using in your systems and the suppliers, the people who are giving it to you.
- 13:49Where did you get this stuff from?
- 13:51Um, these these folks up here, you don't necessarily know.
- 13:56You're getting it from an open source, so some of those are good, and some of them, meh, maybe not so much.
- 14:01So, what I need to be able to do is vet all of this information.
- 14:07Not only the model, but the data, the application, who built it, the IT infrastructure, all of that.
- 14:15Uh, next thing I need be able do is look at the provenance.
- 14:18Now that's basically a term where we're basically talking about in this case, where did this stuff come from?
- 14:24Uh, a provenance is is referring to where did ...
- 14:29where was the source and where did it go along the way?
- 14:32We can trace it all the way, almost like a chain of custody, if you want to think of it that way.
- 14:37Another thing I need to do is scanning.
- 14:39I need look at scanning the system, the models in particular, looking for vulnerabilities,
- 14:46doing red team testing, where I'm basically acting like an adversary, to test the this, the, uh, the, the security of my system.
- 14:58I wanna patch the system and make sure I've got all the software up to date.
- 15:02These are all controls that I need to put in across the entire system so that the supply chain is been solid.
- 15:10Number four on the Top 10 list, data and model poisoning.
- 15:15In this case, uh, this one actually went down one notch.
- 15:19Probably not from a great deal of improvement we've done there,
- 15:22but more just that these others have been more impactful, but still, top four still should be top of mind to you.
- 15:28So if we're talking about data, well, that is something we're gonna be using to train our model, as I mentioned before.
- 15:36So, we have to make sure that the data is pure, that the model is pure as well, and all of this stuff coming out to a user.
- 15:46Well, an example of this is what happens if the data, which is the lifeblood of the LLM, has wrong information in it.
- 15:54Maybe there's a mixture of truth with error.
- 15:56Just a little bit of toxin in the drinking water makes us all sick.
- 16:00So that replicates and follows on.
- 16:03That ends up affecting the accuracy of the model,
- 16:07which then ends up affecting the accuracy and efficacy of the information that we're giving to this user.
- 16:13So, those are kinds of things that have ripple effects if we're not making sure that these things
- 16:18have not been tampered with and not been poisoned.
- 16:21Sometimes they're very subtle attacks that are not easy to detect.
- 16:25But if we start depending on this more and more for our information and making decisions,
- 16:30then just a little bit of error introduced intentionally into the system could really affect a lot of things.
- 16:36So one of the things, you know, we have this big problem with large language models, that they tend to hallucinate.
- 16:41They just make up stuff.
- 16:42They're trying really hard and predicting what they think the right answer is,
- 16:45but sometimes they try too hard and get the wrong answer.
- 16:49So a technique we have for cutting down on hallucinations is a thing called retrieval augmented generation.
- 16:56And in this case, if I wanna say, I want you to reason over a particular document
- 17:02and I want to use this document as your ground truth, I'm gonna supply that document with my prompt.
- 17:08So that's the retrieval augmented generation. The generation is happing ...
- 17:12happening through this.
- 17:13So it's being augmented by this other data source.
- 17:16Well, I mentioned uh, supply chain poisoning and data, model poisoning can happen here.
- 17:22What if the document that we're using in the RAG uh, that we're augmenting the system with has been compromised as well?
- 17:29Well, guess what?
- 17:30That ends up being more of the same kind of problem.
- 17:32So what can happen as a result of that?
- 17:35Well, we get wrong results, wrong answers.
- 17:38And if we're depending on that, that's pretty important.
- 17:40We could also introduce bias into the system.
- 17:44So it might be okay for a while, and then over time, it gets more and more of this into it, and it just kind of snowballs.
- 17:51And now the system just runs out of control.
- 17:53We could all also end up with a case, if we're not really careful, uh, where malware has been introduced into the the system.
- 18:00You know, we, we know that, that software can be infected.
- 18:04It turns out models can be infected as well,
- 18:07and that the model equivalent to malware is something that could be into these systems if we're not guarding against it.
- 18:14So what should we be doing here in terms of defenses?
- 18:17Well, we need to know our sources.
- 18:19You'll see that as a constant and recurring theme.
- 18:24Don't just pull stuff down from anywhere and put it anywhere.
- 18:27Uh, we need to know.
- 18:28Where did this model come from?
- 18:30Where did that data come from?
- 18:31Where did that RAG source come from.
- 18:34I need to have access controls.
- 18:38Again, if I don't keep the bad guys out, there's no telling what they might do to me.
- 18:41I need access controls over who gets access to the model, the training data, the RAG data as well.
- 18:48And then any changes to the system.
- 18:50So if I have change control on the system, that's gonna be really important as well.
- 18:55I don't want just anyone coming in here and making change to my model, to my data, to my RAG sources.
- 19:02So, put all of those things in place and now we can lock down to a greater extent
- 19:07what someone could do to poison these sources.
- 19:10Okay, let's pick up the pace so that this doesn't turn into a three-hour video.
- 19:14Uh, number five is improper output handling.
- 19:19So think about our LLM in this case, and maybe what we're asking the LLM is to write code for us.
- 19:27Uh, maybe we're asking it to uh, to input something that goes into a browser.
- 19:34Uh, any of those kinds of things where the LLM's output is actually going and being used somewhere else
- 19:39means that if the LLM has been compromised or maybe hallucinates and just does the wrong thing,
- 19:45then it could actually end up introducing vulnerabilities for us as well.
- 19:50Things like cross-site scripting, things like SQL injections,
- 19:54uh, the remote code executions, uh, all of these things could happen
- 19:58if we're not checking to see what the output of the LLM looks like.
- 20:04So, we've got to be able to examine these things and don't just trust everything that comes out of the LLM
- 20:11or this grows into another execution environment and creates a downstream effect.
- 20:16Uh, another issue, number six, excessive agency.
- 20:20What does excessive agency mean?
- 20:22Well, imagine in this case, if we have somebody that comes along and does a prompt injection, as we've talked about before.
- 20:30And they inject into the system something that we didn't intend for it to do.
- 20:35But this system now has been given a lot of power.
- 20:38It has the ability to use tools.
- 20:40It has ability to execute applications.
- 20:44It might have APIs that it can call.
- 20:46It might have plug-ins that it can call.
- 20:48It might have external systems that operate on the real world that it can influence.
- 20:54Things that uh, you know, maybe control environmental conditions and things like that.
- 20:59So, if we have a system that has too much power over these things,
- 21:03it could be hijacked and therefore excessive agency, meaning it's got too much power, would be a big issue.
- 21:10And by the way, we also have to be concerned about the issue of hallucinations with this.
- 21:15If this thing uh, hallucinates and dreams up the wrong thing and then has the ability to make changes in the real world
- 21:21on systems that might affect health and safety, well, that could be a disaster for us.
- 21:25So, another one then, number seven that we're going to look at, is system prompt leakage.
- 21:31Remember I mentioned the system prompt earlier.
- 21:33That's the thing that's setting the context for the LLM.
- 21:37Well, sometimes the system prompt may contain sensitive information in it.
- 21:41Probably best if it doesn't, but it might.
- 21:44And if we're not careful, it could leak that information.
- 21:47If it contains credentials, and why would it do that?
- 21:50Well, maybe the LLM needs to log into one of these apps and it has told,
- 21:54it's been told that through the system prompt what the credentials are.
- 21:58It could be API keys, it could be other types of sensitive information.
- 22:03So if someone asked the question the right way and we don't have a guard,
- 22:07then the information from the system prompt that's sensitive might end up leaking out of the system.
- 22:13So we've got to be careful about that kind of situation also.
- 22:17Vector uh, embedding and weaknesses and things of that sort.
- 22:21So what does this involve?
- 22:22Well, I I mentioned also an example of using RAG, retrieval augmented generation.
- 22:29What if we have a RAG document that has been manipulated?
- 22:34And that information goes into the LLM.
- 22:37Normally, we don't want it to affect the LLM.
- 22:40But if we're not careful, it could.
- 22:42And this bad information could end up being part of the learning of the LLM.
- 22:47So we have to be able to make sure that the stuff that's coming in is d ...
- 22:52washing over the system.
- 22:53It's not staying into the system, because that would be a way that
- 22:56someone could introduce uh, things that make the system unreliable to us.
- 23:01Number nine on this list, a big one, misinformation.
- 23:06I mean, at the end of the day, we have to know.
- 23:08Is this thing telling me the truth or not?
- 23:11If it's not, well then, that's a big problem.
- 23:14This means we have to have good critical thinking skills.
- 23:18We have to really think about ...
- 23:20Did the information come out of this system?
- 23:23Is that something reliable?
- 23:24Does it make sense?
- 23:25Can I cross-reference that against other sources?
- 23:28Um, we can't just blindly trust the system because it again could have been manipulated or it could be hallucinating.
- 23:35So we've got to make sure that we're guarding against misinformation and we're not basing our decisions on on a really shaky ground.
- 23:42And then coming in at number 10 on the list is uh, unbounded consumption.
- 23:48Unbounded consumption sounds like a really big word.
- 23:52What does it mean?
- 23:52Well, it really comes down to denial of service.
- 23:57If you're not familiar with that term, go out on the highway at 5 PM and you'll see what denial of service feels like.
- 24:04There's not enough road for all the cars.
- 24:06Well, an AI system, if we send too many commands into it at a point in time
- 24:11or long-running commands or commands that require a really complex language model,
- 24:17then we could basically take the system down, make it not available to anyone else.
- 24:21That's called denial of service.
- 24:23Other people also refer to this term denial of wallet.
- 24:27In other words, we're running this system in order to achieve a particular financial goal,
- 24:32and if I'm able to deny that this system is available to the people it needs to be,
- 24:36well then, that's a denial of wallet, and that's going to cost us real money.
- 24:42So there's the Top 10 list of attacks against LLMs according to OWASP.
- 24:46The bad guys already know this stuff and now you do too.
- 24:49Check out their website for more details and links in the description below
- 24:54for security solutions that can help you keep your AI running under your control, instead of the bad guys.
About this transcript
This page contains the full transcript of OWASP's Top 10 Ways to Attack LLMs: AI Vulnerabilities Exposed by IBM Technology, generated from the public captions YouTube serves with the video. The transcript has 4,467 words across 330 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.