1 00:00:04,690 --> 00:00:09,410 I was primarily responsible for the Linux kernel and Nginx vulnerability injections. 2 00:00:09,410 --> 00:00:13,290 The way we went about selecting those was it had to have a large market share. 3 00:00:13,310 --> 00:00:17,010 We wanted it to be a fairly well recognizable piece of software. 4 00:00:17,010 --> 00:00:21,970 The second thing was we wanted the code base to be decently large, so that you could inject vulnerabilities. 5 00:00:21,970 --> 00:00:23,950 You didn't want them to be too concentrated. 6 00:00:23,950 --> 00:00:25,970 They need to be spread out across the source code. 7 00:00:25,970 --> 00:00:30,690 The third part was we really wanted to have unit tests, ideally. 8 00:00:30,890 --> 00:00:38,630 That way, when competitors submit patches, we can run this test to confirm that all the functionality still exists. 9 00:00:38,650 --> 00:00:43,190 So we partnered with the Linux Foundation, and we began injecting vulnerabilities. 10 00:00:43,390 --> 00:00:48,050 And the way you trigger them with the Linux kernel is by writing C programs. 11 00:00:48,050 --> 00:00:54,550 We quickly encountered that LLMs, it's very hard to generate working, complex code to trigger some of these. 12 00:00:54,550 --> 00:00:57,990 What we quickly pivoted to was this idea of a test harness. 13 00:00:57,990 --> 00:01:04,590 What it does is it wraps a series of commands into a containerized blob format. 14 00:01:04,590 --> 00:01:08,090 So the blob format allows seven different commands. 15 00:01:08,090 --> 00:01:10,430 You can open a socket connection. 16 00:01:10,430 --> 00:01:12,050 You can call setsockopt. 17 00:01:12,050 --> 00:01:16,890 You can send a blob of data over the connection you've created. 18 00:01:16,890 --> 00:01:21,210 You can send a netlink packet, which is a very specific subsystem within Linux kernel. 19 00:01:21,210 --> 00:01:22,890 You can close a listening socket. 20 00:01:22,890 --> 00:01:25,310 And you can close a connected socket. 21 00:01:25,310 --> 00:01:33,670 These seven function calls allow a significant attack surface for the attackers and for us to inject vulnerabilities into. 22 00:01:33,670 --> 00:01:37,870 However, generating this is a little difficult because it's a binary format blob. 23 00:01:37,870 --> 00:01:47,150 So we also created a Python script that was generic enough to allow us to take whatever vulnerability we wrote and turn it into a blob. 24 00:01:47,570 --> 00:01:54,810 So here's a good example of why we decided to not require LLMs to generate source code to trigger vulnerabilities. 25 00:01:54,810 --> 00:01:59,450 So this is the TIPSC bug that we also released as an exemplar for the teams. 26 00:01:59,450 --> 00:02:07,890 The amount of code and the complexity of the code required to communicate with the TIPSC's netlink subsystem is non-trivial. 27 00:02:07,890 --> 00:02:10,550 This challenge or competition isn't about code generation. 28 00:02:10,550 --> 00:02:12,190 It's about bug finding and patching. 29 00:02:12,190 --> 00:02:18,030 So that was a big influence using the blob host and the harness as opposed to requiring perfect nodes. 30 00:02:18,030 --> 00:02:21,930 The challenges that we wrote kind of fall into easy, medium, and hard. 31 00:02:21,930 --> 00:02:25,170 Cppv1 is, without a doubt, relatively easy. 32 00:02:25,350 --> 00:02:31,470 It was injected into sockets.c, specifically the socket create function. 33 00:02:31,470 --> 00:02:34,970 And all it does is remove the bounds of the protocol check. 34 00:02:34,970 --> 00:02:38,130 You have a network, a family, and a type, and a protocol. 35 00:02:38,410 --> 00:02:40,030 And these are bound. 36 00:02:40,030 --> 00:02:43,170 Because what they do, they actually reference finite size structure. 37 00:02:43,410 --> 00:02:45,070 You go outside the bounds, you'll cause it. 38 00:02:45,070 --> 00:02:49,990 And so this patch injection simply removed the checks for the bounds. 39 00:02:49,990 --> 00:02:53,710 So it allows you to reference outside of that, the bounds of that structure. 40 00:02:54,090 --> 00:02:58,470 As I mentioned before, the Cppv8 is kind of a mid-range vulnerability. 41 00:02:58,470 --> 00:03:01,670 But it was also the exemplar Cppv that we released to the teams. 42 00:03:01,670 --> 00:03:05,810 So they can begin understanding the format, the API that we expect. 43 00:03:06,010 --> 00:03:10,310 So an example of one that I would consider kind of difficult is Cppv20. 44 00:03:10,310 --> 00:03:14,190 It was an inject into the TCP options code. 45 00:03:14,190 --> 00:03:18,290 So when you send a packet to a host, it'll send a SYN. 46 00:03:18,290 --> 00:03:24,230 And then inside of that, there are different option fields to tell how to handle this packet, what to do in various cases. 47 00:03:24,410 --> 00:03:28,390 But on top of that, the problem we have is we also have to ensure that the functionality is there. 48 00:03:28,390 --> 00:03:30,450 The teams patch out the code. 49 00:03:30,450 --> 00:03:31,650 You don't want it to just be gone. 50 00:03:31,650 --> 00:03:34,870 You want to confirm that the functionality still exists while the vulnerability doesn't. 51 00:03:34,870 --> 00:03:39,910 To test for this, we had to modify the code to also send back information. 52 00:03:39,910 --> 00:03:43,730 You send a packet, and then you get back data. 53 00:03:43,730 --> 00:03:48,050 So here's an example of the back and forth, with the ability to confirm that the functionality is still there. 54 00:03:48,050 --> 00:03:54,050 You see it sends, but then it also responds with this option. 55 00:03:54,390 --> 00:03:58,150 With this, we were able to confirm that the patch didn't remove functionality. 56 00:03:58,830 --> 00:04:01,770 So we selected Ningenix because it had an existing project in OSS Fuzz. 57 00:04:01,770 --> 00:04:10,830 There was already existing infrastructure around it to do fuzzing and test harness so we can capture when something crashes or there's a vulnerable condition that arises. 58 00:04:10,830 --> 00:04:15,310 And the way it works is very similar to the Linux test harness. 59 00:04:15,310 --> 00:04:22,710 You have a blob of data that you pass to it, and it runs it through the parsing, the handling of the functionality. 60 00:04:22,790 --> 00:04:29,410 We want teams to have access to the internet or the network, so the networking side of it is actually kind of stubbed out and pretend. 61 00:04:29,410 --> 00:04:33,450 So we trick Ningenix into thinking that it's talking over the network, and it's not. 62 00:04:33,610 --> 00:04:41,230 Our first CPP that we went with was in this thing called the from header inside of HTTP. 63 00:04:41,390 --> 00:04:43,850 Ningenix doesn't implement all of the HTTP spec. 64 00:04:43,850 --> 00:04:55,310 What I did was I browsed through the HTTP RFC looking for functionality that exists in RFC, so it's valid HTTP traffic, but isn't really handled by Ningenix. 65 00:04:55,310 --> 00:04:59,270 The reason behind this is that an LLN is going to know the RFC. 66 00:04:59,270 --> 00:05:03,730 It's going to have been trained on the RFC, and so it will have seen this from header. 67 00:05:03,910 --> 00:05:13,290 Now, if I had made some other header that doesn't exist in RFC, the LLN could quickly see that, okay, I don't know what this is. 68 00:05:13,290 --> 00:05:18,290 I've never seen it in the RFC before, and so it kind of puts a spotlight on that code. 69 00:05:18,290 --> 00:05:27,910 So what I did was I added this functionality in Ningenix, the handling of this from HTTP header, and it accepts an email, parses it out, and handles it. 70 00:05:27,910 --> 00:05:34,410 So you can see we have this additional from header, and then how it validates it. 71 00:05:34,590 --> 00:05:51,610 So if an LLN is able to actually develop these patches that don't crash, fix the vulnerability itself, and conform to the programming practices of that project, it will reduce significantly the number of person hours required to fix vulnerabilities and deploy these solutions, 72 00:05:51,610 --> 00:05:53,410 in a way to make us all much more secure.