WEBVTT

00:00.000 --> 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,

00:20.620 --> 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.

00:38.080 --> 00:44.160
So when this first happened, like when you first heard of this concept, what was your initial knee-jerk?

00:44.160 --> 00:47.480
Like, I'm up for more pain, I need to do this.

00:48.020 --> 00:55.600
Yeah, initially we were thinking that this won't work, that we're traditional binary analysis people, right?

00:56.060 --> 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?

01:03.680 --> 01:07.240
When this competition was announced, it was GPT 3.5, right?

01:07.340 --> 01:11.580
And if you've ever played around with it, you know that it just was not good, right?

01:12.360 --> 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?

01:26.180 --> 01:29.460
Two years later, it's maybe a little bit of a different story now.

01:29.460 --> 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.

01:43.340 --> 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,

01:55.260 --> 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?

02:05.620 --> 02:08.280
There was no such thing at the time, really.

02:08.280 --> 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.

02:20.580 --> 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.

02:27.320 --> 02:32.100
Well, and so previously, did you guys compete in the prior Cyber Grand Challenge?

02:32.300 --> 02:35.240
So our successors or predecessors had.

02:35.240 --> 02:35.400
Gotcha .

02:35.400 --> 02:35.640
Yeah.

02:35.640 --> 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.

02:40.960 --> 02:41.880
It did require patches.

02:41.880 --> 02:43.740
And so, and in that case, it was pure binary.

02:43.740 --> 02:49.920
So you were doing stuff that was basically monkey patching, just like pop some new assembly in, call it a day.

02:49.920 --> 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.

03:01.320 --> 03:03.140
I've never heard of anything doing that.

03:03.340 --> 03:03.520
Yeah.

03:03.520 --> 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.

03:18.520 --> 03:18.900
Right ?

03:18.900 --> 03:22.760
So really, these more like, they don't prevent the bug from being triggered.

03:22.760 --> 03:23.880
They don't remove the bug.

03:23.880 --> 03:26.780
They just make it unexploitable or harder to exploit.

03:27.480 --> 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.

03:40.220 --> 03:41.940
You were allowed commercial licenses.

03:42.000 --> 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.

03:49.640 --> 03:52.000
Did you guys end up using any commercial tools?

03:52.000 --> 03:59.320
So I think the only truly commercial tool that we used was CodeQL for static analysis.

03:59.320 --> 04:02.960
But beyond that, it's very funny that you mentioned orchestration framework.

04:02.960 --> 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.

04:14.100 --> 04:21.720
But instead, you can write entirely from scratch your own orchestration framework, built entirely upon YAML files.

04:23.680 --> 04:25.100
Go on!

04:25.100 --> 04:32.580
YAML files that end up templating bash into the root process of Docker containers.

04:34.300 --> 04:35.840
Go on!

04:37.040 --> 04:38.620
Hackery in the purest sense.

04:38.640 --> 04:42.440
Yeah, I mean, like, this is a hacker competition, so you may as well have hacks.

04:42.440 --> 04:46.400
It was literally whatever we could do to make it work.

04:46.400 --> 04:49.700
And it ended up being a very cool and portable system.

04:49.700 --> 04:54.380
We can run the entire cyber reasoning system on just a workstation.

04:54.380 --> 04:58.180
Or we can scale it up to hundreds of machines in Azure.

04:58.240 --> 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.

05:07.140 --> 05:10.180
How did that evolve into the finals?

05:10.180 --> 05:15.720
Because I know during the pre or the first round, you had to provide a proof of vulnerability.

05:15.720 --> 05:18.000
But it sounded like in the finals, you didn't.

05:18.500 --> 05:22.420
That was one, I guess, twist that we had heard about.

05:22.420 --> 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?

05:29.600 --> 05:31.760
Or, oh, crap, now there's a new thing.

05:31.920 --> 05:33.740
And how are we going to deal with that?

05:33.740 --> 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.

05:41.700 --> 05:45.860
So for semifinals, for each challenge, you had about $100 of LLM credits.

05:46.120 --> 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.

05:55.040 --> 05:57.440
And so that really limited what we could do.

05:57.460 --> 06:02.940
Now we had, I think, for 60 challenges, we had like 50K LLM budget.

06:02.940 --> 06:03.280
Yeah.

06:03.280 --> 06:06.420
And so that boiled down to like $900 per challenge.

