Thanks for coming to our talk, to the fireside chat with me and Lucas here. Hopefully we can give you some cool insight on how our CRS works, what we did, what didn't work, and how we ultimately did it. So first, just to introduce myself, my name is Will Gibbs. I go by Clasm on a lot of platforms. I'm a PhD student at CephCom. I captained the Shellfish CTF team for about five years before getting tired and then quit. And then the past two years, I've been leading AICC with this guy next to me, Lucas. And I've played a couple of Pwn2Owns. We've won a couple thousand dollars there. Yeah, and I'm Lucas. I'm a PhD student at UC Santa Barbara. I'm also a current captain of Shellfish, and we've been leading the AICC team together. And, you know, the DARPA events are always a fun one. I've done a couple through my times, and so I'm really kind of more from the traditional vulnerability-finding competition angle that I approach the problem from. So just to give another brief intro to, like, Shellfish, this is, I think, our 20th year at DEF CON. We're a team with a pretty long history of just doing cool stuff. We like open-sourcing things, hopefully making the world a little bit of a better place. But Shellfish is a combination of three different universities. We have ASU, UCSB, and Purdue. So one thing that we just want to kind of inform everybody is what it's like to build this system, right? Because behind this really cool system that we built is the blood, sweat, and tears of all of our team members together. Yeah, and I mean, this is, as you've heard, we're three universities from, like, three different places in the country entirely. And so, you know, I'm sure every team has had trouble coordinating. But as you can imagine, there was a lot of Zoom meetings involved. But at some point, you kind of want to get together and, you know, hang out in person, meet the people you're working with, and really get down to it and build the system to the extent that you can. And then sometimes that ends up with everyone on the couch standing around and, like, trying to really figure out what to build and what to build next. And this includes, you know, several birthdays. We actually had a running joke, you know, we were together so often that a new hackathon actually just meant a new birthday celebration. We'd usually have, like, one or two at least during every single one. Yeah, we called it meeting time at some point. And of course, the troubles were not always virtual. Sometimes your car explodes, sometimes bees invade your house, sometimes you just run into problems. And you have lazy workers, you have people that like sleeping on the job. But yeah, so I think we're going to go a little bit through the main design principles of how we approach the problem. And we're going to go through what the system looked like for semifinals, because I think it's going to be very interesting to see how that evolved as the models got better. So do you want to walk us a little bit through? Yeah, well, so first, let's talk a little bit. For everybody who doesn't maybe necessarily know all the details of the AI Cyber Challenge. But the goal was to create an entirely autonomous system that from end to end is able to take an open source project, open source software, find a vulnerability, and then patch that vulnerability that you've found. Like I said, entirely autonomous. We, during the actual runtime of the competition, we just had to submit it. And then we waited, biting our nails, hoping that, like, it didn't burn down in its entirety. But so that's the basis of the competition. And in order to achieve something like this, we created a somewhat complex interconnection of components. But this is a big overview of what our semifinal system was that we were actually trying to build. Yeah, and I mean, in theory, right? In theory. I think a lot of the components on here ended up not looking as much as we'd expected. They transformed. They transformed. But yeah, I mean, there was... Do you want to talk a little bit about, like, how we approached it from, like, traditional analysis versus LLMs? Yeah, so back when this competition started in 2023, we didn't... First of all, we're all binary analysis, traditional program analysis people. We like bytes. We don't like source code. And this competition was entirely source code. And it's also LLMs, right? The AI Cyber Challenge. None of us know anything about AI, or at least we didn't, right? I feel like now we have a pretty decent grasp. But the goal was to take just any arbitrary open source project and see if we can find bugs in it. And we thought initially that, oh, we'll find some, you know, 10,000-line piece of software or maybe one of our own internal projects, see what we can come up with. But instead, the very first challenge that we got was what, Lucas? It was the Linux kernel, which dropped in, I think, December of 23. And we were at a hackathon when this dropped. And we were just testing on, like, our biggest test problem at the time, which had, like, 10,000 lines of code. Yeah, something like that. And then they dropped the Linux kernel, and it's, like, multiple millions of lines of code. And we just kind of, like, sat there and then proceeded to completely ignore that that happened and work on our system as it stood. Yeah, yeah. So there's a big difference between planning for 10,000 lines versus several millions. So that's where this big diagram behind us kind of came from. We first had to figure out how to ingest this, right? We had OSS fuzz projects that were coming in, and so we needed to figure out what do we need to build, what do we want to build, right? There's several components that we'll talk about later that require, like, five or six different build phases, right? So this isn't just one thing that's happening. And we started out in October, and one of the first goals was, like, okay, just get a running system that does some of this task fully automatic end-to-end, right? Because we were really kind of very scared that, you know, as you tend to do, if you over-engineer everything, then you might end up with nothing at the end. So that was kind of, like, the original goal. So let's walk through this diagram a little bit for everyone. So we start with our building. Then we go to what we call our POI generation, or point of interest, right? And this can be anything from static analysis, dynamic analysis, to asking the LLM, hey, can you see a bug here, right? Then we move to our point of interest. Which we definitely did in finals, too. Which was very effective. No, we did not do that. Which moved on to our POI validation stuff, which is really just fuzzing, right? Even if something says, hey, there's a bug here, like CodeQL, I'm sure everybody's seen thousands of alerts that say, hey, there's a really important bug here, you need to fix it right now. But if you don't have an input that can actually get you there, you don't know if it's really important. So that was one of the bigger challenges, I think. Yeah, and I mean, I don't think we started out building most of the systems. We kind of started out building the things we knew. So obviously the first thing was, like, we built the fuzzers. But very quickly we realized that there was one part of the problem that we couldn't really handle. And that was patching, right? Because we'd done literature research before into automated patching. And it generally kind of boiled down to effectively like, oh, I'm going to turn this less than or equal into a less than. But then... Oh. But that was the first kind of point where we started building in these LLMs. And then that kind of spurred the first couple components. Do you remember a couple of the ones that we did initially that were like... All the LLMs. I think we had like a query generator where we tried to automatically generate like CodeQL or SemGrep queries where asking the LLM, please, please, please, pretty please, generate us a well-formatted query for this. And back in 2023, it was GPT 3.5. That did not work. Yes. We tried our hardest, but it just could not get the format right. We added five or six other agents on top of it to try and well-form it. At this point, we were spending 10 minutes generating one query and it cost us like $10. Yeah. And I mean, in the semifinals, just for context, every team was limited to each target of $100 of LLM budget and I think 200 cores in total. And so we were really kind of strapped for cash. And so just spending $10 on a query that we're not really sure works. Yeah. Imagine your boss comes up to you and says, I need you to find an ODE in the Linux kernel, but you have $100 and I'll give you three machines in my closet. It was that kind of challenge. We were really scrappy. And then you do and you mess it up a little bit and then what happens? And then, you know, the funny thing about the early LLMs is that you could do things like ask it, hey, based on this stack trace, where do you think the bug is in the Linux kernel? And it says, oh, I see this Java exception in your Linux kernel. I think that's really important for you to fix. Yeah , there's definitely an index that went out of bounds. And I think what ended up happening was we forgot to give it the stack trace. We just forgot to put it in and the LLM just decided to make one up. Yeah, rather than saying, hey, I don't see the data that you're seeing here. It's a no, obviously there's a bug here. The user is telling me there's a bug here. Yeah, but I think what we kind of ended up boiling down to as the main components, do you kind of want to walk us through the main steps from start to finish? Yeah, yeah, so like I said, we have the building, we have the fuzzing, we have the poise. But remember, part of this competition is making valid patches, right? So we initially tried with, hey, you have this crash, you have this stack, this stack trace. Can you just make a patch, right? The stack trace tells you, oh, the line 173 in the C file is crashing. Can you fix this? And as it turns out, that's not really very effective, right? Because I'm sure anybody who's done any amount of triaging knows that the bug is not necessarily at the crash location. So we had to come up with a triage engine of a couple different components that was actually capable of looking at the crash locations and trying to identify, is the root cause really at the crash site, or do we have to look somewhere else for this? Yeah, and I think the general approach that we kind of followed with most of these LM components is we tried to build them the way we would solve the problem, and then tried to teach the model, at least in the early components. I think you were working on hooking it up to GDB and just trying to let it debug. Yeah, yeah, the early models were really not good with freeform input. They would really try and do everything, and I mean everything, that they could. You really had to constrain them in order for them to be able to work well. And I think that kind of translated into, for example, once you then, let's say the LM is able to magically guess where the bug is, or maybe it is a bug that is simpler to reason about and it figures it out, then when you have to produce a patch, oftentimes the LM is there also kind of constrained, at least at the time it was. So our patchers for semifinals, for example, would only ever patch one function at a time, and it couldn't do anything beyond one function. You had to really kind of shoehorn it in. I think this gave birth to one of the core tenets of our system, which is trust but verify. You have all of these LM components that can give you really good, really solid output. Some of them can one-shot bugs or tell you exactly, hey, this is the input that you need to reach this location, and it works. But for the other 90% of cases where it says, hey, here's the input, and you're like, this is a PDF, I'm asking you to generate me something for SQLite, right? You try... we have every single step, or every single phase, the output can be verified in some manner, one way or another. And then giving that feedback if that doesn't work to the LLM really seemed to help and improve the system as a whole. And I think every single component had something like this. Yeah, and I think even for most of the components, we tried to build in redundancy. So other than for the patching where there really wasn't an alternative, it was mostly we would build the LLM on the side, and we would have a traditional analysis component. So for example, for the fuzzers, we had grammar fuzzing, where the LLM would try to write input descriptions of what the input looks like. And then a fuzzer could take that and then explore the program state fully, or more extensively than it could otherwise. Yeah, I think... what do you think the coolest component is that we have in the system? I think in semifinals or in finals? Let's go finals. Okay, I think in finals, I think there's a couple cool ones. I think one of the cooler ones that I really like, which was where we ended up doing that, just ask the LLM where the bugs are, is one of the tasks in the AI Cyber Challenge was these Delta Mode tasks, where you weren't just given a source code project, but you were also given some changes to that project, and you had to find bugs that were introduced. And that actually turned out to scope the problem quite a lot. And that kind of led to us figuring out that we had built the C generation component, we literally just asked the LLM, write a Python script that reaches this specific vulnerability. And I think that was kind of like the red line through all the teams that everyone found worked surprisingly well. I think it's like traditional binary people and people who play CTFs all the time. We really thought that this would be a harder problem to solve, that our jobs were much harder and the machine could never do it, and we're really good and they're really bad. Yeah, but now we're excited to just point fingers of like, go here, go here, go here. But yeah, I think being able to restrict the problem like that turned the problem into something where it was like, oh, for $2, you can now validate your hypotheses. And as people doing science, that's pretty cool if you're like, don't have to spend thousands of dollars to just test single things. Well, speaking of spending thousands of dollars, I think my favorite component from our final system is probably the grammar generation. So for people who don't know, when you're fuzzing, you can also use grammars in some systems. And these are just formats that specify, hey, this is what a PDF looks like. Here's where the magic bytes go. Here's where certain groups or elements or something like that goes. So that you can generate well-formed inputs and you're not spending a million years inside fuzzing the parser when really you want to fuzz other functionality and other parts of it. But so we, and by we, I mean Lucas, ended up building this really cool LLM-based grammar component where you can say, hey, I want to reach this location in the program or I think this is an interesting area to explore. Let's try and generate grammar based on all the structs that you see along the way, along the data flow that you see along the way, and hit it. Yeah, and I mean, I think we built a lot of cool components into the system, but also one thing that I think is worth mentioning, especially in this context where we can explore a little bit further, is we had a lot of components that didn't make it. And we had a lot of components that were built for different types of the system. Do you remember some of the early ones where we were like experimenting that were like super cool? Yeah, I think, so this competition was really very cool. But ultimately it came down to memory corruption, command injection, and I think SSRF was the main kind of grouping. But before they had announced this list, we just kind of went freeform and tried to generate vulnerabilities for whatever we could. We explored with XSS for web pages. We didn't know that it was going to be constrained to only C and Java, so we're like, maybe there's some web stuff. We explored with CSRF. We actually had a really cool component with CSRF, which this is more of like a logic flow bug, right? For those of you who aren't familiar with the cross-side request forgery, it's essentially, can I do some action as like a non-authenticated user or someone else that's not supposed to do this? And this is more of a logic game of, can you deduce whether or not this action was taken when it was not supposed to be done? And it turns out that LLMs aren't too bad at this. Yeah, and I think even in Jenkins, we ended up finding one that was just patched a week before that the LLM definitely hadn't seen. Yeah, we had accidentally found a one day where you were able to leak all of the heap data, the heap stack data. Oh, the other one. Do you want to explain the screaming LLM? Yeah, yeah, yeah. So another cool component that we didn't actually have time to fully flesh out and maybe wasn't 100% accurate, but was very cool is OpenAI allows you to look at the actual probabilities of different log probes of your request. So we told the LLM, scream when you see a bug in the code, and then look at all of the tokens that it went through, look at the log probability, and see, hey, it actually spiked in this location. And more often than not, it turned out that it found things like, hey, this buffer that was allocated is allocated with a hard-coded size, or it looks like it's under allocated. And manually verifying this seemed to be true, but it gave a little bit too many false positives, I think, for our final system. And I think one thing that I like about these ideas that we can explore further is like, we were trying this out, and it actually turned out that you could pinpoint exactly when the LLM started screaming, and then you could kind of use that to identify like, oh, this is where the bug starts, and then, but we never really got to exploring that. No, no. But I think a lot of our components definitely evolved from semifinals. Yeah. What do you think, which one do you think evolved the most? I mean, I think by far the most was the triaging engine. The, we ended up with like multiple different triaging engine, one with like a more traditional approach that was doing statistics, and then you guys were doing the LLM. Yeah, we were doing some LLMs. So we had people who were doing fancy program analysis, right? Science, which really boiled down to like, fuzz a little bit, see the location that crashes, do a little crash exploration, see the areas that kind of crash, and then generate a list of probable functions of like, oh, I think the root cause is over here or within these like 10, 20 functions. But that's not fun. That's like numbers and stuff, right? Why do that when you can just ask an LLM to do it for you? But it didn't quite work just like that. It did, it did. I'm maybe skipping over some more technical aspects, but yeah. It was, it ended up being very cool and very, very useful. Yeah. But I thought it was very fun. We ended up hooking up GPT to GDB, right? As well as JDB for Java, and that was a huge pain. Yeah. But giving it kind of like an early MCP server access that allowed it to do things like set breakpoints, run the program, alter arguments, inspect memory, these types of things. Look at pointers. Look at, it really likes looking at pointers. It looks, it likes looking at pointers a little too much. So we kind of, we stopped that. We stopped that in its track. But it was really cool to see our initial like, oh, freeform. Let's just give the LLM access to GDB. That was very bad. But when you say, hey, you can set only breakpoints. You can step through a couple times and then see what happens. Reformulate. Tell me where you want to look at next. Tell me what's likely to have happened. And then go through this whole cycle again until you reach what you think is the actual root cause. And I think we had about a 60 to 70% success rate with finding the root cause in that approach. And one thing I really liked about that was I'm always, I've always been kind of more, it kind of illustrates the differences of opinion in our team even. I've always been of the opinion that you just take the expensive model, you throw it at it, it'll be much better. But then they were trying out the debugging stuff and all of a sudden one of the cheap ones like 4.0 ended up being as good as the expensive one, but it was like 20 times cheaper so you could run it 20 times longer and all of a sudden the output was better. And that was, I'm still not quite sure I believe it, but I can stand corrected. I think that was the real science that I had done is matrixed pretty much all of the large providers and the models that they had and then ran it against our set of inputs and expected outputs. And it came out that GPT 4.1 mini, I think, had about a 90% success rate where GPT 4.1 regular had 95% success. So it was only a marginal jump in terms of ability, but it would cost 10 times less. Yeah, I mean, I think we built a lot of cool stuff for semi-finals, but I think we have about five minutes left. So we should skip a little bit ahead. So one thing I think is our system from semi-finals, there was a lot of engineering went into just building the system, right? Because artificial had to run fully autonomously. We couldn't touch it once it started. There was no introspection whatsoever. And so that requires a lot of engineering and making sure there's like redundancy and foolproof stuff. But by the end, we had a pretty modular design system that we could plug and play in components and test them out. Yeah, I'm sure this is all very legible to everybody sitting down. But this huge spider web essentially represents our entire CRS. It is from left to right. Left is input and right is the output. But you can see that there's a ton of interconnected components that happen along the way that's all feeding into each other. Uh, we can skip this a couple of these slides. But this is where we initially had started. You can see there's like, I don't know, 20 components maybe. And I think five survived to the end of finals. For semi-finals, we ended up generating something that looks like this. You can see there are 25 to 30. Some fish that are swimming backwards, which was intentional for sure. Representing the data flow. Yeah . And then this is actually our submission to the semi-finals. Real quick, Shellfish does everything late. This is something that we cannot change about ourselves. I think this was maybe 30 minutes before the actual final submission, where we'd be toast. But we ended up getting all the GitHub actions to run. And we ended up getting lucky because they extended the deadline by a day. They did, they did. But we were ready. We had submitted. Yes. We had submitted. And this whole thing landed us as one of the semi-finalists in the competition. One of the seven teams out of, I think, 40 plus. Yeah. That managed to submit a fully functioning CRS. Yeah , I like to think it was 42 just because I like the Hitchhiker's Guide reference. Okay, okay. I'm sure there's a real number somewhere. Yeah. And I have to say thanks to all of our wonderful team members. This is our semi-finals team. You can see we have like 20 or 30 people up here. All of them contributed greatly to the actual end of the competition. Yeah. But let's dive a little bit into the finals because I think our system wasn't quite the same. And I think one of the biggest ones was the massive increases in resources for finals. So we had said that for the semi-finals it was $100 of LLM and like three machines. For finals we had how much, Lucas? I think it was like $50,000 of LLM credits and like $80,000 of Azure Compute. So that buys you a lot of fuzzing cores. It also buys you a lot of prompts. Yeah, each one of these boxes you see up here is a different 64-core machine that we were actually running our entire CRS on. Yeah, and just seeing it come up and down was super cool. Yeah. But I think one thing that's also cool is because we now had a running system, we were able to add a lot more components that we only had for finals. Do you have a couple ones that you liked for the ones that we added after? That we added after the semi-finals? I mean, after getting the actual GDB stuff to work. That was pretty nice. I think maybe our several different approaches to one-shot bug discovery. Initially, we had just one component that would look at set syncs in Java and attempt to generate a seed that reached there. But afterwards, we're like, LLMs are actually pretty good now. We can just give them a couple pieces of input. We can give them CodeQL queries and we can say, hey, hit this location. I think we had two, three different components? Two? We just had different instances of the same. I see, I see, I see. One thing that also I think goes under the radar a lot is that a lot of the things we built were built for the LLMs of that time, right? So one other shift that happens a lot is as the models get better, we can trust them to do more of the job. So for example, for the grammar writing, initially, it was like, oh, go from function A to B. But then as these models got better, we were like, oh, you want to decide yourself where you're going to go? Go for it. Set yourself some goals and just run wild. I think the other thing that helped was the context for the models quintupled in size by the time of finals, yeah. Yeah, and also for patching, I think. Do you want to talk a little bit about how the patching changed? Yeah, yeah. So the patching went from just we have this root cause to give me the patch. You can see we have this big knowledge base behind us that represents every single piece of vulnerability that we found to root cause that we triaged to patch that was generated. And we were actually able to link these things together. And during this whole time, we were running every patch that we produced against every input that we also produced to create this huge graph of what's actually best at patching what. Because sometimes you would get patches that only slightly extended a buffer boundary, so your crash no longer crashed, but anything new would probably also crash it. So we ended up being able to integrate this and use this knowledge base to say, hey, we only patch four of these 10 vulnerabilities and this other patch patches seven. Here's all this information, generate a better patch. And it turns out that that works pretty well. Yeah, and then as our knowledge base grows, right, we also added more components to do this where one thing I really liked from the organizer side was that your patches had to survive everyone else's attempt to break them. And so we have a lot of stuff in our patches that we fuzz them for a while to make sure that the surrounding area is also safe. But we also send LLM agents there. And then that allows us to even better cluster bugs together. I think we're out of time here. Sorry for yapping so long. But I would like to... I've stopped the screen somehow. Yes, you can see this. Just a big shout out to everybody for our finals team who managed to make it. This was a huge endeavor for two years. We all sacrificed so much to actually make it. Yeah , I think like 40 plus people at some point. Yeah, in total, the amount of people that had touched the system was probably about 40 plus. Yeah, yeah. And we couldn't have done it without them. Yeah , well, that's our time. Thank you , guys.