[00:00.000 --> 00:01.020] All right. [00:01.020 --> 00:02.380] Hi, everyone. [00:02.480 --> 00:04.140] Welcome to DEF CON. [00:04.220 --> 00:15.580] Today I'll talk about Orion, a system we built to automate the entire fuzzing workflow, from picking up what to fuzz, to generate harnesses, seeds, even creating fixes. [00:15.860 --> 00:18.380] This work is a collaboration between me and Marius. [00:18.380 --> 00:28.840] We both spent many years creating authentic security tooling, so Orion is our way to make fuzzing smarter, faster, and frankly, less painful. [00:31.660 --> 00:32.300] All right. [00:32.800 --> 00:34.300] Let's talk who we are. [00:34.300 --> 00:38.800] I'm Max Bazali, I lead an authentic security team at NVIDIA DriveOS. [00:38.920 --> 00:48.240] My main focus right now is discovery of vulnerabilities, using AI tools, formal methods, and general security research. [00:48.340 --> 00:55.600] Before NVIDIA, I was doing a lot of research on Apple operating systems, creating jailbreaks for iOS and watchOS. [00:55.600 --> 01:01.820] Actually, I present very first Apple watch jailbreak here at DEF CON 25, many years ago. [01:02.440 --> 01:11.700] During the time, we even discovered first Pegasus spyware on iOS and published the white paper about tried and exploit chain using that attack. [01:11.740 --> 01:12.940] Let me hand it off to Marius. [01:13.420 --> 01:19.760] I'm Marius Fleischer, I'm a security engineer with NVIDIA's authentic security team for DriveOS. [01:19.760 --> 01:23.640] I primarily focus on applying AI to security challenges. [01:23.840 --> 01:29.520] Before NVIDIA, I was at UC Santa Barbara, working at the security lab with Giovanni Vigna and Chris Krugel. [01:29.520 --> 01:35.080] I was primarily looking at how we can do automated vulnerability discovery for operating systems. [01:35.600 --> 01:36.260] Cool. [01:36.340 --> 01:46.400] So, most of us spend a lot of time, probably more than we wanted, on creating harnesses, managing fuzz and infra, and do all this, like, glue around fuzzing. [01:46.580 --> 01:52.400] So, that's why we created Orion, to make, like, take the painful parts out of fuzzing and automate them. [01:53.100 --> 01:56.080] Let's actually see what exactly we are doing. [01:56.080 --> 01:59.320] And for that, we need to understand the core loop behind the fuzzing. [01:59.360 --> 02:04.540] That's how all the modern feedback doing tools like IFL or the fuzzer works. [02:04.800 --> 02:14.020] It all starts with a, like, seed corpus, initial inputs, the fuzzing tool takes it, mutates it, run to the target through the test case. [02:14.340 --> 02:18.880] All the test cases executed through the harness, that's, like, a very important step. [02:19.200 --> 02:26.280] And if, like, during the run time, we basically can collect the code coverage to understand what is going on with our target. [02:26.440 --> 02:32.520] If our inputs, you know, like, explore the new path, hit the new branch, that is great. [02:32.620 --> 02:38.820] It gets added to the seed corpus, and basically that's the way how the fuzzing tool can understand where to dig deeper over time. [02:39.260 --> 02:42.060] If our inputs find a crash, that's great. [02:42.060 --> 02:43.500] We potentially found a bug. [02:43.700 --> 02:51.820] Most of the bugs currently detected by ASAN UBISOFT, great sanitizers detecting stuff at the run time. [02:52.060 --> 02:53.980] So, what's the problem with the loop? [02:53.980 --> 02:56.800] Basically it's hard to make it work properly. [02:56.800 --> 02:58.300] A lot of moving parts. [02:58.300 --> 03:05.500] We need right targets, we need the solid harness, we need the good seeds, and basically a good fuzzing tool. [03:05.500 --> 03:10.020] If anything goes wrong, basically our fuzzing campaign most likely will fail. [03:10.240 --> 03:12.680] So, that's where Orion comes in. [03:12.680 --> 03:17.400] We take the, like, time-consuming parts out of this loop and automate it one by one. [03:19.620 --> 03:21.640] Let's talk about LMs a bit . [03:21.640 --> 03:27.740] I hear they're very, very popular right now, and surprisingly we use LMs at Orion. [03:29.320 --> 03:33.980] Let's talk a bit why we think LMs are a good fit for this kind of task. [03:34.440 --> 03:53.540] Actually, LMs, like, we know neural networks, training huge corporate text and code, that's all good, using, like, transformer architecture under the hood, which unlock really nice capabilities, like, reasoning through the code, generating code, spotting some risky patterns. [03:53.820 --> 03:57.660] That's why we think it's a great fit for security automation like fuzzing. [03:58.280 --> 04:05.340] Speaking of the risky patterns, LMs can spot bugs, they can occasionally even introduce the new ones. [04:05.340 --> 04:14.560] So, that's why we should never trust them, never trust them blindly, and always run through the validation loops, and we will talk in a bit how exactly that works. [04:15.140 --> 04:18.500] Okay, just a few words about agents. [04:18.820 --> 04:26.620] Basically, this is how LMs can evolve into something more capable than just, like, passive tools, we ask, they respond. [04:27.040 --> 04:36.960] With agents, we can give LMs a task, we can give it access to tools, and a way to, basically, understand what's going on, refine and correct if needed. [04:36.960 --> 04:39.620] Very, very similar to what humans would do. [04:40.040 --> 04:41.540] What does it mean in practice? [04:41.760 --> 04:51.340] We need to generate, let's say, fuzzing harness, so the agent can, you know, first scan for any dependencies, generate the code, try to compile the code. [04:51.500 --> 04:54.380] If compilation fails, okay, let's make another attempt. [04:54.380 --> 04:59.520] So, that's what we call the agentic loop, it's like act, observe, and refine. [04:59.620 --> 05:02.880] Again, very similar to what the real humans would do. [05:03.940 --> 05:13.740] This loop is important, this agentic loop is important because that's a way how we can trust these agents and basically make this automation possible in the first place. [05:15.080 --> 05:15.880] Cool. [05:16.220 --> 05:21.680] We're going back to our fuzzing loop to understand, like, what exactly we're automating. [05:21.860 --> 05:26.500] The very first question with fuzzing to understand what we want to fuzz, right? [05:26.700 --> 05:39.040] And that may be tricky because in the large code bases, like we got in Drive IS, maybe millions of lines of code, thousands of functions, probably a lot of them are really interesting from security perspective. [05:39.040 --> 05:47.860] What we really care is, like, high risky interfaces, code that's parsing, untrusted user input, stuff like that. [05:48.900 --> 05:59.220] That's usually the very manual work to identify them, there is no easy way, like we need to do some threat modeling, look into the code, look in architecture, like, all of this. [05:59.500 --> 06:10.300] That's why we create an agent that can help us do this work, analyze the code, understand how this code can be triggered, run the function and basically say, hey, this is what makes sense to fuzz. [06:12.460 --> 06:22.280] Next one, even if we know what to fuzz, we need to trigger the code that we want to fuzz, basically we need to create the harness, this glue between fuzzing tool and the target. [06:22.820 --> 06:33.560] If our harness is bad, like, incomplete, you know, we miss some memory location, it will just crash or, like, do nothing and waste a lot of fuzzing cycles. [06:33.560 --> 06:37.560] So, if I have a bad harness, we'll find zero bugs. [06:38.840 --> 06:53.720] That's why we basically create another agent in Orion that can analyze the code for us, understand what kind of dependence is needed, do the proper setup, proper, like, teardown if needed, memory location, basically creating all this context for harness. [06:53.720 --> 06:57.120] And we will look really soon how exactly that works. [06:57.460 --> 06:58.420] Cool. [06:58.740 --> 07:00.280] What next? [07:00.340 --> 07:03.100] We know what to fuzz, we know how to fuzz. [07:03.120 --> 07:12.020] We not really go far without initials inputs, because we remember that's the very first thing that fuzzing tool takes and mutates. [07:12.080 --> 07:18.000] If our inputs are bad, it will be rejected by a target or, even worse, it can just crash the target. [07:18.700 --> 07:31.520] So, we create another agent that can help us analyze the code, understand how the inputs are handled, what are the checks, are there any magic bytes, are there any string constants that we need to take care. [07:31.620 --> 07:35.340] And basically create an input that makes sense from target point of view. [07:35.920 --> 07:39.240] So, we not waste time on fuzzing the wrong thing. [07:40.820 --> 07:41.700] All right. [07:42.260 --> 07:48.200] Let's say we collect it all together, we run, and our fuzzing finds some crashes. [07:48.200 --> 07:49.360] So, what's next? [07:49.620 --> 07:51.500] Are these crashes the real bugs? [07:51.500 --> 07:52.460] Maybe. [07:52.740 --> 07:53.520] We don't know. [07:53.520 --> 07:55.620] We don't know until we can reproduce them. [07:55.620 --> 08:00.020] So, if we can't reproduce the bug, we can't triage it, we cannot fix it. [08:00.300 --> 08:04.000] And usually, the process of reproducing it may take time. [08:04.000 --> 08:10.000] So, we need to take inputs, like run it in the same environment where the crash happens, like many, many steps. [08:10.000 --> 08:21.040] We create an agent that helps us with that and basically look into what happened, why it happened, what sanitizers trigger a crash, and basically create some minimal reproducer. [08:21.040 --> 08:26.360] So, some small program that we can run over and over to understand if this bug still exists or not. [08:27.300 --> 08:33.420] And finally, the final challenge that we are automating after we detect the bug and reproduce it. [08:33.420 --> 08:35.840] So, we want to fix it, ideally. [08:36.720 --> 08:45.860] And fixing, it's maybe a problem, because where the crash happens, maybe not the root cause, where the actual bug is at first. [08:46.380 --> 08:52.680] Second, our fix, like, it can introduce the new security bugs, like, more than we are fixing. [08:52.700 --> 08:56.020] So, we really need to understand why this happened, what the root cause. [08:56.240 --> 08:57.840] It's usually the manual work. [08:58.200 --> 09:10.980] So, we create an agent that first rely on the reproducer from the previous step, creates us a minimal patch, verify this patch using the reproducer, and if everything is cool, we send it for a human to review. [09:10.980 --> 09:20.160] So, we still, we don't want LLMs to, you know, push the code uncontrollably into our release branches, so we still want to review these kind of things. [09:20.240 --> 09:26.520] All right, this is how everything comes together, like, it's the high-level design of Orion. [09:26.680 --> 09:35.220] We create it to automate the entire fuzzing workflow, from identifying what to fuzz, to creating patches if there are any crashes, right? [09:36.080 --> 09:42.440] It's separated into different phases, like, each phase is dedicated for specific agents that are doing this kind of work. [09:42.660 --> 09:49.740] So, we start with one agent, the output, the first agent is input to another one, and so on, so on. [09:49.740 --> 09:52.920] Think of it like an assembly line, but for fuzzing. [09:53.380 --> 09:59.820] We start with interface analysis agents, like, analyze the code, say, OK, this is what makes sense to fuzz. [10:00.080 --> 10:01.540] Switch to the harness. [10:01.560 --> 10:07.660] Harness generation agent creates the harnesses that we can compile for all the targets we selected. [10:08.080 --> 10:12.740] Next, seed generation agent, then we just run our fuzzing campaign. [10:12.980 --> 10:18.360] Depending on the tool we use, depending on, like, what we want to fuzz, it may take some time. [10:18.360 --> 10:30.080] If there are any crashes or findings, the agents will pick it up, basically create the reproducers, create the patches if possible, and basically give it for humans to review. [10:30.880 --> 10:37.720] So, with this approach, basically we can run all the agents together, we can run all the agents one by one. [10:37.720 --> 10:43.220] If anything fails in between, let's say we create a harness, we can't compile it, that's OK. [10:43.260 --> 10:48.120] The agent will make another attempt with updated information from the compiler, for example. [10:48.740 --> 11:00.220] We use it to scale fuzzing across NVIDIA, and since we deployed this project, we found more bugs compared with, like, manual fuzzing campaigns. [11:01.280 --> 11:01.960] All right. [11:02.600 --> 11:05.740] I want to talk a bit about feedback loops and oracles. [11:05.740 --> 11:08.820] Basically, that would make this agent reliable. [11:08.820 --> 11:15.240] Because we don't trust LLMs, they will hallucinate, do all this kind of, like, interesting stuff. [11:15.560 --> 11:23.060] So, but what we can do, we can take a tool that we can trust, like some deterministic tools, and use them to validate the output. [11:23.160 --> 11:26.480] For example, we generate the code, we run it through the compiler. [11:26.780 --> 11:33.460] We create a harness , we try to execute the harness and see if it crashes, if it's really generating any code coverage for us. [11:33.460 --> 11:34.620] This kind of stuff. [11:34.920 --> 11:42.860] So, these agents, they are part of this loop, we call it validation loop for every agent. [11:42.860 --> 11:47.120] And until the agent can pass all the validation checks, it's not moving forward. [11:47.120 --> 11:51.420] That would make it reliable and basically all this automation possible. [11:52.480 --> 11:53.440] All right. [11:54.120 --> 11:57.180] A few words about infrastructure. [11:57.240 --> 12:01.960] Because it's all this stuff not going to be possible without proper infrastructure. [12:01.960 --> 12:12.080] Because by default, LLMs have no idea how our code is structured, what interface are internal, what are external, where the data types are defined, all of it. [12:12.160 --> 12:18.280] Without that, agents will be guessing, hallucinating, like, all kind of non-fun stuff. [12:18.340 --> 12:20.580] So, we have to create infrastructure. [12:20.640 --> 12:39.980] Basically, we have to parse the code, we have to understand dependencies between functions, we have to create the call graphs, basically create some minimal context, basically, like, where all the data types or dependencies are defined, that we can pass an agent to do the proper work for analysis or code generation. [12:40.900 --> 12:41.460] All right. [12:41.800 --> 12:44.220] Next, we will talk about benchmarking. [12:46.660 --> 12:50.640] Benchmarking is another very important part of building a system like Orion. [12:50.640 --> 12:57.600] It really helps you understand how your individual improvements improve the overall performance of Orion. [12:58.080 --> 13:06.020] We chose to have a very simple, reliable benchmark suite by using human annotated ground-truth data as the base. [13:06.200 --> 13:12.820] And then we can use a few different ways, a few different aspects of our system's output and analyze that based on that data. [13:12.920 --> 13:16.560] The simplest way, of course, is to just directly compare to your ground-truth data. [13:16.560 --> 13:19.200] That may work especially well for integers. [13:19.520 --> 13:28.440] In some other cases, when you're ranking target functions, you may care more about the relative ranking of these individual functions more than the actual concrete score. [13:28.440 --> 13:31.560] So you may look for pairs and how they relate to each other. [13:32.020 --> 13:39.560] If none of this works, you can always fall back to an LLM judge where you just have an LLM review the system's output. [13:39.560 --> 13:44.740] In our case, because we have ground-truth data, we can get a very reliable judge in that way. [13:45.240 --> 13:51.500] For our targets, we choose, of course, the NVIDIA GPIO driver for QNX, which is a user-space driver. [13:51.500 --> 13:57.280] Because of that, we choose two additional open-source user-space applications listed on our slides. [13:58.420 --> 14:01.280] So let's have a look at our actual agents now. [14:01.360 --> 14:04.860] The first one is about finding the targets we want to fuzz. [14:04.940 --> 14:10.080] We really want to find functions that are likely to have bugs that a fuzzer can find. [14:10.280 --> 14:16.180] So that means we define a set of metrics that you can individually evaluate against the functions. [14:16.580 --> 14:19.620] And then you can combine those scores for the final ranking. [14:19.940 --> 14:28.460] One example of such a metric would be dangerous expressions, so we're looking for pointer dereferences or pointer arithmetic or similar things. [14:29.120 --> 14:31.220] The output of that agent might look something like this. [14:31.220 --> 14:37.240] We have individual scores for all the metrics, and we combine them and rank on the final combined score to have a holistic picture. [14:38.180 --> 14:43.540] Once we have the functions that we actually want to fuzz, we can go on to the next phase, the harness generation. [14:44.220 --> 14:48.600] The first step in the harness generation is what we call the dependency analysis. [14:48.900 --> 15:00.160] So in this step, we have an agent that goes to the code base and tries to understand which functions depend on which others, and also how do you clean up after calling your interface. [15:00.160 --> 15:03.160] So you may have to deallocate some objects. [15:04.880 --> 15:13.920] The output that we get here is essentially a list of functions to call before our target function and a list of functions after, and also the reason why we have to do that. [15:14.560 --> 15:18.960] With this information, we can now actually go and create a harness. [15:19.380 --> 15:27.320] So this harness generation agent has to create this piece of code that sits between the fuzzer and the actual target interface. [15:27.320 --> 15:42.540] So that means it has to be compatible with the fuzzer, has to be able to understand those inputs, transform them into whatever structure the target understands, and also set up and tear down the target interface correctly so that we can repeat this over and over again. [15:43.400 --> 15:50.480] In our case, we're fuzzing with lip fuzzer and AFL, so we use the harness format that is compatible with that. [15:50.600 --> 15:57.400] It's also important to have all the right header files included, otherwise your harness won't compile, and we do need to call the target function in the end. [15:58.900 --> 16:04.580] Now, because LLMs may or may not produce correct code, we do need to do some verification here. [16:04.900 --> 16:13.180] Of course, we can just give it to a compiler, ask the compiler is this code correct, and if it's not, we'll give it back to the LLM to fix that. [16:13.380 --> 16:21.060] We also have another LLM with some guidelines to review the harness to make sure there are some more semantic components that make sense. [16:21.820 --> 16:33.000] If anything goes wrong here, like on the right side here, we would just take the error and take the harness that produced the error, give it back to the harness generation agent, and ask it to fix that problem. [16:33.140 --> 16:35.280] If not, we're happy and we can move on. [16:37.020 --> 16:39.720] Now, next step is the seed generation. [16:39.900 --> 16:55.340] So now, we want to find those inputs that are good in the sense that they will produce good coverage, and they will also hit a few of the edge cases, maybe help the fuzzer overcome some of the challenging aspects like checksums or matching values that you need to hit. [16:55.460 --> 17:06.260] So we have an agent that goes through a code base, looks for all these things, and then tries to output a good seed corpus of multiple inputs that together cover all these cases. [17:07.640 --> 17:25.660] For a function that has, say, three arguments that might look something like this, for each individual argument, we will have a part of the seed that corresponds to that, and because LLMs are not great at outputting binary data, we either get a structured output from it, [17:25.660 --> 17:32.840] or we can also have it generate, for example, a batch script that if you execute, actually gives you the binary seed that we can provide to the fuzzer. [17:34.500 --> 17:39.900] At this point, we have all the artifacts that we need, the harness, the seeds, and we can start fuzzing. [17:40.100 --> 17:53.820] So at NVIDIA, we have a cloud infrastructure that you can just provide these artifacts to, and then this infrastructure will go wait for a runner to become available, set up that runner correctly so that it's the correct fuzzing environment, it will run the fuzzing, [17:53.820 --> 17:55.380] monitor what's going on. [17:55.380 --> 17:59.280] Once we have results, it will collect that and provide it back to Orion. [17:59.820 --> 18:02.460] The purpose here is kind of twofold. [18:02.500 --> 18:08.400] One, of course, it executes our fuzzer, but it also kind of works like a second feedback loop. [18:08.400 --> 18:21.040] If there's anything unexpected during a fuzzing campaign, say, less coverage than we expected, or some crashes that shouldn't have happened, we can give that back to Orion, to the harness or seed generation agent, and ask for an approval again. [18:21.780 --> 18:23.860] Of course, we may also find bugs. [18:23.860 --> 18:29.160] In that case, we would then go and start our patch or bug analysis pipeline. [18:30.240 --> 18:33.760] The first step here is to analyze what went wrong. [18:33.760 --> 18:36.720] So we're looking for the root cause with this first agent. [18:36.960 --> 18:44.000] It will essentially go look at stack traces, look at sanitizer logs, also have a look at the source code, and try to figure out what went wrong. [18:44.300 --> 18:51.980] Once it has an idea, it will also generate a minimal reproducer to prove that it was right, which is, again, another feedback loop. [18:52.600 --> 19:05.220] Once we have that reproducer, we have something that we can actually give to a human that makes it easier to understand what went wrong, and we also have what we need for the next phase as a reproducer, as a feedback loop. [19:06.260 --> 19:09.160] The next phase being the patch generation. [19:10.100 --> 19:21.460] So here now, we want to generate a patch that's meaningful and that actually goes to fix the root cause, not just block symptoms or maybe even just removes the vulnerable function. [19:22.140 --> 19:26.280] It should apply cleanly to the code base and it should compile. [19:26.660 --> 19:31.700] If it matches the coding style of the whole code base, that's also great. [19:33.040 --> 19:37.260] So the output is essentially a diff file that you can apply. [19:37.300 --> 19:40.140] We will, of course, give that to a compiler as a feedback loop. [19:40.140 --> 19:48.640] We will also use the reproducer that we just generated and have that as a second way of verifying that we actually patched the bug that we wanted. [19:49.300 --> 19:56.180] And as Max previously already mentioned, we will not just push this to main, we will actually give this to a developer to make sure that this is correct. [19:57.340 --> 20:01.080] At this point, you might ask, does this actually work? [20:01.140 --> 20:06.620] And to give you an idea of whether or not this works, we brought some of our benchmarking suite data. [20:07.320 --> 20:16.320] So for a little bit of context, we started the development of these agents with GPT 4.0, but we have since switched to 4.1 just because it's better. [20:16.620 --> 20:22.460] And all the data that you will see on the following slides and on this one will all be from GPT 4.1. [20:23.060 --> 20:27.800] The LLM judges that we have as part of our benchmarking suite, they use open source models. [20:27.800 --> 20:30.260] So Lama, Nemotron, these kinds of things. [20:31.240 --> 20:36.540] In terms of the interface analysis, overall we have seven different metrics that we evaluate. [20:36.540 --> 20:47.640] And if you average across these metrics and across all the three different targets that we have in our benchmarking suite, you will see that in 95 percent of the cases, we actually evaluate the metrics correctly, which is pretty cool. [20:48.280 --> 20:54.360] The two metrics that you can see here on the slides are actually the two worst metrics out of the seven that we have. [20:54.360 --> 20:56.420] All the other ones are better than what you see here. [20:56.740 --> 21:00.300] The metric we seem to be struggling the most with is dangerous expressions. [21:00.340 --> 21:04.520] So what we're looking for here is essentially, are there pointer references? [21:04.520 --> 21:05.820] Is there pointer arithmetic? [21:05.940 --> 21:07.740] Maybe there's also some bit operations. [21:08.200 --> 21:18.180] As far as we know, the problem here is that some of our targets use macros heavily or have some other aspects that make it hard to resolve some of the symbols. [21:18.180 --> 21:21.200] So the LLM doesn't really fully understand the code. [21:21.200 --> 21:25.300] And that makes sense, but also makes it very hard for the LLM to figure out what's going on. [21:26.000 --> 21:29.200] The other metric on the slide here is about sync functions. [21:29.200 --> 21:33.600] So we're looking for functions that are commonly seen in the context of vulnerabilities. [21:33.600 --> 21:37.040] For example, memcpy for a buffer overflow or things like that. [21:37.040 --> 21:40.540] And that seems to be doable for the LLM. [21:42.240 --> 21:46.780] In terms of harness generation, this task seems to be a little harder. [21:46.960 --> 21:50.280] The performance is a little worse, but still pretty good overall. [21:50.500 --> 21:54.300] We have nine different metrics that we evaluate here in our benchmark. [21:54.300 --> 21:57.940] The two here, I think, might be the most interesting for you. [21:57.940 --> 22:04.300] The one in the middle is about whether or not our generated harness passed all the verification steps. [22:04.300 --> 22:09.400] So that's the compiler, that's also our other LLM that verifies if everything is correct. [22:09.640 --> 22:12.800] And we have a pretty good performance here, I would say. [22:13.240 --> 22:18.580] The metric on the right is the one that I find actually more interesting and more impressive, even though the number is lower. [22:19.140 --> 22:24.880] This metric is about finding out whether or not in the harness there's all the functions that we need to call. [22:24.880 --> 22:29.020] So all the dependencies, the actual target function, and also the cleanup after. [22:29.320 --> 22:38.900] The reason why I think that's the more impressive number is because this performance is largely dominated by the dependency agent. [22:39.160 --> 22:45.940] And the task of this agent is to go through the code base without any documentation and understand where are the dependencies in this code base. [22:45.940 --> 22:51.620] I think that's a pretty hard task, even for a human, and the fact that this agent is doing so well is actually quite impressive. [22:52.480 --> 22:56.500] Now I'll pass it back to Max for the time-savings. [22:59.420 --> 23:00.660] All right. [23:00.700 --> 23:02.220] Thanks, Marius. [23:02.440 --> 23:05.660] Basically, let's take a look at the time-savings. [23:05.900 --> 23:11.880] We compare how much time we spend doing this work manually compared with the automation. [23:12.360 --> 23:16.140] And that's the real numbers from our internal deployments of Orion. [23:16.240 --> 23:22.000] We split it in three sections, like interface analysis, harness generation, and patching. [23:22.780 --> 23:35.880] For interface analysis, we get a lot of time-savings, because if you remember, that's work that we need to do manually, like look into the code, understand if it makes sense to fuzz or not, if it makes sense how we can fuzz it, and so on. [23:35.880 --> 23:43.200] So with agent doing this work for us, we can save days, sometimes even weeks, of the manual work. [23:43.460 --> 23:44.900] Next one is harness generation. [23:44.900 --> 23:46.740] This is where we see most of our savings. [23:46.740 --> 23:52.360] And the reason for that, doing harness is taking a lot of time. [23:52.360 --> 23:53.380] It's hard, right? [23:53.380 --> 24:03.260] Because we need to think about input, we need to think about any set-up, tear-down, globals, all this kind of stuff. [24:03.260 --> 24:08.180] With agents that can do this work for us, we see most of the savings. [24:08.180 --> 24:12.320] Again, let's say we need to create harnesses for a hundred functions. [24:12.320 --> 24:16.840] It may take days, it may take weeks, again, depending on the code base. [24:17.060 --> 24:19.240] So that's a really, really good help. [24:19.240 --> 24:20.740] Finally, the patching. [24:20.860 --> 24:28.420] This category is maybe not as impressive as harness gen, and the reason for that, we still want to review patches that LM generated. [24:28.420 --> 24:32.620] We don't trust LM that much to uncontrollably push the code. [24:33.060 --> 24:39.600] Still, like, it can create us, the reproducers, it can create the patches that pass the validation checks. [24:39.600 --> 24:41.000] It's a huge, huge help. [24:41.680 --> 24:49.960] All right, I know it's a Friday night, guys, so let's take a look at how we run works in practice. [24:50.400 --> 24:54.140] So what we will do now, we'll run Orion on the real target. [24:54.140 --> 24:57.560] It's a C -lib, it's an open source C package manager. [24:57.620 --> 25:00.980] We take the latest version of C-lib and we run Orion on it. [25:01.520 --> 25:03.240] And let's take a look. [25:03.560 --> 25:06.780] So we split the screen in two parts. [25:06.800 --> 25:10.700] Left side is show the current flow of the agents, what's going on. [25:10.700 --> 25:13.280] The right side shows the output of an agent. [25:13.280 --> 25:15.080] And we start with the target selection. [25:15.080 --> 25:19.360] Basically, we scan the code and look like what makes sense to us. [25:21.340 --> 25:25.280] It may take some time, because we run each function. [25:25.280 --> 25:28.860] Okay, so we've got like 11 functions that make sense to us. [25:28.860 --> 25:31.560] And we jump to the next phase, which is seed generation. [25:31.560 --> 25:35.460] Basically, creating the seeds for C-lib package install. [25:37.420 --> 25:44.480] It takes time, analyze the code, analyze all the input arguments, and we jump into harness. [25:44.600 --> 25:50.680] So the reason why we do seeds and harness, we want harness to support our seeds first. [25:51.060 --> 25:58.100] With harness generation, we have to take a look at the dependencies, set up, tear down stuff, globals. [25:58.100 --> 26:01.740] So it will take time for an agent to figure it all out. [26:02.060 --> 26:06.000] Create us or generate us the code that will pass to the compiler. [26:06.220 --> 26:08.160] Basically, that's what happens on the right side. [26:08.160 --> 26:11.580] So we see some intermediate code generated by an agent. [26:12.800 --> 26:15.880] And let's see if it can be compiled. [26:20.190 --> 26:21.430] All right. [26:22.390 --> 26:26.490] Again, depending on the size of the code, it may take more time. [26:26.510 --> 26:32.910] Well, in our case, the compilation failed, which means the code generated by LLM was not great. [26:32.930 --> 26:33.890] But that's okay. [26:33.890 --> 26:40.430] The agent will make another attempt to self-correct, basically, and create us a new harness. [26:40.430 --> 26:42.230] All right. [26:42.230 --> 26:49.830] So essentially, we took the warning that the compiler gave us and give it back to the harness generation agent. [26:50.090 --> 26:56.430] It will generate a new harness, and it will then first pass it to the LLM verifier to make sure everything's okay. [26:56.550 --> 27:01.670] And only if it passes that verification, we will actually go on and go back to the compiler. [27:01.670 --> 27:12.150] Only if both of those pass, and we can see here, the LLM passed, only if both the verifications pass, we will actually use this harness for the further processing. [27:13.590 --> 27:15.130] So we're through the first stage. [27:15.130 --> 27:16.690] The LLM thinks this is okay. [27:16.690 --> 27:18.370] Now we're waiting for the compiler. [27:23.700 --> 27:25.640] That may take a second. [27:30.070 --> 27:32.230] And the compiler also thinks this is okay. [27:32.230 --> 27:33.870] So now we can actually start the fuzzing. [27:33.870 --> 27:38.530] We will use the seeds that we just generated with our harness, and we just run the fuzzer. [27:39.490 --> 27:46.430] Now we had very good seeds, so we very quickly found a bug, and we kick off the patch generation. [27:46.630 --> 27:58.970] So the patch generation now goes through the code base, and we'll start modifying the code base to try and patch the bug, and it will then also invoke the compiler and the small reproducer to see if this is patched. [27:58.970 --> 28:01.230] You can see here, it was actually successful. [28:01.230 --> 28:03.150] So we did generate a correct bug. [28:03.150 --> 28:07.610] It compiles, and the reproducer doesn't trigger anymore. [28:09.590 --> 28:10.850] Thank you. [28:14.110 --> 28:16.650] All right, let's talk a bit about findings. [28:16.650 --> 28:21.790] So we tried to run many open source targets. [28:21.790 --> 28:25.330] One of them is C-lib, so we just found a stack overflow. [28:25.570 --> 28:29.190] We tried on H3, and we deployed it internally at NVIDIA. [28:29.570 --> 28:32.690] So at C-lib we found many security bugs. [28:33.090 --> 28:37.150] C-lib was fuzzed for years by OSS fuzz, but they still are missing. [28:37.390 --> 28:41.110] We will not share all the details of the bugs because they are not fixed yet. [28:41.370 --> 28:44.830] We want to give maintainers a bit more time to fix them. [28:44.830 --> 28:50.550] If you use C-lib in the production, and you are concerned about that, sure, let us know, we can talk. [28:50.990 --> 29:07.190] Internally we deployed at NVIDIA drive stack, maybe like 18 months ago, we found 100 new bugs, mostly in C and C++ code, memory corruption, the main source of the bugs. [29:07.670 --> 29:18.730] With the help of agent that can help us filter out if it's a real bug or not, of course, understanding if it's a crash or a real bug helps a lot. [29:18.950 --> 29:22.330] Anyway, that's for the findings. [29:22.330 --> 29:25.330] Let's talk a bit about where the LM can fail. [29:25.810 --> 29:32.130] And as we already mentioned, LMs first of all don't know your code base. [29:32.350 --> 29:35.110] So they will be guessing without the proper context. [29:35.350 --> 29:40.050] If you don't provide all the information, they will hallucinate and do all the other type of stuff. [29:40.350 --> 29:47.230] So this infrastructure is the mass that creates at least the minimal context that we pass to an agent for analysis for code generation. [29:47.630 --> 29:51.910] The next one, even with the proper context, LMs still can be unreliable. [29:51.910 --> 29:56.870] They can hallucinate, invent stuff, do all the other kind of things. [29:56.870 --> 30:04.750] For example, very first iteration of our patching agent was just removing the code that crashed it and say, hey, old tester, pass it, like all good. [30:05.410 --> 30:18.950] So to mitigate this kind of stuff, we need to use oracles, like tools that we trust, compilers, fuzzers, sanitizers, any tool that can be used to validate the output of an agent or LLM. [30:19.010 --> 30:21.330] Otherwise, it will hallucinate. [30:21.330 --> 30:26.030] Finally, sometimes LLMs are not the best answer, right? [30:26.030 --> 30:36.950] Like Python on Barscript, if the Python on Barscript can do exactly the same work as the fancy multi-step agent, maybe just use the script, it will be faster and definitely cheaper. [30:38.150 --> 30:40.090] Let's talk a bit about the tools. [30:40.310 --> 30:46.890] So we hear discussion, are the LLMs going to replace all the tools, like what the future is? [30:47.050 --> 30:48.350] First of all, we don't think so. [30:48.350 --> 31:04.630] I think each side doing what they design it to do, so the tools are great combination with agent, with LLMs, because sometimes they just belong to the models, like models probably not going to do the great work generating call graphs, generating ISTs, [31:04.630 --> 31:07.890] where there's some deterministic tool can do it very reliably. [31:08.610 --> 31:10.490] But tools can be great oracles. [31:10.610 --> 31:16.030] So as I mentioned, if you have a tool that can use for validating the output, definitely use it. [31:16.030 --> 31:25.290] If you can use it, if you can do it in the way basically without like any probabilistic guessing that LLMs do. [31:25.290 --> 31:29.910] So for example, I really want to believe this is my compiler not hallucinating to me. [31:30.650 --> 31:35.870] Finally, tools are great for providing context for an agent. [31:35.870 --> 31:46.110] So generating call graphs and generating dependency graphs, all this kind of stuff, it's really helps and really boost agents to do the proper work for analysis or generation. [31:47.590 --> 31:56.290] In terms of benchmarking, some of the lessons that we learned is that, well first of all, LLMs and LLM agents, they're still software. [31:56.290 --> 32:00.810] So all the things that we learned about how to benchmark software, that still applies here as well. [32:00.810 --> 32:05.510] You want to look for coverage, you want to hit all the edge cases that you can and so on. [32:06.210 --> 32:13.370] It's always of course the best if you can verify your agent's output using an actual tool without any LLMs, that's most reliable. [32:13.370 --> 32:18.950] But that's not always going to be possible and LLM judges can be very effective in this scenario. [32:19.350 --> 32:28.010] You do want to think very closely about the task that you're giving your LLM agent though, because the more simple that task is, the more reliable your agent will be. [32:28.050 --> 32:36.770] If you don't do this, you may end up in a situation where you now have to worry about your LLM judge's performance, so you kind of need a benchmark for your benchmark. [32:36.770 --> 32:38.390] That's not a good place to be in. [32:38.690 --> 32:44.350] So keep the task simple, maybe have some ground truth data that it can compare against and it'll be fine. [32:46.490 --> 32:52.090] In terms of infrastructure, we already talked about the fact that it's very important to have good infrastructure. [32:52.270 --> 32:58.870] The reason here is that essentially you need all the right context, but only the right context for your LLM. [32:58.950 --> 33:01.270] If you have too much, it's going to be overwhelmed. [33:01.270 --> 33:03.370] If something's missing, it will hallucinate. [33:03.470 --> 33:10.090] So it's really important to spend a good amount of time on your infrastructure to get it right, and the return on that investment will be great. [33:10.670 --> 33:17.050] In that context, be ready to build a lot of wrappers and glue code around existing tools. [33:17.050 --> 33:24.610] Their interfaces unfortunately don't always fit exactly what you need, and you will just have to accept that you will need to spend some time on that. [33:25.390 --> 33:31.350] Another thing is that agents and LLMs do benefit from many different kinds of context. [33:31.350 --> 33:38.550] It can be documentation, but it can also be previous examples of the agent's own performance that were very good. [33:38.550 --> 33:49.350] So if you have some sort of persistent memory where you can store very successful executions of the agent, and you can then use that for future iterations, that can also be very beneficial. [33:50.970 --> 33:51.810] Cool. [33:51.870 --> 33:54.090] Let's talk about open source. [33:54.310 --> 33:59.650] I have many questions about what we're going to do with open source, and the short answer is we're working on it. [33:59.930 --> 34:12.150] The long answer is it's complicated, because it's really coupled with our NVIDIA infrastructure, like the way how we generate the context, the way how we do fuzzing, the way how we build our stuff. [34:12.610 --> 34:17.690] Unfortunately, as of today, there is no drop-in replacement for the context creation. [34:17.690 --> 34:20.470] I mean, the Codex and Cloud Code are great tools. [34:20.470 --> 34:24.730] They're not 100% replacement yet, so the coupling will take time. [34:25.070 --> 34:34.170] Alternatively, we're thinking just release some modules like logic that generate the harnesses or generate patches, so we can just take it and plug it in your own setup. [34:35.010 --> 34:45.210] And if it's going to be released, we don't plan any hosted version, which mean if you want to use Orion, you will have to provide your own LLM and fuzzing infrastructure. [34:46.450 --> 34:48.630] Well, that's pretty much it. [34:49.590 --> 34:51.010] That's how we built Orion. [34:51.010 --> 34:54.270] We use it internally to fuzz our C and C++. [34:54.470 --> 35:04.230] And by the targets, we are happy to go deeper into agents, oracles, future plans, so let's open it up for questions. [35:16.100 --> 35:19.900] There's a microphone over there where you probably want to line up. [35:20.260 --> 35:21.020] Yeah, that's a good call. [35:21.020 --> 35:23.200] Yeah, please, please use microphone in the room. [35:28.230 --> 35:29.090] Hi, guys. [35:29.090 --> 35:29.670] Thanks, Tal. [35:29.670 --> 35:31.390] That was really great. [35:32.150 --> 35:35.550] Is Orion ready to do anything besides C? [35:38.190 --> 35:43.270] I mean, it depends on the fuzzing tool you use. [35:43.270 --> 35:46.510] If the fuzzing tool, I mean, we support IFL and LiveFuzzer. [35:46.510 --> 35:50.550] If the language you want to fuzz is supported by these two tools, Orion can do it. [35:50.550 --> 35:52.910] Can I get this from GitHub or something? [35:53.330 --> 35:54.350] Yeah, let's talk. [35:54.350 --> 35:56.830] That's basically what we want to announce. [35:56.830 --> 36:00.890] If you're interested to contribute, if you want to try it, we'll be happy to connect and chat. [36:00.890 --> 36:01.690] Yeah, absolutely. [36:01.690 --> 36:02.250] Fantastic. [36:02.250 --> 36:02.990] Thanks again. [36:05.470 --> 36:10.610] Is there any reason you chose GPT as your foundational model for the agents? [36:11.470 --> 36:13.070] Well, good question. [36:13.070 --> 36:16.650] I think both models are good, both clouds and GPT are good. [36:16.650 --> 36:22.430] We just see some better results in hardness generation with GPT. [36:22.430 --> 36:24.710] But really, they're really, really close. [36:25.170 --> 36:30.530] So, I mean, right now the new models get dropped, like GPT 5 and 4.1. [36:30.530 --> 36:32.650] We have not updated our benchmarks yet. [36:32.650 --> 36:38.350] So, GPT 4.1 was the latest and greatest by the time of when we were recording this demo. [36:38.570 --> 36:44.610] So, you did test other models and see if they had less hallucination in the code generation? [36:44.790 --> 36:45.710] Correct. [36:46.130 --> 36:53.850] In our test cases, both 4.1 and Cloud 4 was really, really good. [36:53.850 --> 36:56.630] But again, it will depend on Oracle. [36:56.630 --> 36:59.230] So, both models will occasionally hallucinate. [36:59.430 --> 37:05.330] How good and how trustable your Oracles are really will define the output. [37:05.710 --> 37:07.130] Thank you. [37:09.960 --> 37:11.820] Hi, really great talk. [37:11.820 --> 37:16.180] I'm very happy someone is integrating AI into the fuzzing space. [37:16.180 --> 37:23.660] Now, my question, do you think it would be possible to use this kind of a tool on exclusively local hardware? [37:23.660 --> 37:31.540] Or is the, for lack of a better term, horsepower need so great that you really need to use the cloud? [37:31.640 --> 37:33.080] Yeah, great question. [37:33.080 --> 37:42.720] Right now we use it on the cloud models mostly, but we're working on fine-tuning the smaller models that we can open source to so you can run it locally. [37:42.840 --> 37:49.800] It's not done yet, work in progress, most likely like the second iteration after we open source Orion. [37:49.800 --> 37:51.840] So it should be doable. [37:56.010 --> 37:58.130] Hello, great talk. [37:58.290 --> 38:02.410] I have two questions on the evaluations. [38:02.410 --> 38:23.590] The first one, what acceptance rate did you see on your generated patches, including how many did you actually send to other maintainers and how much do the maintainers actually like revised and were accepted? [38:32.040 --> 38:37.000] Yeah, well, we actually, we run it mostly on our internal targets. [38:37.000 --> 38:40.980] So, and we compare, we have the ground truth data. [38:40.980 --> 38:48.260] So we know how this bug should be fixed because we run through the manual fixes first. [38:48.640 --> 38:57.370] And I think acceptance rates, it's around like 70 something percent. [38:57.370 --> 39:08.770] I mean, it's eventually like hallucinate, but as we show, we run it through the validation loop first because it doesn't mean the first patch generated by a model will be good. [39:08.850 --> 39:11.830] So we generate the patch, we run the reproducer. [39:11.830 --> 39:15.450] If the reproducer still can, you know, record the bug, that's a bad patch. [39:15.490 --> 39:16.290] Yeah. [39:16.290 --> 39:21.130] And after that, maybe around like the final version, like around 70% were good. [39:21.770 --> 39:25.270] When we start, it was maybe like 30%. [39:25.270 --> 39:31.050] As I mentioned, models will just remove the code that caused the crash and say, yeah, we fixed that. [39:31.110 --> 39:36.690] So definitely like some, some additional work required to detect this kind of things. [39:36.690 --> 39:38.010] Yeah, that's a good number. [39:38.010 --> 39:42.630] So what percentage actually passed the validation loop? [39:45.050 --> 40:00.490] I don't think I have data on like what's passed and what's not passed because we right now, we only look on the patches that pass at least all the validation loops and how many of them are valid, right? [40:00.490 --> 40:05.970] Because it's, it may pass the validation loop, but still the fix is like stupid or something like that. [40:05.970 --> 40:16.190] So it was around 70% on our internal targets and on the C-lib, at least on the demo, I think it takes like first attempt. [40:16.410 --> 40:16.730] Right. [40:16.730 --> 40:25.070] So it was like, it was a not very hard bug, but the first attempt for C-lib, it was able to generate a valid patch. [40:25.070 --> 40:25.950] Okay, thanks. [40:25.950 --> 40:31.610] And for the second question, like you said, you have a seed generation agent. [40:31.610 --> 40:36.530] How much performance gain do you see from the seed generation? [40:36.530 --> 40:48.490] Like alternatively, I think you can also patch the patch of the harness so that for the fuzzing mode, it can pass the magic value checks. [40:48.490 --> 40:53.570] So what's, yeah, how much performance boost did you see? [40:53.910 --> 40:57.750] Well, I think we measure in terms of like fuzzing cycles. [40:57.750 --> 41:02.470] So it's really good question. [41:02.470 --> 41:09.950] I don't think we measure without seed because basically we never measure to run the fuzzing without seed. [41:09.950 --> 41:17.850] So we always generate the seeds and if the seeds and we do the small fuzzing runs and we collect some of the code coverage. [41:17.850 --> 41:24.670] So that's the minimal validation steps that the seeds are valid, correct and don't crash the target. [41:24.690 --> 41:25.670] But that's a good question. [41:25.670 --> 41:33.650] I think we can collect this data and, you know, try to run everything the same without the seeds, probably to waste tons of fuzzing cycles. [41:33.750 --> 41:39.610] And then we can, you know, give you the better answer how much time it's saving just on the seed optimization. [41:39.610 --> 41:58.330] Yeah, I guess it might be better like to patch the harness so that more running are valid rather than just get the magic value only giving that to the initial seed because the mutation might invalidate some of the like checksum or something. [41:58.330 --> 42:04.270] Yeah, that's exactly what we're trying to avoid to make fuzzing tool brute force it over time. [42:04.270 --> 42:08.150] We're trying to give it like as much valid input as possible. [42:08.150 --> 42:11.870] So that can at least hit many, many branches from the beginning. [42:12.310 --> 42:12.590] Cool. [42:12.590 --> 42:14.530] Thanks for answering my questions. [42:14.530 --> 42:15.070] Sure. [42:15.070 --> 42:16.710] Thank you. [42:17.070 --> 42:25.510] Hi, I was wondering if you've done any financial cost benefit analysis on automating fuzzing? [42:25.510 --> 42:29.150] Well, I think we can calculate it from the time savings. [42:29.150 --> 42:32.290] I mean, I haven't done the financial analysis. [42:32.330 --> 42:37.390] We've done only like time and how much time, how faster our fuzzing campaigns now can be. [42:38.810 --> 42:47.890] Again, I think that's something that we can collate, like how many engineers need to work on that, you know, manually and then see how much money we save. [42:47.890 --> 42:50.670] But as of out of my head, I don't have the data. [42:53.560 --> 42:56.020] Thanks, this was really great. [42:56.180 --> 43:02.480] I was wondering what your experience with the quality of the generated fuzzing code was. [43:03.280 --> 43:10.120] Like, can humans maintain it over time and read it when they need to debug it and so forth? [43:10.560 --> 43:12.920] You mean the actual harnesses that we generate? [43:12.920 --> 43:13.560] Yeah. [43:13.560 --> 43:14.100] Yes. [43:14.100 --> 43:17.360] So what we do, we provide some initial templates. [43:17.360 --> 43:21.880] So we don't want agents, you know, to be very creative in the harnesses. [43:21.880 --> 43:24.280] We provide the template for the specific tools. [43:24.280 --> 43:35.340] For example, if we know that we're going with LiveFuzzer, we provide the template and LiveFuzzer format and very specific instructions how the harness should look like, which make it like pretty maintainable. [43:35.340 --> 43:42.300] Well, occasionally once in a blue moon, agents, of course, can be very creative and add a lot of unneeded code. [43:42.440 --> 43:44.920] But we figure out how to detect it. [43:44.920 --> 43:55.800] As Marius mentioned, lm judge that can, you know, we're not just passing the compilation checks, but judge look at the generated code and say, like, hmm, it shouldn't really be here, right? [43:55.800 --> 43:59.380] And right now we have to pass the judge checks. [43:59.660 --> 44:04.320] So overall, if it's all good, validation pass it, it's pretty maintainable code. [44:04.360 --> 44:05.240] Okay, thanks. [44:06.100 --> 44:07.080] Thank you. [44:07.800 --> 44:14.800] All right, guys, if you have more questions, we'll be around near the speaker corner, room 227. [44:14.840 --> 44:18.460] Thank you all and, yeah, enjoy the rest of DEF CON.