1 00:00:00,000 --> 00:00:20,620 We were sitting down with Shellfish, who were in the final 10 for the AI Cyber Challenge, which ultimately was, we talked about in this before, which is, you have to create an autonomous system driven by some sort of AI to find bugs in real software or software where they had them injected, 2 00:00:20,620 --> 00:00:38,080 so there was at least something to find there, which you guys ended up finding O-Days, which is a whole other thing, but automatically find bugs through an orchestration system that used AI, and then automatically patch those bugs, and they would submit for points and things like that. 3 00:00:38,080 --> 00:00:44,160 So when this first happened, like when you first heard of this concept, what was your initial knee-jerk? 4 00:00:44,160 --> 00:00:47,480 Like, I'm up for more pain, I need to do this. 5 00:00:48,020 --> 00:00:55,600 Yeah, initially we were thinking that this won't work, that we're traditional binary analysis people, right? 6 00:00:56,060 --> 00:01:03,060 We've been through thick and thin with trying to make all sorts of crazy architectures and whatnot work, and we're like, AI can't do this, right? 7 00:01:03,680 --> 00:01:07,240 When this competition was announced, it was GPT 3.5, right? 8 00:01:07,340 --> 00:01:11,580 And if you've ever played around with it, you know that it just was not good, right? 9 00:01:12,360 --> 00:01:25,580 And so we're like, okay, fuck this AI shit, we're gonna make a system built on analysis that we know works, and we're gonna crush the competition, right? 10 00:01:26,180 --> 00:01:29,460 Two years later, it's maybe a little bit of a different story now. 11 00:01:29,460 --> 00:01:43,300 The models have improved, we've improved, it really changed the landscape of how we thought about security as these models got better, as more techniques came out, and as we got to play with them more. 12 00:01:43,340 --> 00:01:55,260 But I think one thing to mention there that is also interesting is we were like, we did start out with the, oh, this is not going to work at all, we know that it can't do these tasks, and we're just like, but we very quickly realized that, for example, 13 00:01:55,260 --> 00:02:05,440 for the part of the competition where you have to provide patches and fix software, we looked at the state of the art of things of like, how do you automatically do patches? 14 00:02:05,620 --> 00:02:08,280 There was no such thing at the time, really. 15 00:02:08,280 --> 00:02:20,580 There was a lot of research, but most of it ended up boiling down to, oh, let me mess up these conditions a little bit, change a less than or equal to a less than, and like those kinds of things. 16 00:02:20,580 --> 00:02:27,260 But very quickly realized that, yeah, while we can't rely on these LLMs, there's parts that we can't do without them either. 17 00:02:27,320 --> 00:02:32,100 Well, and so previously, did you guys compete in the prior Cyber Grand Challenge? 18 00:02:32,300 --> 00:02:35,240 So our successors or predecessors had. 19 00:02:35,240 --> 00:02:35,400 Gotcha . 20 00:02:35,400 --> 00:02:35,640 Yeah. 21 00:02:35,640 --> 00:02:40,960 Because I know during that time, I don't know if that required patches as well, or if it was just exploitation. 22 00:02:40,960 --> 00:02:41,880 It did require patches. 23 00:02:41,880 --> 00:02:43,740 And so, and in that case, it was pure binary. 24 00:02:43,740 --> 00:02:49,920 So you were doing stuff that was basically monkey patching, just like pop some new assembly in, call it a day. 25 00:02:49,920 --> 00:03:01,320 In this case, you have the binaries to run and test them, but they want code patches for the original source code, which I don't, yeah, I've never, I've been in the industry a long time. 26 00:03:01,320 --> 00:03:03,140 I've never heard of anything doing that. 27 00:03:03,340 --> 00:03:03,520 Yeah. 28 00:03:03,520 --> 00:03:18,520 And even in that competition, like the patching ended up boiling down to mostly like these more like mitigation type fixes, where it's like, oh, we're going to jumble the stack frame and rearrange the variables, or we're going to add stack canaries into the binary afterwards. 29 00:03:18,520 --> 00:03:18,900 Right ? 30 00:03:18,900 --> 00:03:22,760 So really, these more like, they don't prevent the bug from being triggered. 31 00:03:22,760 --> 00:03:23,880 They don't remove the bug. 32 00:03:23,880 --> 00:03:26,780 They just make it unexploitable or harder to exploit. 33 00:03:27,480 --> 00:03:40,220 That was what was so interesting with this contest, is you were allowed to use, or you had the choice to use commercial static code analysis to help identify bugs, or you, heck, you'd use binary code, like the barcode or something like that. 34 00:03:40,220 --> 00:03:41,940 You were allowed commercial licenses. 35 00:03:42,000 --> 00:03:49,640 You would use almost an orchestration platform to kick these things off, detect them, run it, check your own uptime and all of that. 36 00:03:49,640 --> 00:03:52,000 Did you guys end up using any commercial tools? 37 00:03:52,000 --> 00:03:59,320 So I think the only truly commercial tool that we used was CodeQL for static analysis. 38 00:03:59,320 --> 00:04:02,960 But beyond that, it's very funny that you mentioned orchestration framework. 39 00:04:02,960 --> 00:04:14,100 Because normally, when you have such a huge challenge and all of these components interacting, you would want to use something that's stable, well-tested, like maybe Apache Airflow or something. 40 00:04:14,100 --> 00:04:21,720 But instead, you can write entirely from scratch your own orchestration framework, built entirely upon YAML files. 41 00:04:23,680 --> 00:04:25,100 Go on! 42 00:04:25,100 --> 00:04:32,580 YAML files that end up templating bash into the root process of Docker containers. 43 00:04:34,300 --> 00:04:35,840 Go on! 44 00:04:37,040 --> 00:04:38,620 Hackery in the purest sense. 45 00:04:38,640 --> 00:04:42,440 Yeah, I mean, like, this is a hacker competition, so you may as well have hacks. 46 00:04:42,440 --> 00:04:46,400 It was literally whatever we could do to make it work. 47 00:04:46,400 --> 00:04:49,700 And it ended up being a very cool and portable system. 48 00:04:49,700 --> 00:04:54,380 We can run the entire cyber reasoning system on just a workstation. 49 00:04:54,380 --> 00:04:58,180 Or we can scale it up to hundreds of machines in Azure. 50 00:04:58,240 --> 00:05:06,960 So obviously, you wrote that over the course of, I guess, the pre-qualifiers before the finals, or at least round one, whatever that was. 51 00:05:07,140 --> 00:05:10,180 How did that evolve into the finals? 52 00:05:10,180 --> 00:05:15,720 Because I know during the pre or the first round, you had to provide a proof of vulnerability. 53 00:05:15,720 --> 00:05:18,000 But it sounded like in the finals, you didn't. 54 00:05:18,500 --> 00:05:22,420 That was one, I guess, twist that we had heard about. 55 00:05:22,420 --> 00:05:29,600 Were there any other twists in terms of your orchestration that you're like, oh, we spent all this time and now we don't have to do that anymore? 56 00:05:29,600 --> 00:05:31,760 Or, oh, crap, now there's a new thing. 57 00:05:31,920 --> 00:05:33,740 And how are we going to deal with that? 58 00:05:33,740 --> 00:05:41,700 Yeah, I think the biggest thing that comes to mind is like the the budgets just massively increased in terms of both compute and LLM costs that we had available. 59 00:05:41,700 --> 00:05:45,860 So for semifinals, for each challenge, you had about $100 of LLM credits. 60 00:05:46,120 --> 00:05:54,880 And so at the time, you know, all of the LLM prototypes we built, all of the techniques had to fit within that $100 bill budget. 61 00:05:55,040 --> 00:05:57,440 And so that really limited what we could do. 62 00:05:57,460 --> 00:06:02,940 Now we had, I think, for 60 challenges, we had like 50K LLM budget. 63 00:06:02,940 --> 00:06:03,280 Yeah. 64 00:06:03,280 --> 00:06:06,420 And so that boiled down to like $900 per challenge. 65 00:06:06,420 --> 00:06:08,940 And all of a sudden, you have a lot more freedom to experiment. 66 00:06:09,500 --> 00:06:17,040 How many within Static Code Analysis, like the tool, did you ever find true vulnerabilities using only the LLM? 67 00:06:17,300 --> 00:06:19,180 Oh, using only the LLM? 68 00:06:19,380 --> 00:06:20,300 Yes. 69 00:06:20,300 --> 00:06:20,880 Yeah, yeah. 70 00:06:20,880 --> 00:06:21,620 Really? 71 00:06:21,620 --> 00:06:21,960 Yes. 72 00:06:21,960 --> 00:06:26,460 So like feeding in parts of the Static Code to identify a bug here? 73 00:06:26,460 --> 00:06:32,840 So part of our whole CRS framework, we can break it down into several different phases. 74 00:06:32,840 --> 00:06:37,260 But the initial phase, run a bunch of Static Analysis tools, gather the results. 75 00:06:37,360 --> 00:06:45,400 And then because we have full code bases to work on of hundreds of thousands, if not millions of lines of code, we need to boil this down to something that the LLMs can ingest. 76 00:06:45,400 --> 00:06:53,040 So we use the Static Analysis tools to figure out where they should look at first, rank these in some order, and then say, hey, can you reach this location? 77 00:06:53,040 --> 00:06:54,840 Or, hey, is there a bug here? 78 00:06:54,840 --> 00:06:58,080 And if there's a bug here, can you just crash it for me? 79 00:06:58,420 --> 00:07:02,360 And as it turns out, it can, in fact, just crash it for you. 80 00:07:02,920 --> 00:07:08,120 So wait, you mentioned that it really sucked in the beginning, and then it got better over time. 81 00:07:08,220 --> 00:07:12,220 Was it capable at like the GPT 3.5 era to just do it? 82 00:07:12,220 --> 00:07:14,620 Or did that not come until later models? 83 00:07:14,620 --> 00:07:18,620 Or did you find yourself using something other than GPT? 84 00:07:18,620 --> 00:07:30,500 So I think it kind of started for us where we were like, hey, we can start to do something more of the now more popular approach of like the agentic thing where you let the LLM kind of run by itself. 85 00:07:30,500 --> 00:07:32,520 We started noticing that that worked. 86 00:07:32,520 --> 00:07:45,460 I think the first with CLAWD 3.5 Sonnet, I think we have pretty heavy uses of various types of models in our thing, but a lot of it is CLAWD 4 now. 87 00:07:45,460 --> 00:07:51,300 And CLAWD 3.5 Sonnet was the first prototype where we were like, hey, this is actually really cool. 88 00:07:51,300 --> 00:07:53,040 It's able to use tools we give it. 89 00:07:53,040 --> 00:07:54,200 It can use a debugger. 90 00:07:54,200 --> 00:07:58,140 It can write Python scripts to interact with stuff. 91 00:07:59,100 --> 00:08:17,040 And I think that was also one of the first models where we found that ability to write Python scripts that produce inputs that we then feed to the program really helped a lot because all of a sudden, instead of having your fuzzer have to break compression or like break some checksum, 92 00:08:17,040 --> 00:08:21,740 it can just import Zlib, zlib.compress, boom, you're there, right? 93 00:08:21,780 --> 00:08:25,860 And so I think that was the first step where we're like, oh, wow, that's really cool. 94 00:08:27,280 --> 00:08:29,460 So gosh, there's so much to unpack here. 95 00:08:29,460 --> 00:08:42,700 So let's, I want to bring back to when you were interacting with the LLMs, were you interacting like directly with, oh, I'm going to open AI's API, or were you using a higher level like a lane chain or something like that to actually, so it would pick, 96 00:08:42,700 --> 00:08:45,640 okay, this problem is best solved by this model? 97 00:08:46,160 --> 00:08:48,020 No, we were not that sophisticated. 98 00:08:48,360 --> 00:09:01,640 It was pretty much, it starts off of us just in like the console of GPT or Anthropic building kind of test cases of, okay, I have this input, if I, let's see if I can actually manually massage this into place. 99 00:09:01,640 --> 00:09:12,200 And then once we've confirmed that that works, we then try and turn that into some sort of prompt and automated system so that we're able to do this over and over again and verify that. 100 00:09:12,200 --> 00:09:32,980 And we had like our own system built on top of that, one of the people on our team built called AgentLib that built on top of lane chain, but made a bunch of like super nice wrappers around it to be tool calling and like have agents with history that automatically prune and like all of those like common techniques were a little bit like abstracted away. 101 00:09:32,980 --> 00:09:36,120 So you could focus a little bit more on the prompting and the component writing. 102 00:09:36,120 --> 00:09:38,300 Yeah, I've used, I've used lane chain before. 103 00:09:38,300 --> 00:09:43,640 It's really, I'm sorry if the developers, it's really janky, it's really clunky. 104 00:09:43,640 --> 00:09:43,840 Yeah. 105 00:09:43,840 --> 00:09:47,760 And at a certain point, you're like, I can just maybe just do this over here somewhere. 106 00:09:47,760 --> 00:09:54,600 I think one of the important things to note, too, is that like we evolved as AI also evolved at the same time. 107 00:09:54,600 --> 00:09:58,220 So when we started, tool calls didn't exist as a concept. 108 00:09:58,220 --> 00:10:08,680 We had to figure out how to get it to execute like arbitrary Python code, which was very scary because we're just like, hey, I just made this thing where if you give me Python code, I'll just run it on my system. 109 00:10:08,960 --> 00:10:09,720 Yeah, right. 110 00:10:09,720 --> 00:10:12,140 Full access to pull down any libraries you need. 111 00:10:12,140 --> 00:10:12,580 Yeah, sure. 112 00:10:12,580 --> 00:10:13,260 Just go for it. 113 00:10:13,260 --> 00:10:13,480 Right. 114 00:10:13,480 --> 00:10:14,520 It's probably okay. 115 00:10:14,520 --> 00:10:15,300 I'm sure. 116 00:10:15,480 --> 00:10:21,160 But no, then, you know, we slowly built our own agentic framework and then like agents and stuff also became a thing. 117 00:10:21,160 --> 00:10:23,860 But our system was already so hard set in the stuff that we had done. 118 00:10:23,860 --> 00:10:25,520 We just continued to build upon that. 119 00:10:25,520 --> 00:10:30,160 So now that you've gotten through the competition, you guys did very well. 120 00:10:31,100 --> 00:10:35,480 Who do you see actually deploying these types of systems? 121 00:10:35,480 --> 00:10:44,100 Obviously, every not obviously, but every team is required as part of the competition to open source their work or some amount of it. 122 00:10:44,100 --> 00:10:46,300 I don't know what the actual stipulations are. 123 00:10:46,480 --> 00:10:49,580 I imagine you're very interested to see what everyone else did. 124 00:10:49,580 --> 00:10:49,980 Yes . 125 00:10:50,380 --> 00:10:53,560 Who do you think is going to take this and run with it after it? 126 00:10:53,560 --> 00:10:56,460 Do you guys have plans to do something with it afterwards? 127 00:10:56,500 --> 00:10:58,300 Are you already starting your own company? 128 00:10:59,120 --> 00:10:59,560 Oh, yeah. 129 00:10:59,560 --> 00:11:01,080 It's you want to go Lucas? 130 00:11:01,080 --> 00:11:01,440 Sure. 131 00:11:01,440 --> 00:11:01,700 Yeah. 132 00:11:01,700 --> 00:11:03,340 I mean, I think the answer kind of. 133 00:11:03,340 --> 00:11:08,360 I mean, for us, we've built and spent like the last two years building the system. 134 00:11:08,480 --> 00:11:10,620 Obviously we want to keep it going, right? 135 00:11:10,620 --> 00:11:19,380 And so yeah, we're thinking of exactly this kind of thing of like, how can we make a company that then can actually provide stuff to people, right? 136 00:11:19,380 --> 00:11:21,780 Like that can actually make people's code safer. 137 00:11:21,900 --> 00:11:27,980 And I think that answer is of like, who's going to use it and how is different depending on the use case. 138 00:11:27,980 --> 00:11:34,260 I mean, if you're someone like Google that has just infinite money, basically, to throw at the problem, right? 139 00:11:34,260 --> 00:11:43,180 Then you can do a lot more of the techniques that I think this competition finals incentivize where you're just like, have a lot more resources available. 140 00:11:43,500 --> 00:11:50,120 I think for smaller companies, there is parts though, of these systems that generally don't cost that much money. 141 00:11:51,080 --> 00:11:57,860 One of the settings of the challenge was you're given a target repository, plus a set of changes. 142 00:11:57,860 --> 00:12:03,060 And then you're instructed to find bugs that are introduced by those changes. 143 00:12:03,260 --> 00:12:08,520 Now it turns out that that problem all of a sudden is a lot cheaper to solve, right? 144 00:12:09,040 --> 00:12:13,540 You can by just limiting it to those functions plus what they impact. 145 00:12:13,540 --> 00:12:23,760 So for example, if they make new functions reachable that weren't reachable before, that is all of a sudden that something you can maybe do for $5, maybe $20, right? 146 00:12:23,760 --> 00:12:30,820 Depending on how big your changes are, that's all of a sudden a lot more approachable for a lot of folks. 147 00:12:31,200 --> 00:12:39,260 So one of the biggest problems I've seen in static code analysis is you find, oh, there's an injection point right here, but there's no way of reaching it. 148 00:12:39,260 --> 00:12:43,820 So it's kind of like, oh, I don't want to submit this because it's just creating noise for the developers. 149 00:12:43,940 --> 00:12:46,020 How did you guys solve that problem? 150 00:12:47,120 --> 00:12:47,460 Yeah. 151 00:12:47,460 --> 00:12:53,060 So I mean, I think this comes back to the LLM being able to generate reaching seats, right? 152 00:12:53,060 --> 00:13:06,080 So we found that in a lot of cases, if you give the LLM a point and you give it like a good start, like let's say some PDF parser, you give it like a good starting grammar maybe for the fuzzer to create a PDF out of. 153 00:13:06,080 --> 00:13:11,260 It's actually very good at manipulating that to reach that location. 154 00:13:11,260 --> 00:13:15,460 And maybe it doesn't necessarily instantly crash it, but it can get very close. 155 00:13:15,460 --> 00:13:21,780 And maybe within a few minutes or hours, it's able to actually mutate whatever your sheet is to crash the program. 156 00:13:21,780 --> 00:13:29,800 So you had, just to recap what you just said, you had LLMs essentially writing fuzzers as part of your framework. 157 00:13:29,800 --> 00:13:45,400 So not just like we were talking previously about concolic execution, where you have a stack analysis that hits a state space explosion, so you just go run a fuzzer, and then you figure out where the state space shrinks a little bit more, then you go back and forth. 158 00:13:45,400 --> 00:13:53,580 In this case, you actually had the LLM or whatever model mutating your fuzzer to that's dope. 159 00:13:53,580 --> 00:13:55,440 Yeah, that's just cool. 160 00:13:55,580 --> 00:14:04,820 Yeah, we had a this was one of the cooler things where I think we built a lot of stuff around that we want to see the logs to see how well that did. 161 00:14:04,820 --> 00:14:06,840 I think there's obviously stuff that could have gone better. 162 00:14:06,840 --> 00:14:13,880 But I think there's probably also a lot of very cool stuff in there where the LLM is very good at recognizing patterns. 163 00:14:13,880 --> 00:14:14,180 Right. 164 00:14:14,180 --> 00:14:15,380 It looks at a function. 165 00:14:15,380 --> 00:14:20,000 Oh, I know what this this is like, oh, this is clearly trying to parse a PDF. 166 00:14:20,460 --> 00:14:32,020 And so then because we had the LLM write these input grammars that describe the structure of the input, we could detect, hey, this part of this input structure that the LLM is trying to describe looks like a PDF. 167 00:14:32,780 --> 00:14:52,360 And then what we would do is we can take these corpuses of entire known PDFs, but also handwritten grammars for PDFs and splice them in at that point to really supercharge the exploration of that LLM where it's like, OK, well, it got there and it kind of has an idea of where it's trying to go. 168 00:14:52,360 --> 00:14:59,860 We'll help it along so it can focus on like reaching other stuff that's custom to this application instead of having to worry about the PDF format structure itself. 169 00:14:59,860 --> 00:15:04,620 So we're talking about PDFs really quick, but I have a somewhat leading question. 170 00:15:05,720 --> 00:15:16,440 Did the competition give you not necessarily all of the not file formats, but input formats that it would be exposed to? 171 00:15:16,440 --> 00:15:24,700 Or was your system expected to be able to look at a new code base, decide how to exercise it? 172 00:15:24,700 --> 00:15:33,260 So it had to not just reason about how to mutate a fuzzer, it had to reason about what to generate, what fuzzer to generate. 173 00:15:33,260 --> 00:15:34,420 This is all I'll tell you. 174 00:15:34,640 --> 00:15:35,440 That's wild. 175 00:15:35,440 --> 00:15:39,500 I didn't realize the input to these to our system is cURL. 176 00:15:39,500 --> 00:15:46,440 So they will send us a cURL request that contains a JSON body that just tells us here's the link to the repo. 177 00:15:46,440 --> 00:15:50,960 And here's like the very base metadata of this is a C project. 178 00:15:50,960 --> 00:15:52,760 Here's where you can find the Docker file. 179 00:15:52,760 --> 00:15:55,500 Here's where you can find like the supported fuzzers. 180 00:15:55,500 --> 00:15:56,480 And then that's it. 181 00:15:56,780 --> 00:15:57,380 Yeah. 182 00:15:59,160 --> 00:16:04,840 So let's let's talk about stages, because there's probably some breakdown and we'll call it your orchestration, which is a stage. 183 00:16:04,840 --> 00:16:09,740 The first stage is discovery or identification, probably recon, whatever you want to call it. 184 00:16:09,740 --> 00:16:12,160 Can you walk us through the stages of your approach? 185 00:16:12,580 --> 00:16:12,900 Sure . 186 00:16:12,900 --> 00:16:14,000 Yeah, absolutely. 187 00:16:14,000 --> 00:16:14,300 Yeah. 188 00:16:14,300 --> 00:16:19,960 So we break it down into I think it's about five stages. 189 00:16:19,960 --> 00:16:21,140 One is just the input, right? 190 00:16:21,140 --> 00:16:22,980 This is this is what we ingest. 191 00:16:22,980 --> 00:16:29,860 And in the case of this competition, it's OSS fuzz projects, right, which have a relatively set format and is somewhat easy to parse. 192 00:16:29,860 --> 00:16:40,920 Then we have our static analysis stage where we run tools like CodeQL, Semgrep, and then if they give us any sort of diffs, if it's that type of challenge, we figure out, OK, what are the functions that were touched that were changed? 193 00:16:40,940 --> 00:16:48,580 Then we feed this information into our dynamic analysis phase, which includes the LLMs trying to generate reaching input. 194 00:16:48,580 --> 00:16:48,760 Yes. 195 00:16:48,760 --> 00:16:52,480 I want to pause you on the static code analysis, where you're running Semgrep and things like that. 196 00:16:53,060 --> 00:17:02,600 The outputs of those files, were you running them through some sort of report parser that you wrote or were you handing those straight over to an LLM and say, make sense of that? 197 00:17:02,600 --> 00:17:04,680 So kind of a little bit of both. 198 00:17:04,680 --> 00:17:12,000 So we have a component that we called CodeSwipe that basically just aggregates rankings from different tools. 199 00:17:14,200 --> 00:17:21,260 But one of those tools or specifically two of those tools that feed into that ranking would use LLMs to try to rank it. 200 00:17:21,260 --> 00:17:28,100 So, for example, we had a component called DiffGuy that would take the diff, it would analyze, it would try to find what's reachable. 201 00:17:28,220 --> 00:17:37,360 And then for each of those functions, it would hand them off to LLMs in combinations of like, hey, do you think there's a bug of type of a buffer overflow here or just do you think there's a bug here? 202 00:17:38,220 --> 00:17:52,260 The other thing we had was this like custom model that one of the people on our team trained that was trying to do the same thing where you just give it all of the functions and it tells you, I think this is more likely vulnerable than this other function over here. 203 00:17:52,460 --> 00:17:53,880 So a little bit of both. 204 00:17:53,880 --> 00:18:11,340 But everything kind of culminated in this ranking, this numerical ranking, where honestly, that's just like heuristics where we're just like, hey, four times this score plus two times this score, just to give us a numerical ranking that we can then rate the functions by and hand off to the LLM C generator. 205 00:18:11,340 --> 00:18:12,180 So I'd grab that. 206 00:18:12,180 --> 00:18:16,120 So I'd grab those outputs then and move those into the dynamic analysis portion. 207 00:18:16,120 --> 00:18:16,340 Yeah. 208 00:18:16,340 --> 00:18:20,380 So then we know kind of where we need to start, at least for the LLM portion. 209 00:18:20,380 --> 00:18:24,760 Where do you need to start looking to try and exploit or find crashes or bugs? 210 00:18:24,760 --> 00:18:33,660 And then on the flip side of that is you had our suite of fuzzers, right, where we identify first, OK, what type of input does this thing take? 211 00:18:33,660 --> 00:18:35,060 Are we talking SQL queries? 212 00:18:35,060 --> 00:18:36,500 Are we talking PDFs? 213 00:18:36,960 --> 00:18:41,320 And then as we fuzz, we generate coverage reports. 214 00:18:41,320 --> 00:18:51,020 We figure out how far did this grammar that we've generated actually reach into the program and then feed that back into the LLM grammar generation that says, hey, you reached this far. 215 00:18:51,020 --> 00:18:53,000 This is what's in your immediate vicinity. 216 00:18:53,200 --> 00:18:54,780 This is what you've done so far. 217 00:18:54,780 --> 00:18:56,200 Can you go even further? 218 00:18:56,280 --> 00:19:02,540 Well, what's cool about this, too, is that, like, I was I think we were all a little bit hesitant to do this initially. 219 00:19:02,580 --> 00:19:14,040 But when we talk about this, like, oh, the LLM has to reach certain functions and it has to it has to hit a certain piece of code with a certain vulnerability in it. 220 00:19:15,000 --> 00:19:19,200 One of the main components actually just lets the LLM choose what it wants to reach. 221 00:19:19,740 --> 00:19:23,760 And so that's kind of cool where it's like, it's like, oh, you've reached these functions. 222 00:19:23,760 --> 00:19:27,340 It has a list of goals of like, hey, I'm trying to reach these things. 223 00:19:27,340 --> 00:19:30,380 And it can itself decide, I want to add this as a goal function. 224 00:19:30,380 --> 00:19:32,160 I want to add this as a goal function. 225 00:19:32,200 --> 00:19:36,260 And then it gets it in the status report with a nice little green checkmark when it finally does. 226 00:19:37,360 --> 00:19:41,440 So like, wait, so dynamic analysis back here, so many questions I want to ask. 227 00:19:41,440 --> 00:19:43,120 Go after dynamic analysis. 228 00:19:43,120 --> 00:19:44,280 Where did it run off to? 229 00:19:44,280 --> 00:19:44,720 Yes. 230 00:19:44,720 --> 00:19:46,780 So then we had root causing, right? 231 00:19:46,780 --> 00:19:50,640 Because ultimately, we need to patch these vulnerabilities that we find. 232 00:19:50,640 --> 00:19:53,540 And in order to patch them, you do have to understand them. 233 00:19:53,880 --> 00:20:06,380 We found that a good portion of vulnerabilities, once you're given the crash, you're patching or LLM can understand it based on the crash report and just give you something that's pretty good, right? 234 00:20:06,480 --> 00:20:17,920 But when you have things that are like use after free or heap buffer overflows, where maybe the actual user or vulnerability location happened way earlier than the actual crash location. 235 00:20:17,920 --> 00:20:22,440 And so in that case, we had two separate triaging systems that attempted to find the root cause. 236 00:20:22,560 --> 00:20:32,040 So , yeah, I was going to say, well, how did your system deal with detecting the victim rather than the perpetrator of, you know, use after free or race condition? 237 00:20:32,040 --> 00:20:34,140 Or did you did you get there? 238 00:20:34,360 --> 00:20:39,700 Yeah, I mean, I think there's kind of like two pretty different approaches. 239 00:20:39,700 --> 00:20:41,980 We've tried to have a little bit of a mix there. 240 00:20:42,700 --> 00:20:49,420 One can be kind of boiled down to you hook up the LLM to a debugger and say, tell me what's up. 241 00:20:50,840 --> 00:20:56,660 And that one is actually surprisingly effective if you constrain it enough and give it good enough input. 242 00:20:56,660 --> 00:20:58,460 Will was working on that one for a while. 243 00:20:58,520 --> 00:20:58,700 Yeah. 244 00:20:58,700 --> 00:21:04,620 One of the biggest challenges with that is that if you just tell the LLM, hey, you can access GDB, here's where we crashed. 245 00:21:04,620 --> 00:21:14,220 Can you tell me like a little bit about what happened is it starts trying to examine every single pointer that it can see and then every single value that that pointer points to. 246 00:21:14,220 --> 00:21:19,120 And then it started looking at the stack values and then it just does it just freaks out. 247 00:21:19,120 --> 00:21:19,380 Right. 248 00:21:19,380 --> 00:21:22,820 So you have to put it in a little bit of a box first. 249 00:21:23,000 --> 00:21:24,800 But if you do, it's actually quite effective. 250 00:21:24,920 --> 00:21:38,860 And then the other approach was a little bit more of like the traditional, more statistical approaches of trying to do call traces, seeing which parts light up more in crashing inputs versus non-crashing inputs and that kind of thing. 251 00:21:38,860 --> 00:21:45,220 And then both of those approaches produce their own reports and their own ranking of like, this is where I think the patch should happen. 252 00:21:45,840 --> 00:21:56,020 I'm guessing at this point, after this point, it was probably pretty easy because you now can hand an LLM saying like, here is the exact crash location. 253 00:21:56,020 --> 00:21:58,940 Here is the piece of code causing this. 254 00:21:58,940 --> 00:22:00,980 Here's the type of bug. 255 00:22:00,980 --> 00:22:02,180 Go patch it. 256 00:22:02,180 --> 00:22:03,460 So is that correct? 257 00:22:03,460 --> 00:22:04,020 You would think. 258 00:22:04,020 --> 00:22:04,640 You would think. 259 00:22:04,640 --> 00:22:05,420 I would think. 260 00:22:05,420 --> 00:22:06,260 You would think. 261 00:22:06,300 --> 00:22:07,340 So it actually turns out... 262 00:22:07,340 --> 00:22:09,080 And it's also what we thought, too, by the way. 263 00:22:09,080 --> 00:22:09,820 Yes. 264 00:22:10,440 --> 00:22:12,780 So that it is true. 265 00:22:12,780 --> 00:22:19,800 It is somewhat easy to get to a patch that ends up then actually fixing that specific crashing input. 266 00:22:19,800 --> 00:22:27,540 But what it turns out is a lot harder is making sure that you submit a patch that fixes all crashing inputs. 267 00:22:28,060 --> 00:22:31,060 So, for example, we had a case in one of the... 268 00:22:31,600 --> 00:22:35,220 So DARPA ran a couple of exhibition rounds before to let us test the systems. 269 00:22:36,400 --> 00:22:42,800 In one of the exhibition rounds, they had a target where we found a bypass to the organizer written patch. 270 00:22:43,500 --> 00:22:51,080 And so there was a lot of logic that we had we added that was like, OK, make sure that there's definitely no more crashes. 271 00:22:51,080 --> 00:22:51,220 Right. 272 00:22:51,220 --> 00:22:53,100 So we would take the patches. 273 00:22:53,100 --> 00:22:54,160 We would fuzz them for a little bit. 274 00:22:54,160 --> 00:23:00,880 We would give them to our vulnerability hunter agent again and say, like, now try to bypass this patch. 275 00:23:00,880 --> 00:23:07,860 And it turns out that there was actually a decent amount of patches that without those stages were bypassable. 276 00:23:07,860 --> 00:23:11,820 Whereas it was like, oh, let me just double the size of the buffer or something. 277 00:23:11,820 --> 00:23:12,040 Right. 278 00:23:12,040 --> 00:23:21,000 Like patching is even like even in these we were we had exhibition rounds leading up to the finals where the organizers would give us a set of pre challenges that they had done. 279 00:23:21,000 --> 00:23:27,600 And then after the round was over, they'd release, oh, here's the vulnerabilities and here's the diffs for some of them. 280 00:23:27,640 --> 00:23:31,060 And in the diffs were supposed to be the patches that they applied. 281 00:23:31,060 --> 00:23:33,620 And we were able to bypass some of those patches as well. 282 00:23:33,620 --> 00:23:36,300 So even for humans, writing patches is difficult. 283 00:23:36,400 --> 00:23:37,300 It's interesting. 284 00:23:37,300 --> 00:23:39,460 It's like we both agreed. 285 00:23:39,460 --> 00:23:43,020 You're like, we thought that was going to be easy, but it wasn't. 286 00:23:43,020 --> 00:23:50,340 What was what are other like what is the most surprising thing you hit where you're like, I was expecting this and it totally was not that. 287 00:23:51,020 --> 00:24:03,980 I mean, I think the first one was the the that the surprising fact that these LLMs can even just do this like one shot seed writing where you're just like, oh, here's a bunch of functions along a path you want to hit. 288 00:24:04,120 --> 00:24:08,280 And these functions are really hard sometimes for fuzzers to hit. 289 00:24:08,860 --> 00:24:11,380 And the LLM does it for like 50 cents. 290 00:24:11,520 --> 00:24:13,300 It's like, yeah, it's just wild. 291 00:24:13,300 --> 00:24:21,100 I mean , honestly, the first time we we were all in like a room together and I know I knew people were working on this component and they say, oh, I hit the bug. 292 00:24:21,100 --> 00:24:25,300 And I was like, bullshit, you over tuned like, you know, you told it where you needed to go. 293 00:24:25,300 --> 00:24:28,960 And then they showed me they do it a second time on like something totally like fuck. 294 00:24:29,940 --> 00:24:36,440 So a couple of years ago, I pivoted away from vulnerability research and doing Linux development now. 295 00:24:36,440 --> 00:24:46,340 And one of the reasons for that is I got a little burnt out and I realized that the problem is, in some senses, like if you want to go do embedded systems work, it's never been easier. 296 00:24:46,340 --> 00:24:56,260 In other ways, it's only beginning harder and harder and harder to make a living in this space, at least compared to even 10 years ago, five years ago. 297 00:24:56,440 --> 00:25:01,460 What you're describing is like, oh, we just found a way to make it significantly easier. 298 00:25:02,120 --> 00:25:02,920 Great. 299 00:25:02,920 --> 00:25:03,980 Oh, shit. 300 00:25:04,700 --> 00:25:07,600 Oh, crap, is my response to that. 301 00:25:07,600 --> 00:25:09,240 That's fascinating. 302 00:25:09,520 --> 00:25:22,580 So so the cool thing about it, though, is that I think one thing that I've taken away from a lot of this is that traditionally, I've not been a super big believer in the idea of like directed fuzzing and all of that. 303 00:25:22,580 --> 00:25:26,380 I think it's mostly had at best marginal effects. 304 00:25:26,380 --> 00:25:34,680 But now if this is remains true, which is what seems to be true, which is like you can just tell the LM, hey, I think there's a bug here. 305 00:25:34,680 --> 00:25:35,660 Go try hit it. 306 00:25:35,860 --> 00:25:48,600 Now, all of a sudden, you can do a lot more research into what do bugs look like and how can I find the pattern of a bug and how do I identify bad looking code, like that code smell idea. 307 00:25:48,860 --> 00:25:55,180 And all of a sudden, all of that research, now you have an actionable thing that can take that and say, oh, you're right, that is bad. 308 00:25:55,420 --> 00:26:06,380 So I think for me, this seems like the obvious step, because we look at most code analysis tools and they're pretty stupid, like SEMGRAP, like we are looking for patterns which we have created. 309 00:26:06,380 --> 00:26:25,320 What we're now doing, though, with large language models, which are great at grabbing unstructured data and adding structure to them and looking patterns, I think the only thing which is going to be like a significant gotcha with it is that the generic training we're doing is including so many stupid patterns. 310 00:26:26,080 --> 00:26:34,980 So really, so an interesting part about the grammar fuzzing thing is we actually had to tune it a little bit differently because the LM was too good at generating structured code. 311 00:26:35,040 --> 00:26:43,600 It would generate code that was that would be within the bounds of what a normal programmer would think to do, but didn't actually test maybe the max or min. 312 00:26:43,600 --> 00:26:48,360 And so on top of that, grammar had to add an extra layer that was like, oh, it's trying to set an integer here. 313 00:26:48,360 --> 00:26:58,320 Let's actually extend that a little bit so it can be a hacker domain LLM that is just like, no, we're going to keep this one private because it would be too dangerous to release. 314 00:27:00,040 --> 00:27:04,220 No, code smell would be a good name for that tool. 315 00:27:04,820 --> 00:27:09,500 So if it's not already trademarked, I recommend we're not going to publish this video right away. 316 00:27:09,500 --> 00:27:10,600 Feel free to run off. 317 00:27:10,600 --> 00:27:12,040 We'll get on it right after. 318 00:27:13,340 --> 00:27:19,440 So you hit the point, you've done triage, you identified a bug, you're now ready to do a PR . 319 00:27:19,440 --> 00:27:21,000 What's the next step? 320 00:27:21,180 --> 00:27:22,540 Do you build unit tests? 321 00:27:22,540 --> 00:27:26,440 Like , I'm assuming now you want to build a unit test almost. 322 00:27:26,440 --> 00:27:30,240 I guess you've identified a bug, you've done a PR somewhere along the line. 323 00:27:30,240 --> 00:27:31,880 I'm guessing you're building a unit test. 324 00:27:31,880 --> 00:27:32,660 We'll check. 325 00:27:32,660 --> 00:27:34,200 Have I properly patched it? 326 00:27:34,200 --> 00:27:36,600 I'm guessing that's the part you were kind of talking about. 327 00:27:36,600 --> 00:27:36,880 Yeah. 328 00:27:36,880 --> 00:27:43,440 So the way it works in the setting of the competition is basically the unit tests are given to us by the organizers. 329 00:27:43,440 --> 00:27:44,540 Not ahead of time, right? 330 00:27:44,540 --> 00:27:47,220 We don't ever see them, but the system sees them. 331 00:27:47,360 --> 00:27:54,700 And so when we produce a patch, we have to run all of the unit tests and they run them all before the submission. 332 00:27:54,700 --> 00:28:00,440 And our patches are only considered valid if all of the functionality tests remain passing. 333 00:28:01,200 --> 00:28:19,160 What we have done is a little bit more of what we talked about earlier, where our version of unit testing is basically taking the aggregated set of all crashing inputs we've ever found, making sure that all of the ones that we've clustered together in that same bucket that we believe belong to the same vulnerability, 334 00:28:19,160 --> 00:28:22,720 making sure that they patch as many of those as possible. 335 00:28:22,720 --> 00:28:36,680 And then with the patches we end up submitting to the organizers are only the ones that are either perfect and patching their entire cluster, or after some amount of time, we'll be like, OK, we've tried, we're clearly not able to make a perfect patch, 336 00:28:36,680 --> 00:28:38,800 maybe we'll submit the imperfect one. 337 00:28:38,800 --> 00:28:42,700 So that's a little bit more of the testing of the patches that we do. 338 00:28:42,700 --> 00:28:46,180 So before we let you go, there's two questions, there's two ones I have to ask. 339 00:28:46,180 --> 00:28:57,980 One, in early days of LLMs, there was little stupid tweaks you could do, like take a breath and then answer, or you are a penetration tester trying to do this. 340 00:28:57,980 --> 00:29:03,720 Did you find weird tweaks like that along the way where if we said this, this massively improved it? 341 00:29:03,720 --> 00:29:13,220 So I'll say initially, yes, we had crazy ideas, we would yell at it, we would threaten it, right? 342 00:29:13,220 --> 00:29:22,180 We came up, we never really used this, but the Russian roulette expert approach in which you ask, you know, the three expert approach, right? 343 00:29:22,540 --> 00:29:31,800 Where instead, you have 100 experts, and each time it doesn't give you the answer you want, you say, I killed expert 86, do you want to try that again? 344 00:29:32,940 --> 00:29:47,420 But and then ultimately, as models got better, these things phase out as they're better understanding like human language and intention, it phased out into just have well structured prompts, define things like this is the instruction in like XML tags, 345 00:29:47,420 --> 00:29:50,740 this is the input I'm giving you and yada yada. 346 00:29:50,740 --> 00:29:52,740 I did have to laugh early days. 347 00:29:52,740 --> 00:29:54,240 It was like this is life or death. 348 00:29:54,240 --> 00:29:57,420 If you do not get this right, you are going to kill me. 349 00:29:57,420 --> 00:30:00,180 And if he gets it wrong, you're like, you killed me, please. 350 00:30:00,180 --> 00:30:06,280 And now the LLM is turning it around on us and Claude is going to phone the FBI when we threaten it. 351 00:30:06,700 --> 00:30:08,620 That was the first question. 352 00:30:08,620 --> 00:30:11,520 The second question is hindsight 2020. 353 00:30:11,680 --> 00:30:12,960 You're now at the end. 354 00:30:13,340 --> 00:30:17,420 If you could say something to yourself at the beginning of the competition. 355 00:30:17,940 --> 00:30:20,000 What would you tell yourself? 356 00:30:22,380 --> 00:30:24,100 Say it was worth it. 357 00:30:24,100 --> 00:30:27,520 Yeah, yeah, I think I go for it. 358 00:30:27,560 --> 00:30:30,660 I think that I learned so much along this way. 359 00:30:30,660 --> 00:30:34,800 I mean, traditional binary analysis knew nothing about AI or LLM when I started. 360 00:30:34,800 --> 00:30:37,140 I did not actually even like the field at all. 361 00:30:38,020 --> 00:30:40,400 But I thought, hey, these things are kind of popping up. 362 00:30:40,400 --> 00:30:42,500 It would be cool to get experience doing this. 363 00:30:42,500 --> 00:30:44,720 And I think I learned how to use these. 364 00:30:44,720 --> 00:30:47,600 And I think I know what makes them tick a little bit. 365 00:30:47,600 --> 00:30:54,580 And I know how I can integrate it in my own projects to make them better and maybe hopefully, you know, make the world a better place. 366 00:30:54,580 --> 00:30:56,220 Open source tools, you know. 367 00:30:56,620 --> 00:31:08,620 I think my answer would be a little bit of like the don't be afraid to experiment just because I think, you know, this is a pretty big effort to build a fully autonomous system that has to be full hands off, right? 368 00:31:08,620 --> 00:31:10,060 Like you're in the real world. 369 00:31:10,060 --> 00:31:13,060 You might have people that can fix stuff when it breaks. 370 00:31:13,060 --> 00:31:16,180 But in our case, we had to do a lot of engineering to make that happen. 371 00:31:18,320 --> 00:31:26,120 And so for me, it was really nice between semifinals and finals to have that breathing room where you're like, OK, we made it past that boundary. 372 00:31:26,120 --> 00:31:27,980 Now we can start exploring the space again. 373 00:31:27,980 --> 00:31:30,660 And then we rapidly tried out a bunch of stuff. 374 00:31:30,680 --> 00:31:40,240 And I think encouraging that more and like earlier and realizing that, you know, the system is going to run whatever it's you have to make it work. 375 00:31:40,240 --> 00:31:44,700 But in the approaches, you can be a little bit more experimental. 376 00:31:44,700 --> 00:31:47,860 I think that could have been very, very cool just to see what else is out there. 377 00:31:47,860 --> 00:31:51,460 I think there's so much stuff we haven't tried yet that we want to try still. 378 00:31:51,460 --> 00:31:55,180 And it really is amazing how much it's changed even in two years. 379 00:31:55,180 --> 00:32:00,800 And it's I'm curious, especially with the sheer amount of open source tools. 380 00:32:00,800 --> 00:32:08,860 Yeah, I'm curious how long before or if there was an approach which was like, go find another open source tool to do this thing. 381 00:32:08,860 --> 00:32:12,960 It's just like creating its own, you know, creating tools or finding new tools. 382 00:32:13,820 --> 00:32:14,620 Perfect. 383 00:32:15,140 --> 00:32:17,660 We've now that we've solved the world problems. 384 00:32:17,660 --> 00:32:18,920 I mean, what do we do now? 385 00:32:21,200 --> 00:32:23,440 Thank you so much for joining us. 386 00:32:23,440 --> 00:32:25,280 Thanks for sharing kind of the secrets. 387 00:32:25,280 --> 00:32:28,840 I cannot wait for it to be open source and take a look at what you guys did. 388 00:32:28,900 --> 00:32:30,880 And we'll keep an eye on what was it? 389 00:32:31,140 --> 00:32:31,620 Codesmell? 390 00:32:32,420 --> 00:32:33,080 Codesmell, yeah. 391 00:32:33,080 --> 00:32:33,580 Thank you. 392 00:32:33,580 --> 00:32:34,760 Thank you for watching. 393 00:32:34,760 --> 00:32:35,040 Thank you so much. 394 00:32:35,040 --> 00:32:36,100 Thanks for having us. 395 00:32:36,100 --> 00:32:36,960 And hack on!