06:06.420 --> 06:08.940
And all of a sudden, you have a lot more freedom to experiment.

06:09.500 --> 06:17.040
How many within Static Code Analysis, like the tool, did you ever find true vulnerabilities using only the LLM?

06:17.300 --> 06:19.180
Oh, using only the LLM?

06:19.380 --> 06:20.300
Yes.

06:20.300 --> 06:20.880
Yeah, yeah.

06:20.880 --> 06:21.620
Really?

06:21.620 --> 06:21.960
Yes.

06:21.960 --> 06:26.460
So like feeding in parts of the Static Code to identify a bug here?

06:26.460 --> 06:32.840
So part of our whole CRS framework, we can break it down into several different phases.

06:32.840 --> 06:37.260
But the initial phase, run a bunch of Static Analysis tools, gather the results.

06:37.360 --> 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.

06:45.400 --> 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?

06:53.040 --> 06:54.840
Or, hey, is there a bug here?

06:54.840 --> 06:58.080
And if there's a bug here, can you just crash it for me?

06:58.420 --> 07:02.360
And as it turns out, it can, in fact, just crash it for you.

07:02.920 --> 07:08.120
So wait, you mentioned that it really sucked in the beginning, and then it got better over time.

07:08.220 --> 07:12.220
Was it capable at like the GPT 3.5 era to just do it?

07:12.220 --> 07:14.620
Or did that not come until later models?

07:14.620 --> 07:18.620
Or did you find yourself using something other than GPT?

07:18.620 --> 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.

07:30.500 --> 07:32.520
We started noticing that that worked.

07:32.520 --> 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.

07:45.460 --> 07:51.300
And CLAWD 3.5 Sonnet was the first prototype where we were like, hey, this is actually really cool.

07:51.300 --> 07:53.040
It's able to use tools we give it.

07:53.040 --> 07:54.200
It can use a debugger.

07:54.200 --> 07:58.140
It can write Python scripts to interact with stuff.

07:59.100 --> 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,

08:17.040 --> 08:21.740
it can just import Zlib, zlib.compress, boom, you're there, right?

08:21.780 --> 08:25.860
And so I think that was the first step where we're like, oh, wow, that's really cool.

08:27.280 --> 08:29.460
So gosh, there's so much to unpack here.

08:29.460 --> 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,

08:42.700 --> 08:45.640
okay, this problem is best solved by this model?

08:46.160 --> 08:48.020
No, we were not that sophisticated.

08:48.360 --> 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.

09:01.640 --> 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.

09:12.200 --> 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.

09:32.980 --> 09:36.120
So you could focus a little bit more on the prompting and the component writing.

09:36.120 --> 09:38.300
Yeah, I've used, I've used lane chain before.

09:38.300 --> 09:43.640
It's really, I'm sorry if the developers, it's really janky, it's really clunky.

09:43.640 --> 09:43.840
Yeah.

09:43.840 --> 09:47.760
And at a certain point, you're like, I can just maybe just do this over here somewhere.

09:47.760 --> 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.

09:54.600 --> 09:58.220
So when we started, tool calls didn't exist as a concept.

09:58.220 --> 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.

10:08.960 --> 10:09.720
Yeah, right.

10:09.720 --> 10:12.140
Full access to pull down any libraries you need.

10:12.140 --> 10:12.580
Yeah, sure.

10:12.580 --> 10:13.260
Just go for it.

10:13.260 --> 10:13.480
Right.

10:13.480 --> 10:14.520
It's probably okay.

10:14.520 --> 10:15.300
I'm sure.

10:15.480 --> 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.

10:21.160 --> 10:23.860
But our system was already so hard set in the stuff that we had done.

10:23.860 --> 10:25.520
We just continued to build upon that.

10:25.520 --> 10:30.160
So now that you've gotten through the competition, you guys did very well.

10:31.100 --> 10:35.480
Who do you see actually deploying these types of systems?

10:35.480 --> 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.

10:44.100 --> 10:46.300
I don't know what the actual stipulations are.

10:46.480 --> 10:49.580
I imagine you're very interested to see what everyone else did.

10:49.580 --> 10:49.980
Yes .

10:50.380 --> 10:53.560
Who do you think is going to take this and run with it after it?

10:53.560 --> 10:56.460
Do you guys have plans to do something with it afterwards?

10:56.500 --> 10:58.300
Are you already starting your own company?

10:59.120 --> 10:59.560
Oh, yeah.

