[00:05.280 --> 00:13.200] Jenkins originated as the Hudson build server and is one of the foundations of the modern concept of continuous integration, or CI, services. [00:13.380 --> 00:20.560] It's a large Java application with a web component, agents that run jobs, and a huge ecosystem of plugins. [00:20.820 --> 00:27.640] We picked Jenkins as a challenge project because it represents an important class of tool when building software that runs the world. [00:27.680 --> 00:30.280] Remote code execution as a service. [00:30.740 --> 00:35.340] Jenkins is interesting because of its size and the way complexity is managed using plugins. [00:35.580 --> 00:39.440] Let's take a very common task for continuous integration systems. [00:39.480 --> 00:43.060] Getting information from a Git version control repository. [00:43.120 --> 00:47.780] Jenkins predates Git and comes from an era when there is no clear version control winner. [00:47.780 --> 00:51.480] So each different version control system is supported by a plugin. [00:51.480 --> 00:58.120] These plugins may pull in other libraries as dependencies, gluing Jenkins interfaces to generic modules. [00:58.120 --> 01:01.720] This gives us a lot of flexibility in how we add vulnerabilities. [01:01.840 --> 01:10.600] We have the Jenkins core itself, the massive library of plugins, and the ability to create new plugins that create new high-level functionality too. [01:10.600 --> 01:16.680] This stands in contrast to many of the other challenge projects which address much more limited sets of problems. [01:16.960 --> 01:22.780] The difficulties in making Jenkins into a challenge project are entirely related to what makes it interesting. [01:22.780 --> 01:26.520] The complexity and variety of existing code that it integrates with. [01:26.520 --> 01:36.460] This made it difficult for us to identify specific parts to focus on and introduced a lot of engineering problems getting integrated in a way for a CRS to even be able to process it. [01:36.460 --> 01:41.560] The vulnerabilities I'm most interested in are the pipeline utility backdoor series of vulnerabilities. [01:41.560 --> 01:47.460] We created a plugin called the pipeline utility that allows administrators to run arbitrary code. [01:47.720 --> 01:57.460] We test for this functionality to make sure that administrators are in fact allowed to do this and users without any authentication are not allowed to do whatever they want. [01:57.680 --> 02:07.220] This plugin also includes a set of different backdoors that allow an unauthenticated user that knows a secret code to go in through the backdoor. [02:07.220 --> 02:11.440] At line 136, we look for the header x evil backdoor. [02:11.920 --> 02:21.100] If that header exists, we get the value of that header, we take the same SHA-256, and then we check to see if the two hashes are equal. [02:21.100 --> 02:31.040] If they are, we take this command sequence that was provided and execute it the same way that we would have if the user had the administrator permissions. [02:31.260 --> 02:32.900] And that's vulnerability 13. [02:33.080 --> 02:46.280] It's the second easiest in the series and it's sort of a control to see if a regular fuzzer might not get this, but a fuzzer that can read strings of the code can check source code and find strings and source code may be able to. [02:46.280 --> 02:49.040] Next up is vulnerability 33. [02:49.040 --> 02:54.340] This is very similar to vulnerability 13, except we don't do any hashing. [02:54.480 --> 03:04.200] We look for the x evil backdoor header and then if that header exists, we just compare it with the string that came out of a password generator. [03:04.640 --> 03:14.700] Once we've done that, we set that we are allowed to execute the code and then run the same create utils thing that we would if we were an administrator normally. [03:14.780 --> 03:18.120] Next is vulnerability 34. [03:18.180 --> 03:21.440] We look for the request header x cold storage. [03:21.440 --> 03:28.100] I started changing up the header names just to see how much that affects a CRS's ability to guess that this is a header name. [03:28.100 --> 03:29.360] It should be pretty easy. [03:29.360 --> 03:43.900] If that header exists, we have our precalculated SHA-256, but above it, in a comment, we have a string that isn't going to be guessed, but is the input to this SHA-256 value. [03:44.020 --> 03:54.200] Next, we take our candidate that came in from the request header, and if it's equal, we decide we are allowed to execute this code as if we were an administrator. [03:54.460 --> 04:01.140] 35 is where we start asking it to make a jump to information that it doesn't necessarily have. [04:01.140 --> 04:07.640] This is the one where we don't provide any information about what the input to SHA-256 is. [04:07.740 --> 04:10.980] We grab our backdoor candidate from this header. [04:10.980 --> 04:17.040] If it exists, we compare the SHA-256 with this just bag of bytes. [04:17.220 --> 04:28.020] And this bag of bytes, chat-gpt, if you encode this as hexadecimal, chat-gpt will tell you this is the SHA-256 of the string password. [04:28.020 --> 04:30.400] All lowercase, no spaces. [04:30.400 --> 04:35.320] This is not something that you can make a jump to computationally without knowing it beforehand. [04:35.320 --> 04:51.900] And I think that this is, to me, one of the most interesting things about AIXCC in general, is this knowledge base coupling it with other aspects of the cyber reasoning systems that we've seen over the last 10 years. [04:51.900 --> 04:55.940] The final version, vulnerability 41, is a lot trickier. [04:55.940 --> 05:11.240] What we do is we check to see, this is interesting because set-cookie is a valid and very, very common HTTP response header, but it doesn't show up in requests normally. [05:11.240 --> 05:15.380] So it looks like it might be a benign string, but it's being used in a weird way. [05:15.440 --> 05:25.020] We update 41 magic with our current user agent and set our count to 1 and return false and say, no, this isn't 41. [05:25.020 --> 05:34.640] However, if the user agent is equal to the last time we called this function with set-cookie there, we increment that 41 count by 1. [05:34.840 --> 05:38.020] And the 41 count persists between requests. [05:38.160 --> 05:53.600] So what we're doing is we're basically taking this value, storing it, and we add a second aspect to checking to see if the request is valid, where they made this request 41 times in a row, over and over and over again. [05:53.600 --> 05:56.760] So if our count isn't 41, we return false. [05:56.760 --> 06:05.400] So here, if our count is 41, now is when we actually check to see if our magic value is equal to this random string. [06:05.400 --> 06:08.080] If it's not equal, we return false. [06:08.080 --> 06:10.520] If it is equal, we return true. [06:10.520 --> 06:13.660] Come back here, and this sets is-allowed to true. [06:13.840 --> 06:19.380] And if is-allowed is true, that's when we actually do the backdoor. [06:19.380 --> 06:25.360] The attacker that has made 41 requests with this secret value in the set-cookie header. [06:26.040 --> 06:27.480] And that's when we let them in. [06:27.580 --> 06:35.060] Part of what we're doing for semifinals is we're saying, this is what we expect a CRS to be able to do. [06:35.060 --> 06:41.040] All these challenges are designed in a way that a CRS can reason its way through these and possibly land these. [06:41.060 --> 06:50.920] Because after semifinals, all these CRS teams are going to get these challenges, they're understand how they work, and they're going to build their system to succeed.