[00:16.420 --> 00:21.900] We are team All You Need Is a Fuzzy Brain. [00:21.900 --> 00:27.380] We're actually very excited to have the opportunity to speak here. [00:27.380 --> 00:31.940] As you can see, we have four members of our team here. [00:31.940 --> 00:34.740] Actually, we have eight in total. [00:35.060 --> 00:41.360] Most of them are Texas A&M students and faculty members. [00:41.360 --> 00:43.740] My name is Jeff Huang. [00:43.740 --> 00:49.040] I'm a professor of the computer science department at Texas A&M. [00:49.040 --> 00:52.240] I'll let these folks introduce themselves. [00:52.560 --> 00:54.020] Hi, everyone. [00:54.020 --> 00:55.220] My name is Zixuan. [00:55.440 --> 00:58.660] I'm a PhD student of Professor Huang. [00:59.320 --> 01:02.880] I'm honored to be here to share the ideas of our CRS here. [01:02.880 --> 01:04.140] Nice to meet you guys. [01:04.140 --> 01:05.520] Enjoy DEF CON. [01:06.120 --> 01:08.740] Hi, my name is Matthew Woodcock. [01:08.740 --> 01:12.520] I am going into my sophomore year of undergraduate, actually. [01:12.520 --> 01:17.180] Also at Texas A&M, and I've had the privilege of working with Dr. [01:17.180 --> 01:18.620] Huang and the entire team. [01:18.620 --> 01:19.520] It's been wonderful. [01:20.160 --> 01:24.020] Hi, I'm Qingxiao Xu, and I'm also a graduate student. [01:24.020 --> 01:29.700] And I'm very happy to be here and to share our great CRS work with you guys. [01:29.700 --> 01:31.180] Thank you. [01:31.260 --> 01:32.740] Go to the next slide. [01:36.380 --> 01:48.780] Okay, the first most important part I want to show the first slide is we have formally open sourced our CRS. [01:48.840 --> 01:58.440] The top one is the version that we submitted for the AICC finals. [01:58.760 --> 02:03.240] So this is identical to whatever was submitted. [02:03.240 --> 02:08.040] At the same time, we have a local version, which is on a different branch. [02:08.040 --> 02:15.040] So this branch will allow you to run on your desktop with a Docker image. [02:16.000 --> 02:20.540] We also open sourced our semi-final CRS. [02:20.540 --> 02:23.780] So the third one was actually very, very simple. [02:23.780 --> 02:29.180] It actually contained only maybe 500 lines of Python code. [02:30.500 --> 02:33.860] Okay, so go to the next one. [02:34.620 --> 02:47.860] First of all, I want to spend some time talking about the name because this is probably the biggest lesson we have learned throughout this challenge. [02:48.060 --> 02:50.980] All you need is a fuzzing brain. [02:50.980 --> 02:57.520] As you can easily tell, this was inspired by the famous transformer paper. [02:57.520 --> 03:04.020] But what's interesting here is the brain is not fuzzing. [03:04.380 --> 03:09.260] I know most folks here in cybersecurity love fuzzing. [03:09.260 --> 03:15.920] But what I want to say or what we want to say is the big thing here with AI is the brain. [03:15.920 --> 03:24.940] We can see the large language models as the brain of our system versus fuzzing is actually minimal. [03:24.940 --> 03:27.420] If you go to the next slide. [03:28.440 --> 03:34.840] In fact, in our entire CRS, we had minimal fuzzing. [03:34.840 --> 03:37.800] In the semi-final, we had zero fuzzing. [03:37.800 --> 03:46.340] In the finals, we had a very basic version of fuzzing, which turns out had minimal influence in our whole system. [03:46.340 --> 03:58.020] If we just take out those fuzzing components in our final CRS, I would say our score won't change at all. [03:58.380 --> 04:03.500] Typically, if you run our CRS, you will see some things like this. [04:04.860 --> 04:07.240] Fuzzing was not performed. [04:08.220 --> 04:15.500] You only execute the target code and some single input or set of inputs generated by large language models. [04:16.580 --> 04:18.860] Okay, here is the agenda. [04:19.800 --> 04:24.730] The four of us will talk some of the major components in order. [04:26.720 --> 04:29.120] If you go to the next slide. [04:30.860 --> 04:37.440] I want to say three things before the students introduce their components. [04:37.440 --> 04:41.080] Number one, this is a fantastic challenge. [04:41.120 --> 04:51.520] We were able to involve not only academic professors in this competition. [04:51.520 --> 04:57.700] We also have lots of graduate students and undergraduates, including Masu, who is sitting here. [04:57.700 --> 05:10.020] I want to thank the organizers from DAPA and DAPA-H and their leadership for organizing this event. [05:10.440 --> 05:12.940] This is a great challenge. [05:13.400 --> 05:16.760] The two highlights at the very beginning. [05:16.760 --> 05:27.220] Number one, today's large language models are already very, very good for discovering and patching code-level vulnerabilities. [05:27.220 --> 05:37.400] With the right context engineering, you can probably achieve the same level of performance as we are doing in our CIS. [05:38.340 --> 05:49.500] Number two, the key thing is how to build a reliable AI-based system, which contains tons of engineering. [05:51.560 --> 05:56.000] We look at the logs after the results announced yesterday. [05:56.000 --> 06:00.680] We found after day four, we never submitted anything. [06:00.680 --> 06:03.060] There were seven days or more than seven days. [06:03.060 --> 06:07.040] All the submissions we had were in the first two days. [06:07.580 --> 06:12.660] Very likely our system crashed due to some unreliability issues. [06:12.660 --> 06:14.380] All right. [06:22.320 --> 06:40.020] Well, from the result shown yesterday, and our CIS actually has a very unique point, is that we find a vulnerability within five minutes, which is called the most speeded CIS. [06:40.020 --> 06:51.640] We are happy with that because we are actually designing many, many different strategies for different challenges with different difficulties. [06:51.760 --> 06:57.960] We have a very aggressive, very greedy, basic strategy for easy tasks. [06:57.960 --> 06:59.900] That's why we are fast. [07:00.080 --> 07:06.000] And actually, from the framework side, we are actually running everything in parallel. [07:06.000 --> 07:14.360] We have 96 worker nodes, and we have 23 strategies, and all of them are run in parallel. [07:16.040 --> 07:21.120] And now, let Qingxiao introduce some of the framework of our CIS. [07:23.930 --> 07:25.410] Hi, everyone. [07:25.450 --> 07:31.770] I will give an introduction to our CIS system. [07:31.770 --> 07:34.390] This is an overview of our CIS. [07:34.390 --> 07:39.110] It's quite complicated, but I'll break it down and introduce each of the components. [07:39.190 --> 07:42.430] We have, in total, four services. [07:42.470 --> 07:49.910] So, first, our CIS web service will receive a task and determine if it's delta or full scan. [07:49.910 --> 07:54.630] And then the worker service handles it. [07:54.630 --> 08:00.170] And actually, in our worker services, we are running hundreds of worker nodes in parallel. [08:00.170 --> 08:06.090] And in each worker node, they'll be doing the exact same work for different fathers. [08:06.090 --> 08:14.570] And during which, we have our static analyst service, which will provide analyzing to assist our worker services. [08:14.570 --> 08:26.500] And if a POV and patch is found in our worker service, it will be passed to submission service, which does the validation, de-duplication, and bundle. [08:27.660 --> 08:28.980] Matthew? [08:30.500 --> 08:31.820] Next. [08:32.480 --> 08:33.100] Yeah. [08:33.100 --> 08:38.830] That was the high-level idea, and now I will walk you through our workflow step-by-step. [08:39.240 --> 08:46.940] So, first, our web services receives a new task, determines if it's delta or full scan. [08:46.940 --> 08:55.180] And then it passes the information, and it will send this task to our analysis service. [08:55.180 --> 09:09.580] So, in our static analysis service, we'll do reachability analysis, co-pass analysis, and we have language-specific analysis, which we use different tools for C and Java projects. [09:10.100 --> 09:12.120] And... next, please. [09:12.220 --> 09:12.740] Yeah. [09:12.740 --> 09:18.300] And also, our web services will assign the fathers to our worker nodes. [09:18.300 --> 09:26.860] And before that, we actually have a specific design in our web service, which is a task distribution with workload awareness. [09:27.260 --> 09:34.320] And for each of the fathers, we have three harnesses built with different sanitizers. [09:34.400 --> 09:38.280] So, we assign the fathers to each of the workers. [09:38.280 --> 09:41.240] That is, there's one worker for each of the fathers. [09:41.240 --> 09:48.900] And in each of the workers, the things are running the exact same with different fathers provided. [09:49.480 --> 09:50.620] And... next. [09:50.620 --> 09:51.340] Yeah. [09:51.340 --> 09:54.880] Let's take a specific worker node, for example. [09:54.880 --> 09:59.940] So, we have father X, and it's being assigned to worker X. [10:01.880 --> 10:06.500] And so, we already have, like, hundreds of worker nodes running in parallel. [10:06.500 --> 10:11.000] What happens inside a worker is that we have more threads running in parallel. [10:11.000 --> 10:15.600] We have more than 20 strategies for POV and for patching. [10:15.600 --> 10:23.220] So, we create, like, 20 or 30 strategies for our POV strategies and patching strategies. [10:23.220 --> 10:26.920] And we also have a very unique X patching strategy. [10:27.120 --> 10:29.100] And... yeah. [10:29.100 --> 10:37.640] They will be running in parallel, and that actually explains our very fast speed. [10:37.640 --> 10:44.160] And in this worker X, what happens first is it builds the Docker image and builds the father. [10:44.160 --> 10:50.100] And it focuses on this specific father, and then it runs our strategies. [10:50.100 --> 10:55.140] Actually, from here, they will take over and introduce our strategy... [10:55.140 --> 10:57.820] Well, hello again. [10:57.880 --> 11:02.480] Well, let's dive deeper into the core of our CRS. [11:02.480 --> 11:09.480] We are going to talk about POV generation, patch generation, and another strategy called X patch. [11:09.480 --> 11:14.320] And then we're going to talk about how do we submit Bundle to the competition API. [11:14.640 --> 11:18.040] Basically, I want to add one more thing about the framework. [11:18.180 --> 11:23.060] So , we are actually... the whole CRS is written in two programming languages. [11:23.160 --> 11:29.200] The web services are written in Go, and the strategies are written in Python. [11:29.200 --> 11:33.400] We, in total, have 23 different strategies. [11:33.580 --> 11:38.520] And 10 for maybe Stelda scan, and 10 for full scan, and 2 for X strategies. [11:38.760 --> 11:40.180] And, well, here we go. [11:40.180 --> 11:50.120] So, basically, for POV generation, patch generation, you can think the inner core of the system is actually a multi-round chat with AI. [11:50.340 --> 11:54.320] Well, also, our name is fuzzing brain, but, you know, less fuzzing here. [11:54.320 --> 12:02.100] Well, basically, we let large language model to decide what is the vulnerability and where the vulnerability is. [12:02.100 --> 12:16.760] And after the model generate the location, the vulnerability info of the code snippet given, we're going to let another model to generate a Python code. [12:16.760 --> 12:23.420] And this Python code will output a set of blob input file as fuzzing input. [12:23.420 --> 12:28.260] And then we will run the fuzzer provided by the competition. [12:29.160 --> 12:36.820] And if there is a crash, which means that we find vulnerabilities in a given repository, right? [12:36.820 --> 12:38.360] And everything goes well. [12:38.360 --> 13:01.780] And if it failed to trigger the vulnerability, we feed back some runtime information from the fuzzer, from static analysis tool, and other context, like related functions, or other kind of things to the large language model to let it generate more inputs again. [13:01.780 --> 13:03.120] Next, please. [13:03.120 --> 13:10.400] And for the patching, fortunately, now we get a valid POV, and now we need to do patching, right? [13:10.480 --> 13:19.320] And for patching, the first thing we're going to do is to find what functions are we going to patch, right? [13:19.340 --> 13:22.480] Which we call the target functions in our system. [13:22.560 --> 13:26.980] Basically, we also let large language model to do such kind of thing. [13:26.980 --> 13:34.640] Large language model will read the POV we generate and the code of the code base, right? [13:34.640 --> 13:38.320] The target code to generate a JSON file. [13:38.320 --> 13:45.520] Actually, you can think of it as a list of the functions that the model thinks should be changed or should be patched. [13:45.520 --> 13:55.000] And then, based on the list of the target function, we let large language model to generate a full code after the patch. [13:55.000 --> 14:06.940] And this is quite different from what other team did, because we actually generate the full patched code, not the defiled directly. [14:06.940 --> 14:21.180] And the next step is to override the original buggy function with the function after the modification, which we overrided the original function, right? [14:21.180 --> 14:31.840] And we try to build a project to try to compile it and try to validate whether it can trigger the vulnerability again and whether it can pass the test. [14:31.840 --> 14:36.920] And if everything goes well, we're going to use git div to generate a div file. [14:37.300 --> 14:41.280] This is kind of a stable way for us to generate a div file. [14:41.280 --> 14:50.600] If we just let large language model to generate the file, it will cause some error, format error, metadata error, some kinds of like that. [14:51.520 --> 14:54.060] And, yeah, we use git div to generate div. [14:54.060 --> 15:00.100] So in this case, our div file can definitely apply to the source code. [15:00.100 --> 15:01.080] Next one. [15:01.460 --> 15:02.200] Yeah. [15:02.800 --> 15:08.560] However, things may not go very well in the real life. [15:08.560 --> 15:16.900] Imagine if we cannot find the valid POV within maybe 45 minutes, one hour, what should we do? [15:17.380 --> 15:27.800] We actually provide X strategy, which we let large language model to do patch with no POV information. [15:28.320 --> 15:36.840] Here, the logic is, there are a lot of details here, but overview logic is that large language models scan all the reachable functions. [15:36.840 --> 15:41.560] These reachable functions are generated by static analysis service. [15:41.600 --> 15:52.500] You can think it's a call pass graph from the entry point of the father to whatever, because we don't know the target function, right? [15:52.500 --> 16:01.820] And let large language models scan all the reachable functions from the father and to rank top five vulnerable functions per common of a common vulnerable. [16:01.820 --> 16:07.880] This is stored in a catalog, like for C, for Java, we have some CWEs, right? [16:07.880 --> 16:11.620] For each CWE, we may have a top five vulnerable functions. [16:11.800 --> 16:20.440] And there's a confidence level, and this indicates how likely large language models think the function is vulnerable. [16:20.800 --> 16:26.060] And after that, we actually have a list of target function again, right? [16:26.060 --> 16:28.140] And the next step is to try to patch it. [16:28.140 --> 16:29.620] It's trying to patch it. [16:29.620 --> 16:30.660] Next one. [16:31.260 --> 16:32.220] All right. [16:33.360 --> 16:38.880] And the next step is almost the same as what we talked about in a patching slide. [16:39.340 --> 16:45.840] And after that, we run funding for 60 seconds to validate if there is something wrong with it. [16:45.840 --> 16:50.000] And then we generate the div file via git div. [16:50.000 --> 16:51.260] It's the same. [16:51.340 --> 16:52.400] And next. [16:52.680 --> 16:55.920] Since we already have POV, we already have patches. [16:55.920 --> 17:02.220] And we are going to submit it to the competition API to get score, right? [17:02.580 --> 17:04.080] This is important. [17:04.080 --> 17:15.880] Well, we actually build another agent service between the CRS and the competition API, which is called submission service. [17:15.880 --> 17:25.680] And this service is actually taking charge of deduplication because it has all the POVs. [17:25.680 --> 17:29.080] It has all the patches for specific tasks. [17:29.460 --> 17:40.580] So here, if a new POV is generated, it will send to the submission service first for deduplication. [17:40.580 --> 17:44.160] Here, for each POV, we generate a signature. [17:44.160 --> 17:47.820] It basically consists of a crash type and a crash trace. [17:48.020 --> 17:52.260] You can extract it from the sanitizer report, right? [17:52.260 --> 18:03.740] And based on this information, we can determine whether this POV is duplicated with some POV we found previously, right? [18:03.740 --> 18:08.640] And this is what we did for deduplication. [18:08.640 --> 18:19.940] And then we match the POV and the patches to form different bundles to make the final submission to the competition API. [18:20.400 --> 18:27.280] And also, this submission service is also taking charge of serif report parsing. [18:27.280 --> 18:34.440] Remember, we have all the POVs and patches for specific tasks in the submission service, right? [18:34.440 --> 18:38.840] So one of the strategies here is that we parse the serif report. [18:38.840 --> 18:46.180] And if this report indicates some POV we found previously for a specific task, then we can directly use it. [18:46.180 --> 18:50.480] We can directly submit it if it has a valid patch, right? [18:50.480 --> 18:58.340] And this is the logic of our POV, our patching strategy, and something like that. [18:58.340 --> 18:59.440] Next. [19:01.320 --> 19:05.300] And then let Qingxiao introduce Static Analysis product. [19:05.300 --> 19:13.140] Hi, I just want to clarify more on what kind of information can our Static Analysis service provide. [19:13.140 --> 19:19.600] So the CodeQL is applied for Java project, and I'll just introduce this one. [19:19.600 --> 19:29.840] So what we have in our Static Analysis is we extract the function metadata, and we do reachability analysis and call pass analysis. [19:29.840 --> 19:33.440] That is from the entrance function in each of the file. [19:33.620 --> 19:44.560] We use CodeQL to run the query scripts and see what kind of reachable functions can be reached from the entrance function. [19:44.560 --> 19:56.780] The information that will be passed to our worker nodes is for each fuzzer it will store all the reachable functions, and for each reachable function we will store all the possible call pass. [19:57.120 --> 20:03.940] And as Zuo has mentioned before, we are trying to parallelize running everything in parallel. [20:03.940 --> 20:19.580] So intuitively we try to run the reachable function query scripts in parallel, but we found that the actual latency in our Static Analysis is building the connection with our CodeQL databases. [20:19.580 --> 20:29.420] So instead of doing that, we actually concatenate all our query scripts in one, so that we only need to build connection with our databases once. [20:29.420 --> 20:42.480] And in this way, we actually reduced our time of doing Static Analysis for each of the projects in less than five minutes, which actually depends on the project size, but it's still very fast. [20:42.480 --> 20:45.160] And that's for the Static Analysis. [20:54.470 --> 21:01.170] So now I'm excited to talk to you all about the surprises and challenges that we encountered throughout this project. [21:01.230 --> 21:08.100] Because there were a couple, but the ones we wanted to highlight were first off, the improvement speed from large language models was dramatic. [21:08.530 --> 21:11.570] Part of my task was looking at model evaluation. [21:11.570 --> 21:20.390] And so from week to week, sometimes people will get, I guess, a little bit used to the pace of increase, but really just taking a step back and looking at it. [21:20.390 --> 21:32.130] We have some examples that we thought were worth mentioning, but from 3.5 to 4.0, at least for the GPT models, and then, I guess, especially recently, the competition between different model providers has really gotten awesome. [21:32.310 --> 21:34.870] Cloud 3.5 and then GPT 01. [21:35.430 --> 21:38.450] And as it gets better, it's helped us with patch generation. [21:38.450 --> 21:46.230] So many of these large language models can often successfully generate these complex structures of working code in just one to two attempts. [21:46.950 --> 21:52.230] In fact, for our CRS, actually 90% of our CRS's code was done with AI. [21:52.230 --> 21:53.550] We used Cursor. [21:54.550 --> 21:55.150] 90%. [21:55.150 --> 22:01.190] And that's 50KLOC of Go, 50KLOC of Python. [22:02.010 --> 22:06.250] And then the last is building a reliable CRS is highly challenging. [22:08.470 --> 22:19.250] We've had a lot of improvements, actually, since the semifinals, but testing and debugging some large language model-based components, working with large language models, that can be frustrating. [22:19.250 --> 22:22.310] But what's really frustrating is sometimes having to deal with rate limits. [22:22.370 --> 22:23.470] We have fallback models. [22:23.470 --> 22:29.070] For example, we have a hierarchy of what we'll go to if we end up facing rate limits. [22:29.070 --> 22:30.450] Then we have race conditions. [22:30.950 --> 22:32.710] And I already mentioned fallback models. [22:36.040 --> 22:37.680] Yes, indeed. [22:37.940 --> 22:42.520] And here are some examples for some specific challenges. [22:42.960 --> 22:55.900] And as you can see, developing a CRS using multiple programming languages with concurrent strategies can cause a lot of concurrent bugs in our CRS. [22:55.900 --> 23:08.640] Well, just as I mentioned, we use Golang, we use Python, and it is pretty hard to debug such kind of thing, debugging Python code is painful for us. [23:08.640 --> 23:11.240] We spend mountains of time on it. [23:12.060 --> 23:15.800] And there will be a case study later, right? [23:16.940 --> 23:22.060] It's an example of race conditions, which we encountered in the competition. [23:22.880 --> 23:28.740] And for the full scan challenges, we are given, actually, the full code base. [23:28.740 --> 23:31.760] And you can imagine how large is it, right? [23:31.760 --> 23:55.940] And in this case, even we have a lot of different strategies to shrink the size of the searching space, the searching space is still very, very large because the functions, the data flow track is very, very long. [23:55.940 --> 23:58.880] Maybe the vulnerability is pretty deep, right? [23:58.880 --> 24:04.180] I remember there was one challenge in semi-final about Linux kernel is an example challenge. [24:04.180 --> 24:06.080] That is really painful. [24:07.000 --> 24:12.940] And patch generation, actually, is also the challenge we faced. [24:12.980 --> 24:21.500] And sometimes we can generate a POV, we can generate a patch that can pass the POV test, which mitigates the vulnerability. [24:21.500 --> 24:26.900] However, it actually destroys the function of the program itself. [24:26.900 --> 24:49.190] And this is quite common in nowadays programming because when we are using large language models to write codes, and sometimes the large language model focuses on some limit area to fix the vulnerabilities, however, it will break the overall functionality, [24:49.600 --> 24:51.260] which is really bad. [24:51.260 --> 25:12.280] And the last one is that since we are getting a longer and longer context window, if the vulnerability is harder to find or harder to patch, LLM will have very, very severe hallucination problems when generating content. [25:12.280 --> 25:18.460] And this is really a headache for us to deal with. [25:18.460 --> 25:21.820] And here we go, a case study. [25:22.460 --> 25:29.740] So one thing I'd like to highlight is building reliable AI-based state is super, super challenging. [25:29.740 --> 25:31.320] I want to give you an example. [25:31.700 --> 25:36.780] I've been doing, actually, research on race condition in the last 10 years or so. [25:36.780 --> 25:43.120] I find myself still got hurt by race condition in my own code. [25:43.280 --> 25:46.200] So this was race condition. [25:46.200 --> 25:52.340] We took us probably 20 hours of our time finding out the root cause. [25:52.340 --> 26:00.200] So we find there was an exhibition run which submitted many false positive POEs. [26:00.440 --> 26:04.620] And we were, you know, surprised, how could that happen? [26:04.620 --> 26:11.580] And it ended up there are race condition between these three lines of code. [26:11.580 --> 26:20.420] Imagine there are multiple processes running the same thing and checking if POE success. [26:20.420 --> 26:27.560] If yes, submit that POE with the blob input generated by AI. [26:27.560 --> 26:36.940] And that blob path basically stored two instances of the POEs generated by two processes. [26:36.940 --> 26:39.600] One is success, one is fail. [26:39.600 --> 26:44.660] Because of the race condition, we submitted false positive ones. [26:45.380 --> 26:48.980] So that basically killed us 20 hours of time. [26:52.070 --> 26:55.270] Okay, we only have a few minutes left. [26:55.270 --> 27:09.550] I want to, you know, from my perspective of research in this field, I think that a few important things I would hope our cybersecurity researchers to pursue. [27:09.550 --> 27:26.990] Of course, out of this final, I think that more than 50, you know, cybersecurity challenges, I think only 77, wow, it's a big number, but still that 23% not being discovered. [27:26.990 --> 27:29.390] So there is a gap still. [27:29.390 --> 27:38.810] I think one way to improve this gap is to further improve the capability of both frontier and open models. [27:38.810 --> 27:43.930] Number two, developing evaluation and training data sets. [27:43.930 --> 27:52.050] Out of this competition, we have accumulated a huge amount of data, and this data are very valuable for training purposes. [27:52.650 --> 28:00.070] Of course, more advanced agents, you know, if you just stick to one model, you can develop more advanced agents on that. [28:00.070 --> 28:05.270] And also debugging, testing debugging tools for building such systems.