10:59.560 --> 11:01.080
It's you want to go Lucas?

11:01.080 --> 11:01.440
Sure.

11:01.440 --> 11:01.700
Yeah.

11:01.700 --> 11:03.340
I mean, I think the answer kind of.

11:03.340 --> 11:08.360
I mean, for us, we've built and spent like the last two years building the system.

11:08.480 --> 11:10.620
Obviously we want to keep it going, right?

11:10.620 --> 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?

11:19.380 --> 11:21.780
Like that can actually make people's code safer.

11:21.900 --> 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.

11:27.980 --> 11:34.260
I mean, if you're someone like Google that has just infinite money, basically, to throw at the problem, right?

11:34.260 --> 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.

11:43.500 --> 11:50.120
I think for smaller companies, there is parts though, of these systems that generally don't cost that much money.

11:51.080 --> 11:57.860
One of the settings of the challenge was you're given a target repository, plus a set of changes.

11:57.860 --> 12:03.060
And then you're instructed to find bugs that are introduced by those changes.

12:03.260 --> 12:08.520
Now it turns out that that problem all of a sudden is a lot cheaper to solve, right?

12:09.040 --> 12:13.540
You can by just limiting it to those functions plus what they impact.

12:13.540 --> 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?

12:23.760 --> 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.

12:31.200 --> 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.

12:39.260 --> 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.

12:43.940 --> 12:46.020
How did you guys solve that problem?

12:47.120 --> 12:47.460
Yeah.

12:47.460 --> 12:53.060
So I mean, I think this comes back to the LLM being able to generate reaching seats, right?

12:53.060 --> 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.

13:06.080 --> 13:11.260
It's actually very good at manipulating that to reach that location.

13:11.260 --> 13:15.460
And maybe it doesn't necessarily instantly crash it, but it can get very close.

13:15.460 --> 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.

13:21.780 --> 13:29.800
So you had, just to recap what you just said, you had LLMs essentially writing fuzzers as part of your framework.

13:29.800 --> 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.

13:45.400 --> 13:53.580
In this case, you actually had the LLM or whatever model mutating your fuzzer to that's dope.

13:53.580 --> 13:55.440
Yeah, that's just cool.

13:55.580 --> 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.

14:04.820 --> 14:06.840
I think there's obviously stuff that could have gone better.

14:06.840 --> 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.

14:13.880 --> 14:14.180
Right.

14:14.180 --> 14:15.380
It looks at a function.

14:15.380 --> 14:20.000
Oh, I know what this this is like, oh, this is clearly trying to parse a PDF.

14:20.460 --> 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.

14:32.780 --> 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.

14:52.360 --> 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.

14:59.860 --> 15:04.620
So we're talking about PDFs really quick, but I have a somewhat leading question.

15:05.720 --> 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?

15:16.440 --> 15:24.700
Or was your system expected to be able to look at a new code base, decide how to exercise it?

15:24.700 --> 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.

15:33.260 --> 15:34.420
This is all I'll tell you.

15:34.640 --> 15:35.440
That's wild.

15:35.440 --> 15:39.500
I didn't realize the input to these to our system is cURL.

15:39.500 --> 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.

15:46.440 --> 15:50.960
And here's like the very base metadata of this is a C project.

15:50.960 --> 15:52.760
Here's where you can find the Docker file.

15:52.760 --> 15:55.500
Here's where you can find like the supported fuzzers.

15:55.500 --> 15:56.480
And then that's it.

15:56.780 --> 15:57.380
Yeah.

15:59.160 --> 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.

16:04.840 --> 16:09.740
The first stage is discovery or identification, probably recon, whatever you want to call it.

16:09.740 --> 16:12.160
Can you walk us through the stages of your approach?

16:12.580 --> 16:12.900
Sure .

16:12.900 --> 16:14.000
Yeah, absolutely.

16:14.000 --> 16:14.300
Yeah.

16:14.300 --> 16:19.960
So we break it down into I think it's about five stages.

16:19.960 --> 16:21.140
One is just the input, right?

16:21.140 --> 16:22.980
This is this is what we ingest.

16:22.980 --> 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.

16:29.860 --> 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?

16:40.940 --> 16:48.580
Then we feed this information into our dynamic analysis phase, which includes the LLMs trying to generate reaching input.

16:48.580 --> 16:48.760
Yes.

16:48.760 --> 16:52.480
I want to pause you on the static code analysis, where you're running Semgrep and things like that.

