[00:00.000 --> 00:01.980] Hello everyone, thanks for coming. [00:01.980 --> 00:05.060] I am very honored to be here to give a presentation. [00:05.300 --> 00:06.670] So today, our topic is... [00:11.700 --> 00:14.620] First of all, let me introduce my team. [00:14.620 --> 00:19.220] We are security engineers from Alibaba County, and I am Ziyang Lin. [00:20.280 --> 00:22.280] Then, let me introduce the agenda. [00:22.280 --> 00:25.280] First, I will introduce something about Kafka. [00:25.280 --> 00:29.280] Then, we will compare previous research with our new findings. [00:29.280 --> 00:33.700] Next, we will discuss the journey of hunting bugs in Kafka Ecology. [00:33.700 --> 00:38.740] After that, we will uncover the hidden vulnerabilities in Kafka broker. [00:38.760 --> 00:41.720] And finally, explore the insights and differences. [00:43.060 --> 00:46.060] Okay, let's officially begin our presentation. [00:47.320 --> 00:49.240] So, what is Kafka? [00:49.240 --> 01:08.880] According to the official documentation, Apache Kafka is an open-source distributed event streaming platform widely adapted by the enterprises for building high performance data pipelines, real-time analysis, data integration systems, and critical application architectures. [01:09.520 --> 01:17.800] At its core, Kafka has three main parts, producers, consumers, and the Kafka cluster. [01:17.800 --> 01:20.120] Consumers are like the data sources. [01:20.120 --> 01:22.720] They send messages into the system. [01:22.720 --> 01:29.680] Consumers read those messages and add on them, like analyzing or storing data. [01:29.880 --> 01:32.640] And the Kafka cluster is a backbone. [01:32.640 --> 01:39.840] It handles messages, storage, reputations, and ensures everything runs smoothly at scale. [01:40.900 --> 01:49.420] Inside the Kafka cluster, the functions are stripped into two main parts, the data prime and the control prime. [01:49.420 --> 01:56.520] The control prime is in charge of chain managing all the metadata, like topics, brokers, and reputations. [01:56.900 --> 02:01.160] Meanwhile, the data prime is where the real action happens. [02:01.160 --> 02:08.180] It's handled by the brokers, which are responsible for reading from and writing to Kafka topics. [02:08.680 --> 02:16.100] In the control prime of Kafka, there are two different implementations of the kiss-and-save protocol. [02:16.160 --> 02:22.100] The older one, based on Kafka, and the newer one, known as kraft-control. [02:23.320 --> 02:33.160] As for the data prime, current requests fall into two categories, producer requests and flash requests. [02:33.160 --> 02:39.180] A producer request is used to write a data to a specific topic. [02:39.180 --> 02:44.840] A flash request, on the other hand, is used to write data from Kafka topics. [02:45.460 --> 02:55.080] These operations are all limited with the topic, making it the central component in Kafka's architecture. [02:55.760 --> 02:59.700] In addition, Kafka has a powerful ecology. [02:59.700 --> 03:03.880] The Kafka ecology is built around several core components. [03:03.880 --> 03:11.920] Kafka core, Kafka systems, Kafka connect, rest procedure, schema registry, and case code. [03:13.340 --> 03:16.670] So, are there any security risks? [03:18.360 --> 03:19.920] That's a good question. [03:19.920 --> 03:27.420] Let's now look at the known findings and see how certain protections might be bypassed in repetition. [03:28.220 --> 03:41.480] There is a remote code execution ability in Kafka clients, identified at CVE-2023-25194, which can be supported in components such as Red and Kafka Connect. [03:42.320 --> 03:59.460] The key issue is that if an attacker can control the connection string used to connect to Kafka, they might be able to trigger gmdata injection, and that will lead all the way to remote code execution. [04:00.240 --> 04:03.180] Here is the proof of concept. [04:03.180 --> 04:11.780] The program acts as a Kafka client and uses an attacker-controlled connection string to connect the Kafka server. [04:12.260 --> 04:18.180] The payload contains an LDAP which is the key component in this export. [04:19.280 --> 04:23.780] As the program ends, it ends up triggering a gmdata lookup. [04:23.780 --> 04:30.740] Here on the right, you can clearly see the code stack leading to the injection point. [04:30.740 --> 04:33.240] This is the cover of the vulnerability. [04:34.140 --> 04:37.760] Let's focus on the context logging process. [04:37.760 --> 04:43.440] It's essential to understand how the export works. [04:44.160 --> 04:58.200] It will initialize, subject, and construct gmdl logging model and analyze with subject, callback handler options, and finally, we'll call the logging method. [04:58.760 --> 05:05.400] gmdl logging model logging calls the attempt authentication method. [05:05.400 --> 05:09.280] Then the lookup method of the initial method is called. [05:09.860 --> 05:17.220] Before we move on to the next slide, I would like to briefly introduce the lookup method here. [05:17.680 --> 05:29.480] It's a common thing like runtime.exec, and it will look up an untransitive address and leads to RCE. [05:30.800 --> 05:35.360] You can use a diagram to show how the attack process. [05:35.380 --> 05:39.480] First, the attacker set up an evil gmdl server. [05:39.480 --> 05:46.860] Second, the attacker constructs the evil connection stream and passes it to the Kafka client. [05:46.860 --> 06:00.840] Third, the Kafka client passes the connection stream, constructs the evil logging config, passes it to the logging context, and calls the logging method of the logging context. [06:00.840 --> 06:09.100] Then, the logging context analyzes the gmdl logging model to authenticate the user. [06:09.100 --> 06:17.280] Next, the gmdl logging model loads our evil gmdl server, and the server returns something evil payload. [06:17.280 --> 06:20.360] Finally, the server is taken over. [06:20.460 --> 06:23.750] The key point is the controllable logging config. [06:24.140 --> 06:34.160] Kafka client allows the users to control the logging config, so the user can use an evil logging config to achieve RCE. [06:36.760 --> 06:48.260] In version 3.4.1, the rector introduces a backlist mechanism, and by default, it includes the gmdl logging module. [06:48.820 --> 06:53.680] In other words, the gmdl logging module is disabled out of the box. [06:54.340 --> 07:00.920] If we run the poke again, we will see the program now slower and exception. [07:01.400 --> 07:07.000] The error message clearly says that the gmdl logging module is not allowed. [07:08.160 --> 07:12.300] We can use a diagram to show how the patch was. [07:12.300 --> 07:22.880] When the attacker constructs evil connection stream and passes it to the Kafka client, the Kafka client will check the logging config. [07:22.880 --> 07:32.360] If the logging config contains an evil logging module, memory-level gmdl logging module, the Kafka client will raise an exception. [07:33.700 --> 07:35.720] And can we bypass? [07:36.340 --> 07:45.440] After understanding both the vulnerability and how the patch was, we came up with an idea. [07:45.440 --> 07:51.460] What if we find another logging module that can be abused in the similar way? [07:51.900 --> 08:03.380] If we can identify a new malicious logging module, such as some much-liked gmdl logging module, we might be able to achieve RCE once again. [08:04.040 --> 08:09.740] So, what are the registrations on the logging modules that we are looking for? [08:11.480 --> 08:15.440] First, improvement logging module. [08:15.440 --> 08:18.900] Second, it exists in popular javalibs. [08:19.480 --> 08:24.630] Third, can trigger RCE attribute flywrite, attribute flyread. [08:26.220 --> 08:31.190] Thanks to this idea, we found several interesting logging modules. [08:31.520 --> 08:36.400] The first one is a proxy logging module provided by JBoss. [08:36.760 --> 08:44.180] As the name suggests, it delegates an authentication request to another agent or module. [08:44.180 --> 08:55.460] Specifically, in its analyze method, it constructs an agent based on the specified logging module name and then analyzes it. [08:55.460 --> 09:03.320] During the logging phase, the proxy logging module passes the authentication process to the agent. [09:03.560 --> 09:07.640] Now, you might have already guessed where I am going with this. [09:08.000 --> 09:12.640] Yes, we can use proxy logging module to bypass the backlist. [09:13.320 --> 09:14.700] Here is the prologue. [09:14.700 --> 09:22.060] We configure the proxy logging module and set its logging name to gmdl logging method. [09:23.360 --> 09:33.580] Even though it is on the backlist, when we run the prologue, you can see that the logging method of a gmdl logging module is actually invoked. [09:34.540 --> 09:43.120] If we check the EVO gmdl server, we can find that we have bypassed the backlist and achieved RCE again. [09:45.670 --> 09:48.210] Here is how the bypass was. [09:48.310 --> 09:59.290] Proxy logging module delegates to gmdl logging module, allowing us to bypass the backlist and tickle gmdl injection, leading to RCE. [10:01.150 --> 10:06.590] Another interesting state of logging modules is provided by WebSphere. [10:07.070 --> 10:19.150] Due to time constraints, I won't go into full details, but here is the proof of concept. [10:19.150 --> 10:27.110] Imagine a web server deployed on WebSphere that allows users to control Kafka connection stream. [10:27.710 --> 10:29.030] Could we take over? [10:29.810 --> 10:31.590] Of course we can. [10:31.770 --> 10:33.470] The idea is simple. [10:33.470 --> 10:38.610] We prepare a consumer login configuration file. [10:39.130 --> 10:45.070] Then we send the first payload to instruct the web server to use our login config. [10:45.590 --> 10:50.790] After that, we send a second payload, which will trigger an error. [10:51.410 --> 11:01.180] As a result, the server writes the error message now containing malicious content to the file we specified. [11:03.610 --> 11:08.910] Finally, we will get a web shell and achieve RCE again. [11:10.450 --> 11:15.670] In addition, there's an interesting logging module named the LDAP logging module. [11:15.750 --> 11:18.310] It's built into the JDK. [11:18.470 --> 11:22.550] This logging method calls a timer authentication method. [11:22.550 --> 11:30.830] When authenticating the user, the logging module will first obtain name and password via a callback handler. [11:31.910 --> 11:34.870] Then it will check whether the password is blank. [11:34.870 --> 11:44.410] If not blank, it will initialize the GMDI LDAP logged context, which is a trigger GMDI injection. [11:44.750 --> 11:54.810] Briefly, if we can find a callback handler that can provide a password, we can trigger GMDI injection and achieve RCE. [11:56.050 --> 12:02.630] So our goal is to find a callback handler for the LDAP logging module. [12:03.930 --> 12:09.770] There are three registrations on the callback handlers that we are looking for. [12:09.870 --> 12:15.590] First, you should be able to handle name callback and password callback. [12:15.590 --> 12:20.130] Otherwise, you will receive unsupportive callback exception. [12:20.410 --> 12:25.850] Second, you should be able to obtain a password which is not blank. [12:25.910 --> 12:35.790] Most importantly, it should be in permanent authenticated callback handler, which is an interface provided by Kafka. [12:35.790 --> 12:40.170] Otherwise, you will receive a cluster exception. [12:40.930 --> 12:52.630] To be honest, it is really hard to share all three requirements at the same time, especially the last one, which greatly limited the range. [12:53.870 --> 12:58.070] So which vendors implement the interfaces of Kafka? [12:59.210 --> 13:05.550] After some registration, we found that Confluent is a great candidate. [13:05.550 --> 13:14.610] Confluent is the creators of Kafka and the custodians of Kafka. [13:15.310 --> 13:19.170] And Confluent has their released versions. [13:20.850 --> 13:33.970] Confluent primarily offers two versions, the community versions of Kafka, known as cp-kafka, and the commercial version called cp-server. [13:34.890 --> 13:41.030] As shown here, the availability exists in cp-server but not in cp-kafka. [13:41.030 --> 13:53.390] We tested this on November 2024 on version 7.7.1 and it was confirmed to be support flow. [13:53.390 --> 13:59.630] These issues have been fixed in the newer versions. [14:00.430 --> 14:14.190] We discovered a callback handler named filebase-dynamic-blank-callback-handler in Confluent Kafka, which reads the username and password from the local file. [14:14.850 --> 14:18.370] Here is a simplified code of a file callback handler. [14:18.790 --> 14:22.870] We can control the file name, the keys of name, and password. [14:23.310 --> 14:38.630] For example, if there is a file named user.conf, the file contains one or more username, password, pairs, separative, private, and password. [14:40.750 --> 14:44.950] This callback handler means almost a resistance. [14:47.830 --> 14:52.970] But the file named user.conf is created by us. [14:52.970 --> 14:58.110] Can we find one more common one? [14:58.570 --> 15:04.170] Of course, the etc password file fits our needs perfectly. [15:04.170 --> 15:10.570] This means we no longer need to upload a consumer user.conf. [15:10.750 --> 15:17.230] We just need to set the file name to etc password and keep to m the existing user. [15:17.230 --> 15:18.830] For example, root. [15:19.890 --> 15:21.770] Here is the poke. [15:26.020 --> 15:35.030] In the end, we can use this callback handler to trigger jmdi injection and achieve RCE. [15:36.690 --> 15:43.450] As shown in the diagram, it shows how the entire attack processed. [15:43.710 --> 15:54.770] In the third step, we can use the file-based dynamic blanker callback handler to bypass the login config track. [15:55.050 --> 16:02.670] And this callback handler will obtain the username and password to the LDAP login module. [16:02.670 --> 16:12.330] And finally, the LDAP login module will recover an evil jmdi server and finally will be taken over. [16:15.710 --> 16:22.490] As you can see on this slide, we are now entering a new phase of our research. [16:22.750 --> 16:31.210] Not just exploiting a single vulnerability, but hunting for bugs around the entire Kafka ecologic. [16:32.010 --> 16:42.090] In the previous chapter, we successfully triggered the jmdi injection in the Kafka client of the conventional version of Kafka. [16:43.910 --> 16:52.890] Can this be implemented in the real system as CVE-2023-25194? [16:53.850 --> 16:57.030] Let's take it step by step. [16:57.030 --> 17:00.870] First, can Kafka Connect be exported? [17:01.710 --> 17:06.670] After our testing, the answer is yes, it can be exported. [17:06.790 --> 17:15.130] We can follow the official Confluent Kafka documentation to install and set up a Confluent platform. [17:16.090 --> 17:27.130] This proof-of-concept is exploitable CVE-2023-25194, operative in Apache Kafka Connect. [17:27.470 --> 17:31.710] This is our new plug from Confluent Kafka Connect. [17:31.870 --> 17:42.090] We just need to convert it into appropriate format and then we replace it with the previously mentioned bypass payload. [17:44.490 --> 17:50.110] And you will finally trigger jmdi injection and achieve RCE again. [17:52.540 --> 17:54.480] Something else? [17:55.160 --> 18:00.900] Yes, let's start a journey to take over Confluent ksqlDB server. [18:01.820 --> 18:05.780] When we deploy the Confluent platform, there are many components. [18:06.860 --> 18:12.520] In the website, we can see three of those components. [18:13.460 --> 18:18.620] When I try to use it, I find the ksqlDB is something like DBMS. [18:19.200 --> 18:25.660] Since DBMS also has a lot of features, just choose this to analyze. [18:26.380 --> 18:29.960] And then I read documents to learn about this. [18:31.220 --> 18:36.120] And when I read the documents, I find an interesting issue in the GitHub. [18:36.120 --> 18:40.100] It says the producer is closed firstly. [18:40.520 --> 18:44.740] Wait a moment, why does the producer exist here? [18:46.220 --> 18:51.000] And I just try to try it out in our local environment. [18:52.340 --> 18:55.840] We can see the producer configured in logs. [18:56.260 --> 18:58.660] What does this mean? [18:59.460 --> 19:04.600] Through the insert operation, ksqlDB can produce data. [19:06.160 --> 19:08.960] Can we modify the producer config? [19:11.060 --> 19:16.640] We can see that the configuration is obtained from the session config. [19:16.640 --> 19:19.000] So what is the session config? [19:19.860 --> 19:27.540] Since there is no other place to set here, let's try, let's give a simple try. [19:28.200 --> 19:32.660] Unexpectedly, we successfully modified the configuration. [19:35.380 --> 19:39.260] And then we modify it to use our POC. [19:39.900 --> 19:43.240] And we finally achieve an answer each year. [19:45.330 --> 19:48.150] Let's watch the video demo. [20:19.970 --> 20:22.870] Okay, let's do a brief summary. [20:23.010 --> 20:33.230] Using the bypass technology, we successfully bypass confluent Kafka broker and achieve RCE on ksqlDB. [20:34.650 --> 20:39.590] We have taken over the confluent products of multiple cloud vendors. [20:42.900 --> 20:55.620] So if we can, we can attack, control Kafka client's configuration, and using the bypass tactics, we can achieve RCE. [21:00.750 --> 21:06.110] So next, let's uncover hidden vulnerabilities in Kafka broker. [21:06.610 --> 21:13.110] And in previous section, we already have a basic understanding of the Kafka ecosystem. [21:13.150 --> 21:18.770] And it is clear that the Kafka broker is the core component of the Kafka ecosystem. [21:19.830 --> 21:24.390] And also, prior to this, Kafka broker had no RCE vulnerability. [21:24.470 --> 21:32.270] And so if someone can find a vulnerability in such a critical and unbreakable system, and it is definitely something worth celebrating. [21:32.910 --> 21:36.570] And so you may be curious about how I found this vulnerability. [21:36.650 --> 21:39.590] And to be honest, just by accident. [21:39.750 --> 21:44.710] So initially, I didn't ever think that I could achieve RCE in Kafka broker. [21:44.710 --> 21:52.770] And as mentioned earlier, I was actually focusing on finding other issues or potential bypass method in the Kafka client. [21:52.770 --> 21:58.750] And at that time, I was reading the official document, looking for some suspicious configuration. [21:59.530 --> 22:08.590] And when I read the document, I found a very interesting feature, and that is the listeners can be added or removed dynamically. [22:09.490 --> 22:16.750] And also, what's more, the JS configuration of the listener can also be set dynamically. [22:16.810 --> 22:21.530] So this means that the Kafka broker also supports JS. [22:22.270 --> 22:26.270] And here, let's take some time to introduce this interesting feature. [22:26.270 --> 22:29.130] So first, this is a very normal request. [22:29.130 --> 22:38.670] And the user just sends an add listener request to the Kafka broker, and the broker receives the request and adds a new listener. [22:38.670 --> 22:46.150] And after that, the other Kafka client can connect to this new listener for producing or consuming message. [22:46.450 --> 22:55.920] But if there is a hacker, and he can just send an evil request, and the broker will receive the add listener request and try to add a new listener. [22:55.920 --> 23:05.760] However, the server will also trigger the JS process, and will send the gender request to the evil gender server, and finally achieve RSE. [23:06.080 --> 23:09.520] So first, let's set up the exploit environment. [23:09.520 --> 23:15.660] And we can download the binary from the official website, and then run below command to start the Kafka server. [23:15.660 --> 23:18.900] And now, let's explore it step by step. [23:18.900 --> 23:24.360] So first, we can use the Kafka config tool to retrieve the broker's configuration. [23:24.360 --> 23:27.820] As you can see here, there are a lot of configurations. [23:27.820 --> 23:31.820] And here, we should pay special attention to the broker ID. [23:31.820 --> 23:33.280] And here it is one. [23:33.620 --> 23:38.300] And here, we only need to focus on the configurations related to listener. [23:38.300 --> 23:43.280] So we use grab command, and you can see that now it has two ports. [23:43.280 --> 23:49.980] The one is the standard 9092 port, and the protocol is blantest. [23:49.980 --> 23:54.300] And the other is managed by craft, and called controller listener. [23:54.300 --> 23:57.040] And the port is 9093. [23:57.080 --> 24:04.480] And then, we can use nested command to check the locally listener ports, and confirm the existence of these two ports. [24:05.580 --> 24:12.960] And so now, we will try to add a new listener, and we just copy the previous configuration, and add a new listener. [24:12.960 --> 24:15.840] Listen on the 9094 port. [24:15.840 --> 24:24.240] And as you can see that after we send this request, and the Kafka server will receive the request, and update its configuration. [24:24.240 --> 24:30.100] And we can use the nested command to check the newly added ports. [24:30.920 --> 24:36.880] And you may have noticed that the newly added listener configuration is SASL blantest. [24:36.880 --> 24:38.120] So what is that? [24:38.120 --> 24:42.540] And it is essentially the communication protocol for brokers. [24:42.540 --> 24:53.840] And there are different types, such as blantest, and it is encrypted, and SASL, and it is authenticate, and also SASL. [24:54.260 --> 24:56.560] SASL is the encrypted protocol. [24:57.660 --> 25:10.000] But in fact, after we execute the command to add a new listener, essentially when we specify the new listener, use the SASL protocol, and it will throw an exception on the broker side. [25:10.000 --> 25:19.560] And if we look carefully, the error message, we can see that it indicates that exists the absence of JAS related configuration. [25:19.560 --> 25:24.620] And this is because that Kafka's authentication mechanism is based on JAS. [25:24.620 --> 25:32.720] And therefore, when we add listeners that requires authentication, and the system will look for corresponding JAS configuration. [25:32.720 --> 25:38.940] And if we properly configure and we can trigger the JAS process and finally achieve RCE. [25:39.540 --> 25:43.540] But the question is, how can we set the evil JAS configuration? [25:44.260 --> 25:49.640] And after reviewing the Kafka document again, and I just found the answer. [25:49.640 --> 26:00.760] We can configure it through the configuration key, and you can see the key is listener name, listener name, and .saslmechanism.sasl.js.config. [26:01.060 --> 26:05.520] And so now, we need to set the corresponding configuration. [26:05.520 --> 26:24.260] And since by default, the SASL mechanism is JASS API, so we can name it in this way, listener.name.sasl.planetize, this is our listener name, and .gssapi, this is our SASL mechanism, and .sas.js.config. [26:24.280 --> 26:27.560] And so we re-succeed in one shoot. [26:28.500 --> 26:32.700] But it didn't work, and it's through a new exception. [26:32.980 --> 26:38.160] But not bad, since we at least successfully configured our JAS. [26:38.660 --> 26:47.040] But set not equal solution and code equal clues, and I just reviewed the code, and you can see that this is our error message. [26:47.040 --> 26:54.520] And so here, you can see we need to set either the JSS server name or the config service name. [26:54.520 --> 27:03.080] And here, I choose to set this config service name, and you can see that it get from our configuration, SASL Kerberos service name. [27:03.080 --> 27:05.660] So here, we need to add this parameter. [27:06.540 --> 27:11.300] So now, you can see that we just added this configuration key, and we can add a test. [27:11.460 --> 27:15.540] And finally, you can see that we receive the LDAP request. [27:15.540 --> 27:17.860] So yeah, we finally made it. [27:17.880 --> 27:19.880] And there exists another solution. [27:19.880 --> 27:26.940] So we can simply change our SASL mechanism to plan and don't forget to modify the name. [27:26.940 --> 27:29.920] And we can also receive the LDAP request. [27:29.920 --> 27:40.300] And since now, we can just utilize the server, send the GNDI request, and the only thing we need to do is deploying an evil GNDI server, and then waiting for the shell. [27:40.820 --> 27:49.260] So now, I have discovered the first-ever RCE vulnerability in CapCapBroker, and no one has thought of it in this way. [27:49.420 --> 27:54.360] And if you look carefully, and we just exploit it in our old version of CapCap. [27:54.360 --> 28:00.160] And so, at that time, I just wondered that this exploit also works in the latest version. [28:00.160 --> 28:09.960] And then, I just choose to exploit in the version 3.4.0, and the exact version fits the CVE-2023 and 25194. [28:09.960 --> 28:18.100] And but when I try to exploit, and but unfortunately, it just threw an exception, and just the same exception as the CapCap plan. [28:18.100 --> 28:20.840] And I was very confused. [28:20.840 --> 28:25.640] I don't know why the patch method related to the CapCap plan also affects CapCap server. [28:25.640 --> 28:29.420] And I reviewed the source code, and finally, I got the answer. [28:29.420 --> 28:36.460] And the reason is that you can say the CapCap plan uses the loadClientContext function to load the GIS configuration. [28:36.460 --> 28:41.420] And it will finally call the load function, which specifies we are client. [28:41.480 --> 28:52.180] And however, our CapCap server will also use the loadServerContext function, it will also call the load function in the end, and it will specify our type is server. [28:52.580 --> 28:58.240] But our CapCap patch method is adding a restriction in the load function. [28:58.240 --> 29:03.160] So this means that it will influence both the server side and the client side. [29:03.360 --> 29:08.900] So CapCap just accidentally fixed a crucial unknown server side vulnerability. [29:08.900 --> 29:10.300] So what the hell? [29:11.260 --> 29:20.200] But since the fixed way is the same as the client, and if you remember in the previous section, and we have a bypass method in the Confluent version. [29:20.300 --> 29:26.720] And so this means that we can bypass and achieve RSA in the latest version of Confluent CapCap broker. [29:27.260 --> 29:31.940] And so first, we also need to set up the environment and just follow the guide. [29:32.820 --> 29:37.020] And now we need to add a port mapping to help with our testing. [29:37.020 --> 29:44.040] And then we can use the CapCapConfig tool to quickly verify if our server runs normally. [29:44.280 --> 29:54.440] And here, we first just want to test with our previous code, just want to verify whether the CapCap, the Confluent broker has patched the vulnerability. [29:54.460 --> 30:04.480] And we started by fetching the current listener configuration, and this is now slightly different with the previous one, and then slightly modify the port. [30:04.480 --> 30:12.040] But however, it shows an exception, indicating the absence of the security protocol not defined. [30:12.800 --> 30:19.160] And I just find the reason, and the reason is that we missed this configuration. [30:19.160 --> 30:26.460] And you can see that the security protocol of each listeners must be defined in this configuration. [30:26.460 --> 30:37.420] And in our previous CapCap broker vulnerability, and since by default, it has already defined this map, and you can see it has the SASL plan test. [30:37.420 --> 30:40.440] So now, we will not encounter this error. [30:40.440 --> 30:50.460] But however, here, this is our now map, and you can see it only has controller, plan test, plan test holds, don't have the SASL plan test. [30:50.460 --> 30:52.540] So this is why we failed. [30:52.540 --> 30:54.860] So we need to add this parameter. [30:55.520 --> 31:03.620] And now you can see that we just modified the listener security protocol map, and we add this mapping. [31:03.620 --> 31:07.660] And now we can use the listeners SASL plan test. [31:07.660 --> 31:11.320] You can see that yes, and we just trigger the patch logic. [31:11.320 --> 31:16.600] So now, we need to just bypass it using our previous method. [31:16.620 --> 31:30.080] And just looking back at our previous method, and you can see that the key of the bypass method is the SASL.login.callback.handle.class parameter. [31:30.340 --> 31:36.220] But now, here is the question, how can we set the callback handler on the broker side? [31:36.220 --> 31:42.340] So after reviewing the official document again, and I discovered that it can also be configured dynamically. [31:42.340 --> 31:54.900] And the format of the key is similar to the key format used by the listener, and called listener.name.listener.name, listener .SASL.login.callback.handle.class. [31:54.900 --> 32:07.680] And now, we can just add in the callback handler, and the name is listener.name.SASL.plan test.plan.SASL.login.callback.handle.class. [32:07.680 --> 32:12.380] And we modify the JS configuration to our previous bypass method. [32:12.380 --> 32:16.940] And finally, we can also receive the GenDI request. [32:16.940 --> 32:20.460] So this means we successfully bypassed it. [32:20.900 --> 32:23.280] And now, here comes to the video. [32:24.020 --> 32:40.880] And so first, we can run our Evo GenDI server, and we get the listener's configuration, and we can run our... first we start the listening port, waiting for the share, and we run our exploit payload, and update the configuration, update configuration, [32:40.880 --> 32:43.980] and finally, we receive the share. [32:43.980 --> 32:50.600] And you can see that we are inside our container, and this is the Confluent Kafka broker. [32:52.920 --> 33:06.300] So after that, we promptly reported our findings to the Kafka official team, and finally, Kafka has acknowledged this vulnerability, and this is the first-ever RCE vulnerability affecting Kafka broker. [33:06.320 --> 33:14.480] And we also reported this vulnerability to Confluent, and we were rewarded the highest-ever bug bounty in Confluent. [33:15.260 --> 33:25.310] And also, here is the patch, and it is very easy to understand, and it just disabled GenDI login module and LDAP login module by default. [33:26.680 --> 33:30.000] And finally, it's some defense recommendation. [33:30.740 --> 33:37.000] So first, if you still use the affected version of Kafka, please update now. [33:37.000 --> 33:43.580] And then, authentication and authorization must be enabled to prevent unauthorized sites. [33:43.820 --> 33:55.320] And what's more, the components in the Kafka ecosystem are very important, and usually don't need to be exposed to public internet, and therefore, it is best not to expose them publicly. [33:56.120 --> 33:58.400] So, are there any questions? [33:59.960 --> 34:05.120] And thanks again for your listening, and if you have any questions, please feel free to contact us.