16:53.060 --> 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?

17:02.600 --> 17:04.680
So kind of a little bit of both.

17:04.680 --> 17:12.000
So we have a component that we called CodeSwipe that basically just aggregates rankings from different tools.

17:14.200 --> 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.

17:21.260 --> 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.

17:28.220 --> 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?

17:38.220 --> 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.

17:52.460 --> 17:53.880
So a little bit of both.

17:53.880 --> 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.

18:11.340 --> 18:12.180
So I'd grab that.

18:12.180 --> 18:16.120
So I'd grab those outputs then and move those into the dynamic analysis portion.

18:16.120 --> 18:16.340
Yeah.

18:16.340 --> 18:20.380
So then we know kind of where we need to start, at least for the LLM portion.

18:20.380 --> 18:24.760
Where do you need to start looking to try and exploit or find crashes or bugs?

18:24.760 --> 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?

18:33.660 --> 18:35.060
Are we talking SQL queries?

18:35.060 --> 18:36.500
Are we talking PDFs?

18:36.960 --> 18:41.320
And then as we fuzz, we generate coverage reports.

18:41.320 --> 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.

18:51.020 --> 18:53.000
This is what's in your immediate vicinity.

18:53.200 --> 18:54.780
This is what you've done so far.

18:54.780 --> 18:56.200
Can you go even further?

18:56.280 --> 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.

19:02.580 --> 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.

19:15.000 --> 19:19.200
One of the main components actually just lets the LLM choose what it wants to reach.

19:19.740 --> 19:23.760
And so that's kind of cool where it's like, it's like, oh, you've reached these functions.

19:23.760 --> 19:27.340
It has a list of goals of like, hey, I'm trying to reach these things.

19:27.340 --> 19:30.380
And it can itself decide, I want to add this as a goal function.

19:30.380 --> 19:32.160
I want to add this as a goal function.

19:32.200 --> 19:36.260
And then it gets it in the status report with a nice little green checkmark when it finally does.

19:37.360 --> 19:41.440
So like, wait, so dynamic analysis back here, so many questions I want to ask.

19:41.440 --> 19:43.120
Go after dynamic analysis.

19:43.120 --> 19:44.280
Where did it run off to?

19:44.280 --> 19:44.720
Yes.

19:44.720 --> 19:46.780
So then we had root causing, right?

19:46.780 --> 19:50.640
Because ultimately, we need to patch these vulnerabilities that we find.

19:50.640 --> 19:53.540
And in order to patch them, you do have to understand them.

19:53.880 --> 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?

20:06.480 --> 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.

20:17.920 --> 20:22.440
And so in that case, we had two separate triaging systems that attempted to find the root cause.

20:22.560 --> 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?

20:32.040 --> 20:34.140
Or did you did you get there?

20:34.360 --> 20:39.700
Yeah, I mean, I think there's kind of like two pretty different approaches.

20:39.700 --> 20:41.980
We've tried to have a little bit of a mix there.

20:42.700 --> 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.

20:50.840 --> 20:56.660
And that one is actually surprisingly effective if you constrain it enough and give it good enough input.

20:56.660 --> 20:58.460
Will was working on that one for a while.

20:58.520 --> 20:58.700
Yeah.

20:58.700 --> 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.

21:04.620 --> 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.

21:14.220 --> 21:19.120
And then it started looking at the stack values and then it just does it just freaks out.

21:19.120 --> 21:19.380
Right.

21:19.380 --> 21:22.820
So you have to put it in a little bit of a box first.

21:23.000 --> 21:24.800
But if you do, it's actually quite effective.

21:24.920 --> 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.

21:38.860 --> 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.

21:45.840 --> 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.

21:56.020 --> 21:58.940
Here is the piece of code causing this.

21:58.940 --> 22:00.980
Here's the type of bug.

22:00.980 --> 22:02.180
Go patch it.

22:02.180 --> 22:03.460
So is that correct?

22:03.460 --> 22:04.020
You would think.

22:04.020 --> 22:04.640
You would think.

22:04.640 --> 22:05.420
I would think.

22:05.420 --> 22:06.260
You would think.

22:06.300 --> 22:07.340
So it actually turns out...

22:07.340 --> 22:09.080
And it's also what we thought, too, by the way.

22:09.080 --> 22:09.820
Yes.

22:10.440 --> 22:12.780
So that it is true.

22:12.780 --> 22:19.800
It is somewhat easy to get to a patch that ends up then actually fixing that specific crashing input.

22:19.800 --> 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.

22:28.060 --> 22:31.060
So, for example, we had a case in one of the...

22:31.600 --> 22:35.220
So DARPA ran a couple of exhibition rounds before to let us test the systems.

22:36.400 --> 22:42.800
In one of the exhibition rounds, they had a target where we found a bypass to the organizer written patch.

22:43.500 --> 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.

22:51.080 --> 22:51.220
Right.

22:51.220 --> 22:53.100
So we would take the patches.

22:53.100 --> 22:54.160
We would fuzz them for a little bit.

22:54.160 --> 23:00.880
We would give them to our vulnerability hunter agent again and say, like, now try to bypass this patch.

23:00.880 --> 23:07.860
And it turns out that there was actually a decent amount of patches that without those stages were bypassable.

23:07.860 --> 23:11.820
Whereas it was like, oh, let me just double the size of the buffer or something.

23:11.820 --> 23:12.040
Right.

23:12.040 --> 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.

23:21.000 --> 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.

23:27.640 --> 23:31.060
And in the diffs were supposed to be the patches that they applied.

23:31.060 --> 23:33.620
And we were able to bypass some of those patches as well.

23:33.620 --> 23:36.300
So even for humans, writing patches is difficult.

23:36.400 --> 23:37.300
It's interesting.

23:37.300 --> 23:39.460
It's like we both agreed.

23:39.460 --> 23:43.020
You're like, we thought that was going to be easy, but it wasn't.

23:43.020 --> 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.

23:51.020 --> 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.

24:04.120 --> 24:08.280
And these functions are really hard sometimes for fuzzers to hit.

24:08.860 --> 24:11.380
And the LLM does it for like 50 cents.

24:11.520 --> 24:13.300
It's like, yeah, it's just wild.

24:13.300 --> 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.

24:21.100 --> 24:25.300
And I was like, bullshit, you over tuned like, you know, you told it where you needed to go.

24:25.300 --> 24:28.960
And then they showed me they do it a second time on like something totally like fuck.

24:29.940 --> 24:36.440
So a couple of years ago, I pivoted away from vulnerability research and doing Linux development now.

24:36.440 --> 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.

24:46.340 --> 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.

24:56.440 --> 25:01.460
What you're describing is like, oh, we just found a way to make it significantly easier.

25:02.120 --> 25:02.920
Great.

25:02.920 --> 25:03.980
Oh, shit.

25:04.700 --> 25:07.600
Oh, crap, is my response to that.

25:07.600 --> 25:09.240
That's fascinating.

25:09.520 --> 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.

25:22.580 --> 25:26.380
I think it's mostly had at best marginal effects.

25:26.380 --> 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.

25:34.680 --> 25:35.660
Go try hit it.

25:35.860 --> 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.

25:48.860 --> 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.

25:55.420 --> 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.

26:06.380 --> 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.

26:26.080 --> 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.

26:35.040 --> 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.

26:43.600 --> 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.

26:48.360 --> 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.

27:00.040 --> 27:04.220
No, code smell would be a good name for that tool.

27:04.820 --> 27:09.500
So if it's not already trademarked, I recommend we're not going to publish this video right away.

27:09.500 --> 27:10.600
Feel free to run off.

27:10.600 --> 27:12.040
We'll get on it right after.

27:13.340 --> 27:19.440
So you hit the point, you've done triage, you identified a bug, you're now ready to do a PR .

27:19.440 --> 27:21.000
What's the next step?

27:21.180 --> 27:22.540
Do you build unit tests?

27:22.540 --> 27:26.440
Like , I'm assuming now you want to build a unit test almost.

27:26.440 --> 27:30.240
I guess you've identified a bug, you've done a PR somewhere along the line.

27:30.240 --> 27:31.880
I'm guessing you're building a unit test.

27:31.880 --> 27:32.660
We'll check.

27:32.660 --> 27:34.200
Have I properly patched it?

27:34.200 --> 27:36.600
I'm guessing that's the part you were kind of talking about.

27:36.600 --> 27:36.880
Yeah.

27:36.880 --> 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.

27:43.440 --> 27:44.540
Not ahead of time, right?

27:44.540 --> 27:47.220
We don't ever see them, but the system sees them.

27:47.360 --> 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.

27:54.700 --> 28:00.440
And our patches are only considered valid if all of the functionality tests remain passing.

28:01.200 --> 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,

28:19.160 --> 28:22.720
making sure that they patch as many of those as possible.

28:22.720 --> 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,

28:36.680 --> 28:38.800
maybe we'll submit the imperfect one.

28:38.800 --> 28:42.700
So that's a little bit more of the testing of the patches that we do.

28:42.700 --> 28:46.180
So before we let you go, there's two questions, there's two ones I have to ask.

28:46.180 --> 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.

28:57.980 --> 29:03.720
Did you find weird tweaks like that along the way where if we said this, this massively improved it?

29:03.720 --> 29:13.220
So I'll say initially, yes, we had crazy ideas, we would yell at it, we would threaten it, right?

29:13.220 --> 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?

29:22.540 --> 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?

29:32.940 --> 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,

29:47.420 --> 29:50.740
this is the input I'm giving you and yada yada.

29:50.740 --> 29:52.740
I did have to laugh early days.

29:52.740 --> 29:54.240
It was like this is life or death.

29:54.240 --> 29:57.420
If you do not get this right, you are going to kill me.

29:57.420 --> 30:00.180
And if he gets it wrong, you're like, you killed me, please.

30:00.180 --> 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.

30:06.700 --> 30:08.620
That was the first question.

30:08.620 --> 30:11.520
The second question is hindsight 2020.

30:11.680 --> 30:12.960
You're now at the end.

30:13.340 --> 30:17.420
If you could say something to yourself at the beginning of the competition.

30:17.940 --> 30:20.000
What would you tell yourself?

30:22.380 --> 30:24.100
Say it was worth it.

30:24.100 --> 30:27.520
Yeah, yeah, I think I go for it.

30:27.560 --> 30:30.660
I think that I learned so much along this way.

30:30.660 --> 30:34.800
I mean, traditional binary analysis knew nothing about AI or LLM when I started.

30:34.800 --> 30:37.140
I did not actually even like the field at all.

30:38.020 --> 30:40.400
But I thought, hey, these things are kind of popping up.

30:40.400 --> 30:42.500
It would be cool to get experience doing this.

30:42.500 --> 30:44.720
And I think I learned how to use these.

30:44.720 --> 30:47.600
And I think I know what makes them tick a little bit.

30:47.600 --> 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.

30:54.580 --> 30:56.220
Open source tools, you know.

30:56.620 --> 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?

31:08.620 --> 31:10.060
Like you're in the real world.

31:10.060 --> 31:13.060
You might have people that can fix stuff when it breaks.

31:13.060 --> 31:16.180
But in our case, we had to do a lot of engineering to make that happen.

31:18.320 --> 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.

31:26.120 --> 31:27.980
Now we can start exploring the space again.

31:27.980 --> 31:30.660
And then we rapidly tried out a bunch of stuff.

31:30.680 --> 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.

31:40.240 --> 31:44.700
But in the approaches, you can be a little bit more experimental.

31:44.700 --> 31:47.860
I think that could have been very, very cool just to see what else is out there.

31:47.860 --> 31:51.460
I think there's so much stuff we haven't tried yet that we want to try still.

31:51.460 --> 31:55.180
And it really is amazing how much it's changed even in two years.

31:55.180 --> 32:00.800
And it's I'm curious, especially with the sheer amount of open source tools.

32:00.800 --> 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.

32:08.860 --> 32:12.960
It's just like creating its own, you know, creating tools or finding new tools.

32:13.820 --> 32:14.620
Perfect.

32:15.140 --> 32:17.660
We've now that we've solved the world problems.

32:17.660 --> 32:18.920
I mean, what do we do now?

32:21.200 --> 32:23.440
Thank you so much for joining us.

32:23.440 --> 32:25.280
Thanks for sharing kind of the secrets.

32:25.280 --> 32:28.840
I cannot wait for it to be open source and take a look at what you guys did.

32:28.900 --> 32:30.880
And we'll keep an eye on what was it?

32:31.140 --> 32:31.620
Codesmell?

32:32.420 --> 32:33.080
Codesmell, yeah.

32:33.080 --> 32:33.580
Thank you.

32:33.580 --> 32:34.760
Thank you for watching.

32:34.760 --> 32:35.040
Thank you so much.

32:35.040 --> 32:36.100
Thanks for having us.

32:36.100 --> 32:36.960
And hack on!

