1 00:00:08,450 --> 00:00:09,830 Hi, everyone. 2 00:00:10,070 --> 00:00:12,670 Thank you very much for attending to our talk. 3 00:00:12,750 --> 00:00:22,090 We're going to present the new concept of shadow vulnerabilities and how we apply that in order to attack the most famous projects in the world. 4 00:00:22,090 --> 00:00:32,850 So, just before we begin, we're very happy to say that we are very proud to be part of this amazing community, the DEF CON community and the AppSec community for itself. 5 00:00:32,850 --> 00:00:36,470 And before we begin, just a really quick intro about ourselves. 6 00:00:36,470 --> 00:00:39,930 I'm the co-founder and CTO of Oligo Security. 7 00:00:39,930 --> 00:00:45,970 Like any other Israeli that you probably met, I'm ex-IDF technological unit. 8 00:00:45,970 --> 00:00:52,150 And in the last eight years, I've been hacking and breaking software at Checkpoint Research. 9 00:00:52,150 --> 00:00:56,910 And I'm super famous for being handsome, or at least I think. 10 00:00:57,650 --> 00:01:00,070 And along with me is an awesome guy. 11 00:01:00,070 --> 00:01:04,610 He's one of our most talented researchers at Oligo Research Team. 12 00:01:04,610 --> 00:01:09,210 He's, again, like any other Israeli, ex-IDF technological unit. 13 00:01:09,210 --> 00:01:12,370 And he's been breaking and building software for all of his life. 14 00:01:12,370 --> 00:01:15,650 And he's very famous for being the best scuba instructor. 15 00:01:15,650 --> 00:01:20,710 He likes to deep dive into coral reefs and into complex bugs and code. 16 00:01:21,170 --> 00:01:29,610 So, just as a really quick agenda, what we're going to talk about today is the new concept of shadow vulnerabilities, what actually it means. 17 00:01:29,610 --> 00:01:37,390 And then we're going to give an example of a shadow vulnerability that we discovered in the famous Snake.yml Java parser. 18 00:01:37,610 --> 00:01:49,410 Then we're going to explain the process that we did in order to scale it and find vulnerable projects that are vulnerable to this shadow vulnerability. 19 00:01:49,610 --> 00:01:57,990 And in the end, like any good DEF CON talk, we're going to exploit some stuff and talk about the impact and then sum it up with conclusion and key takeaways. 20 00:01:57,990 --> 00:02:13,370 So, just as you might be familiar from this concept from other industries, the shadow IT, that stands for the IT, the infrastructure that we don't monitor. 21 00:02:13,370 --> 00:02:16,050 And hence, we don't really know what's going on there. 22 00:02:16,050 --> 00:02:20,230 And hence, there's a bigger risk of the stuff that we aren't aware of them. 23 00:02:20,230 --> 00:02:28,150 And you can see that this analogy goes in different world, the API world, the API that we don't monitor. 24 00:02:28,150 --> 00:02:33,770 And hence, we don't know what's going on in there, the sensitive data, and of course, so on. 25 00:02:33,770 --> 00:02:42,830 And that's why we dubbed this concept of shadow vulnerability for exactly the same analogy, for risks that we aren't aware of them. 26 00:02:42,830 --> 00:02:46,470 And hence, they're even bigger to deal with and more riskier. 27 00:02:46,470 --> 00:02:55,530 And basically, shadow vulnerability stands for those type of vulnerabilities that actually doesn't get a CVE assigned to the issue. 28 00:02:55,530 --> 00:02:57,630 And why do these things happen? 29 00:02:57,630 --> 00:03:00,830 It can happen for several different reasons. 30 00:03:00,830 --> 00:03:11,720 Of course, the most obvious one is that it just takes a lot of time in order to classify or there's a dispute between the maintainer and the reporter. 31 00:03:11,720 --> 00:03:19,580 And it might take a lot of time or even result in a no-fix to get this issue a CVE. 32 00:03:19,860 --> 00:03:29,970 Again, there are a lot of examples in libraries and projects that just by not following the best security practices, you're actually opening a door for attacks. 33 00:03:30,240 --> 00:03:41,000 And of course, in the end, the maintainers that are responsible for the project are the ones that are deciding whether this issue is a real CVE or not. 34 00:03:41,000 --> 00:03:44,660 And they are the ones that will flag it as a fix or not. 35 00:03:44,660 --> 00:03:49,880 And of course, what we're going to show is that there are just libraries that are insecure by design. 36 00:03:49,880 --> 00:03:55,400 Meaning that just by misusing this library, you're prone to a vulnerability. 37 00:03:55,420 --> 00:04:13,480 And again, the fact that we don't have a CVE associated is what keeps us blind because all of the other tools or other approaches that we know, and how can we deal with it. 38 00:04:13,660 --> 00:04:26,520 So now, I'm going to pass it on to Awesome Guy, that will deep dive and explain about how we found this vulnerable code pattern inside Snake.yml and Guy can take it from here. 39 00:04:27,300 --> 00:04:28,760 Thank you, Guy. 40 00:04:31,420 --> 00:04:37,920 Okay, so as Guy said, we're here to show you the new concept of shadow vulnerabilities. 41 00:04:37,920 --> 00:04:45,060 And to do that, we will dive into a specific example of a shadow vulnerability that we have found in a library called Snake.yml. 42 00:04:45,340 --> 00:04:50,800 So Snake.yml is a famous open source library for parsing YAML files in Java. 43 00:04:50,960 --> 00:05:01,800 It is ranked the number one YAML parser in the Maven repository and it is itself a dependency for more than 4,000 other open source packages. 44 00:05:04,890 --> 00:05:07,450 And just to recap, this is a YAML file. 45 00:05:07,450 --> 00:05:12,310 It is pretty similar to a JSON file, but it is meant to be more readable to humans. 46 00:05:12,310 --> 00:05:15,750 So if you are a human and you find this readable, so good for you. 47 00:05:17,450 --> 00:05:22,410 So let's say you are a Java developer and you want to deserialize a YAML file. 48 00:05:22,530 --> 00:05:25,730 I am a Java developer myself sometimes. 49 00:05:26,350 --> 00:05:28,690 Not proud of it, but yes, I am. 50 00:05:29,690 --> 00:05:36,470 So what most developers will do, they will just try to find the first code snippet on the internet that works. 51 00:05:36,470 --> 00:05:41,190 So what they will do then, they will just find this snippet from the docs. 52 00:05:41,190 --> 00:05:43,570 They will copy and paste it to their code. 53 00:05:43,630 --> 00:05:47,190 They will try to run it and it works. 54 00:05:47,370 --> 00:05:53,350 At this point, what most developers will do is they will just close the docs and continue with their job. 55 00:05:53,570 --> 00:05:58,770 After all, there is no alert that you have done something bad. 56 00:06:00,310 --> 00:06:05,490 But if one digs a bit further into documentation, he will see this. 57 00:06:05,490 --> 00:06:10,870 Snake YAML allows you to construct a Java object of any type. 58 00:06:11,210 --> 00:06:13,310 So what is any type? 59 00:06:13,430 --> 00:06:25,610 Any type can be a string, an array, a hash map or a dictionary, and it can even be a custom Java object like this person class here. 60 00:06:25,610 --> 00:06:34,470 So trying to parse this payload will result in calling the constructor method for the person class. 61 00:06:35,270 --> 00:06:37,430 But wait, any type? 62 00:06:37,450 --> 00:06:41,450 Something like this should really make your hacker Spidey sense tingle. 63 00:06:42,110 --> 00:06:44,870 Can it even be a URL class loader? 64 00:06:45,050 --> 00:06:53,770 So just to recap, a URL class loader is a Java class that allows you to load the Java classes from remote servers. 65 00:06:53,770 --> 00:06:57,710 And basically it loads them into memory and it can also execute them. 66 00:06:58,590 --> 00:07:01,830 So apparently yes, this also works. 67 00:07:01,910 --> 00:07:05,430 I'm sorry for the lame emojis from Windows. 68 00:07:05,430 --> 00:07:06,910 They used to be better. 69 00:07:07,430 --> 00:07:09,950 But yes, this actually works. 70 00:07:09,950 --> 00:07:19,090 If you will try to parse this YAML using Snake YAML, it will result in code execution from a remote server. 71 00:07:19,090 --> 00:07:21,750 As you can see here, the attacker control server. 72 00:07:22,730 --> 00:07:34,530 And I guess you wouldn't expect that just by parsing a YAML file you will result in code execution which can lead to complete takeover of the running host. 73 00:07:35,530 --> 00:07:39,850 So we were not the only ones who thought this was unexpected. 74 00:07:39,950 --> 00:07:45,110 This issue was reported a long time ago to the Snake YAML maintainers. 75 00:07:45,930 --> 00:07:51,590 And as a reply, the maintainers said that, well, he doesn't see that as a problem. 76 00:07:51,590 --> 00:07:54,010 This is the intended behavior. 77 00:07:54,490 --> 00:07:58,770 Users who want to be safe can just use SafeConstructor. 78 00:07:59,990 --> 00:08:03,350 So let's pause for a second and explain what SafeConstructor is. 79 00:08:03,630 --> 00:08:14,010 So Snake YAML allows you to provide custom constructor types to configure the way that you control the YAML parsing. 80 00:08:14,010 --> 00:08:24,260 So for example, the SafeConstructor will only allow you to parse Java primitive types such as a bool, string, int, and so on. 81 00:08:24,550 --> 00:08:30,450 And if it sees an unfamiliar type, it will just throw an exception and crash. 82 00:08:32,070 --> 00:08:39,390 There is also the constructor type which will do exactly the same thing as the SafeConstructor. 83 00:08:39,390 --> 00:08:49,210 But instead of throwing an exception when it sees an unknown type, it will just try to parse it and to create any Java object that it can find in the class loader. 84 00:08:50,890 --> 00:09:03,570 And it's important to note that a part of the issue here is that the unsafe constructor, not the default constructor, is the default type for Snake YAML. 85 00:09:03,570 --> 00:09:11,350 So if you will just try to initialize a new YAML parser, you will automatically receive the constructor type. 86 00:09:11,430 --> 00:09:17,330 You need to opt-in if you want to use the SafeConstructor. 87 00:09:18,350 --> 00:09:29,710 And in order to make things even worse, constructor type inherits SafeConstructor, giving developers a false sense of safety when they're using the constructor type. 88 00:09:29,710 --> 00:09:43,830 I think this is the really root issue here, because developers who are using the unsafe constructor get a false sense of safety that they are using the SafeConstructor just because it inherits the SafeConstructor. 89 00:09:43,830 --> 00:09:48,430 But it actually overrides the safe behavior of the SafeConstructor. 90 00:09:50,470 --> 00:09:52,410 So is this a vulnerability? 91 00:09:52,690 --> 00:09:56,830 Well, you might as well say, yeah, this is not a vulnerability. 92 00:09:56,830 --> 00:10:00,570 It's up to the users to know how to use Snake YAML. 93 00:10:00,570 --> 00:10:07,890 The users need to read all the docs, and that's exactly the maintainer's point. 94 00:10:09,190 --> 00:10:18,890 But what we say is that this vulnerability is a source for so many other vulnerabilities that we have found that you might as well call this a vulnerability instead. 95 00:10:18,890 --> 00:10:30,910 It's important to note that the reason that we issue CVEs for open source libraries is to tell the users who are using these libraries that they have potential security issues. 96 00:10:30,910 --> 00:10:35,790 You need to notify the users that something that they are using can be dangerous. 97 00:10:36,650 --> 00:10:51,590 But because this did not get any CVE, we call this shadow vulnerability, since users who are using Snake YAML will not know that they are using a possible vulnerable function. 98 00:10:53,830 --> 00:11:05,290 But anyway, all of this doesn't matter, since, as the maintainer says, 100% of the applications who use Snake YAML don't use it to parse untrusted input. 99 00:11:06,310 --> 00:11:08,630 We decided to test this claim. 100 00:11:09,750 --> 00:11:14,410 To do that, we introduced a concept we call reverse fuzzing. 101 00:11:15,110 --> 00:11:23,090 Traditional fuzzing involves taking one target and shooting as many inputs at it, seeing when it breaks. 102 00:11:23,090 --> 00:11:35,210 Reverse fuzzing is the process when you take one vulnerable input and throw it at as many targets as you can, trying to find the one that breaks. 103 00:11:36,790 --> 00:11:45,030 The simplest way to start searching for targets in this process is to just search for the code pattern in GitHub. 104 00:11:46,110 --> 00:11:49,830 So we did do that, and we ended up with many results. 105 00:11:50,370 --> 00:11:55,030 And there were too many for us to just go through each and every one. 106 00:11:55,550 --> 00:11:59,070 So we had to lower the amount of false positives. 107 00:11:59,110 --> 00:12:04,710 We wanted to filter the targets by amount of stars to find only the prime targets. 108 00:12:04,710 --> 00:12:09,170 But sadly, the GitHub code search does not let you do that. 109 00:12:09,170 --> 00:12:18,070 So we had to write our own scripts to do this, and we had to run them for a couple of hours because of the rate limiting that the API has. 110 00:12:18,770 --> 00:12:24,250 But we did end up with a much lower number of results. 111 00:12:24,650 --> 00:12:34,470 But still, out of all these results, we still had a few false positives, because some of the projects that use Snake YAML only use it to create YAML files and not to parse them. 112 00:12:34,470 --> 00:12:38,070 And also some of them are using the safe constructor. 113 00:12:39,330 --> 00:12:43,050 To eliminate the noise here, we just used CodeQL. 114 00:12:43,050 --> 00:12:52,850 For those of you who are not familiar, CodeQL is a powerful code querying tool that can help you find patterns exactly such as this. 115 00:12:55,270 --> 00:13:00,030 We ended up filtering the results, and we found a few prime targets. 116 00:13:00,030 --> 00:13:02,670 I will focus on a few of them now. 117 00:13:02,670 --> 00:13:07,510 One project that we found vulnerable was Apache Cassandra. 118 00:13:09,750 --> 00:13:19,170 Apache Cassandra uses the Cassandra YAML file to configure the server. 119 00:13:19,730 --> 00:13:31,250 Using the vulnerability that we have found, we've discovered that if a malicious attacker can control the contents of this configuration file, he can actually execute code on the running machine. 120 00:13:34,290 --> 00:13:41,750 Since this is a configuration file, we wanted to test if we can find an interesting attack vector for this. 121 00:13:42,970 --> 00:13:49,030 Usually attackers don't get the access to just edit configuration files on the servers. 122 00:13:49,230 --> 00:14:06,470 But during our research, we did find that on the default container image for Cassandra and the default installation, the Cassandra YAML file will usually have write permissions from any user on the running host. 123 00:14:06,470 --> 00:14:15,310 So this can be leveraged to gain local privilege escalation on the machine running Apache Cassandra. 124 00:14:15,310 --> 00:14:26,510 In addition to this, during our research, we have found another vulnerability in Apache Cassandra that did allow us to modify files on the Cassandra server. 125 00:14:26,510 --> 00:14:36,350 And then we just chained these two vulnerabilities together to obtain persistent RCE capabilities on Apache Cassandra. 126 00:14:37,210 --> 00:14:50,230 Another research that we started doing was also to search for more targets that are using Cassandra as a service, such as Amazon that is providing Cassandra as a service. 127 00:14:50,550 --> 00:14:57,590 Most of them really did sanitize the inputs, but the attack vector can still be valid for more services. 128 00:14:59,390 --> 00:15:08,010 So we did try to report this vulnerability to the Apache team that maintained Cassandra. 129 00:15:08,010 --> 00:15:15,510 And they were super responsive and they immediately said that they do see the issue and they will issue a fix. 130 00:15:16,450 --> 00:15:33,930 But they did say that they don't consider this a vulnerability because of the attack vector, which actually created another set of vulnerability because there is an issue, but it is not being notified to the users that it exists. 131 00:15:35,130 --> 00:15:45,370 And sadly, after deploying the fix, we see that they fell into the same pitfall that we mentioned earlier. 132 00:15:45,370 --> 00:15:58,510 They thought because the constructor inherits a safe constructor, they thought that just by using the constructor they are safe because it inherits a safe constructor. 133 00:15:58,610 --> 00:16:03,270 But as we mentioned earlier, it overrides the safe behavior of the safe constructor. 134 00:16:04,430 --> 00:16:10,550 This is still left unfixed since it broke some tests and stuff. 135 00:16:11,550 --> 00:16:12,750 Yeah. 136 00:16:15,090 --> 00:16:26,890 So while we did found a local privilege escalation, and local privilege escalation is really cool, what we really wanted to find is remote code execution, which is way cooler. 137 00:16:27,530 --> 00:16:33,530 And to do that, we had to expand our research to find even more targets. 138 00:16:35,230 --> 00:16:48,610 We did had some issues with the old method since not all the targets are open source, so searching GitHub limited the amount of results that we can get. 139 00:16:48,950 --> 00:16:58,410 And in addition to that, running CodeQL is pretty difficult in scale because you need to have the CodeQL database for each and every project. 140 00:16:59,710 --> 00:17:06,570 And as the maintainer already said, most of the projects do use Snake.YAML only for configurations. 141 00:17:06,910 --> 00:17:20,410 And we wanted to find a method how we can filter out those projects who use Snake.YAML only for configuration and find the ones who are using Snake.YAML to parse YAML files during their actual runtime. 142 00:17:22,690 --> 00:17:28,790 To do that, we decided to move from searching GitHub to searching for images in Docker Hub. 143 00:17:28,970 --> 00:17:45,570 We wanted to trace them in a runtime, and we wanted to plot the amount of calls that they do to parsing YAML files in order to find the ones who are not only using it in the beginning. 144 00:17:45,570 --> 00:17:58,730 Because what we understand is that when you use it for configuration, you usually only use it once when you start a container, and then you don't have to parse any YAML file. 145 00:18:00,570 --> 00:18:03,370 So there are a couple of ways of doing that. 146 00:18:03,370 --> 00:18:05,150 We wanted to do that in scale. 147 00:18:05,150 --> 00:18:08,410 And luckily, this is exactly what we at Oligo do. 148 00:18:08,410 --> 00:18:17,190 We use eBPF technology to observe the runtime behaviors of open source libraries down to the function level, and we do do that at scale. 149 00:18:17,190 --> 00:18:26,250 So using the data that we had, we were able to plot these graphs on many popular projects. 150 00:18:26,810 --> 00:18:33,630 So this is an example for a project that was using Snake.YAML actually for configuration only. 151 00:18:33,630 --> 00:18:41,850 So you can see that over time, you only see one peak at the beginning, and then there are no more usages. 152 00:18:43,550 --> 00:18:50,690 And contrary to this, this is a project that actually used it to parse YAML files on the fly. 153 00:18:51,150 --> 00:18:54,970 So these were actually interesting targets. 154 00:18:55,830 --> 00:18:59,710 So using this method, we were able to find more targets. 155 00:18:59,710 --> 00:19:04,630 Some of them are still under responsible disclosure, so we can't explain the bugs we found there. 156 00:19:04,890 --> 00:19:11,570 But one of the targets that we did find, and we can show you here since it already got fixed, is Confluence. 157 00:19:11,570 --> 00:19:30,670 So just in short, Confluence is using another open source library which is called Liquibase that had this HTTP client code, which was communicating with an API that was able to communicate and get YAML back from the API. 158 00:19:31,850 --> 00:19:38,050 So you can see here that it is not using the safe constructor, it is using the default and unsafe constructor. 159 00:19:39,430 --> 00:19:53,150 So you can see here that once you issue a GET request, the output from the connection is being moved straight into the loaded function. 160 00:19:54,510 --> 00:20:05,670 So this issue was fixed in Confluence server on the latest version, but it was not fixed as a security update, it was just pushed as a regular update. 161 00:20:08,050 --> 00:20:12,010 And there were many more projects that we found vulnerable to this. 162 00:20:12,150 --> 00:20:16,550 This vulnerability was kind of like a goldmine for us. 163 00:20:16,550 --> 00:20:20,930 Everywhere we looked, we found flawed usages of this library. 164 00:20:22,930 --> 00:20:30,370 And to continue and sum up and give the conclusions, I will give the talk back to Gal. 165 00:20:30,750 --> 00:20:34,050 Thank you, Guy, for being that awesome. 166 00:20:34,050 --> 00:20:35,410 Okay, cool. 167 00:20:35,410 --> 00:20:36,830 So let's sum it up. 168 00:20:36,830 --> 00:20:44,810 We actually were able to prove that vulnerability is not a vulnerability, but we were able to hack one of the most famous projects in the world. 169 00:20:44,810 --> 00:21:01,690 We started with an LPE, then we did a post-auth RCE, and actually we did find a no-auth RCE, meaning that we have a huge list of IPs that are using this vulnerable code pattern that we can now take down. 170 00:21:01,690 --> 00:21:07,790 This is still under responsible disclosure, but please stay tuned as we're going to publish it as soon as we can. 171 00:21:08,530 --> 00:21:11,030 But now, let's see what happened. 172 00:21:11,070 --> 00:21:29,690 While we did our research, actually Google stepped in, and in one of the most famous tools, OSS Fuzz, which continuously fuzzes the most famous open source projects in the world for security vulnerabilities, and Snake YAML is one of them, they did see that this issue occurs. 173 00:21:29,690 --> 00:21:31,910 So they opened an issue. 174 00:21:32,150 --> 00:21:38,730 And of course, we already know our maintainer that just changed the status to won't fix. 175 00:21:39,250 --> 00:21:43,710 But then Google said, look, this is an RCE. 176 00:21:43,710 --> 00:21:45,370 We can actually run code. 177 00:21:45,370 --> 00:21:46,930 This is very severe. 178 00:21:46,930 --> 00:21:48,750 We don't agree with you. 179 00:21:48,750 --> 00:21:51,750 There was a dispute, and Google said, look, we are Google. 180 00:21:51,750 --> 00:21:53,090 We are a CNA. 181 00:21:53,410 --> 00:21:54,610 We're not going to ask you. 182 00:21:54,610 --> 00:21:56,090 We're going to issue a CVE. 183 00:21:56,630 --> 00:22:04,090 So in a return to that, the maintainer said, good, if you're Google and you can issue a CVE, you can come up with a fix to this problem. 184 00:22:04,090 --> 00:22:05,410 I'm not going to do it. 185 00:22:05,410 --> 00:22:12,330 And this is how we ended up getting Snake YAML 2.0, which actually introduced breaking changes. 186 00:22:12,330 --> 00:22:21,070 It actually breaks the concept of deserializing structs and only lets you deserialize the primitive types. 187 00:22:21,070 --> 00:22:38,890 And by that, we still think that the world will remain vulnerable because all of the other applications that are leveraging Snake YAML for much more complex and extended usages besides the default types will have to use the vulnerable part. 188 00:22:39,790 --> 00:22:50,630 And now when you actually get to the official documentation of Snake YAML, you can see right away the maintainer added, if you are here because of a CVE, it's probably a false positive. 189 00:22:50,630 --> 00:22:59,650 And again, as Guy mentioned, we usually trust the documentation that we read, and this is exactly the root cause of those shared vulnerabilities. 190 00:22:59,850 --> 00:23:08,870 Because without knowing all of that, I would just get into the documentation and see that there's a false positive or say, okay, there isn't a risk. 191 00:23:09,150 --> 00:23:13,890 And of course, other projects saw this and followed. 192 00:23:13,890 --> 00:23:19,270 And for example, Apache Cassandra, we did see they tried to fix it but couldn't fix it. 193 00:23:19,270 --> 00:23:23,430 After the CVE applied, they just suppressed it and ignored it. 194 00:23:23,430 --> 00:23:23,730 Why? 195 00:23:23,730 --> 00:23:27,510 Because it would break in the builds of people and people ignored it. 196 00:23:27,510 --> 00:23:32,590 And again, they followed the maintainer's suggestion and just suppressed the vulnerability. 197 00:23:32,650 --> 00:23:34,210 So it's still out there. 198 00:23:34,750 --> 00:23:39,030 So this actually raises an interesting ethical question. 199 00:23:39,030 --> 00:23:41,670 Who owns the responsibility? 200 00:23:41,670 --> 00:23:55,090 Is it the library maintainer that has been thankfully giving the world an amazing open source that let us build amazing tools, but now he needs to change the way that his code works just for others to use it safely? 201 00:23:55,150 --> 00:23:57,470 Or is it the project maintainer? 202 00:23:57,470 --> 00:23:59,630 They have thousands of open sources. 203 00:23:59,630 --> 00:24:03,330 They have to be responsible for each and every one's security? 204 00:24:03,330 --> 00:24:18,810 Or is it just the innocent users that just want to code and use a DB or use an open source and don't know or think about the consequences or the problems they inherit when they use it? 205 00:24:18,810 --> 00:24:26,710 Or just the fact that they now have to be a Java security expert in order to just use a YAML parser? 206 00:24:28,410 --> 00:24:32,370 And as you can see, this is just the tip of the iceberg. 207 00:24:32,370 --> 00:24:36,510 This example of Snake YAML is just one example of a shadow vulnerability. 208 00:24:36,550 --> 00:24:39,090 But there are many more out there. 209 00:24:39,090 --> 00:24:46,950 You can see the same documentation that are repeating itself from each and every example, whether it's like Lodash or Jackson. 210 00:24:46,950 --> 00:24:51,330 And you can see how the maintainers on one hand say, OK, this is not a problem. 211 00:24:51,330 --> 00:24:58,210 But on the other hand, you should be aware and be following the guidelines in order to use it safely. 212 00:24:58,210 --> 00:25:07,430 And we do see those stuff coming over and over in different use cases and different libraries that everyone is using. 213 00:25:07,770 --> 00:25:09,970 And there are many more out there. 214 00:25:09,970 --> 00:25:12,050 And that's why we urge you guys. 215 00:25:12,050 --> 00:25:27,270 We're going to publish a list of all of the shadow vulnerabilities, but we urge you to also participate and add more and more examples because we think that it should be a security effort of all of the community in order to fix it. 216 00:25:27,270 --> 00:25:31,610 And again, like any good DEF CON talk, we have to exploit something. 217 00:25:31,610 --> 00:25:42,110 So I'm going to pass it on to Awesome Guy, that will show you an exploitation on Apache Cassandra with this shadow vulnerability. 218 00:25:44,830 --> 00:25:50,830 So we don't trust the demo gods, so we had a video. 219 00:25:51,510 --> 00:25:56,570 So you can see on the lower terminal, this is the Apache Cassandra server. 220 00:25:56,570 --> 00:25:59,250 On the top one, it's the attacker. 221 00:26:01,370 --> 00:26:06,170 We have used two vulnerabilities that were chained together. 222 00:26:06,430 --> 00:26:10,470 And once we reset the server, we can see that the malicious payload is being loaded. 223 00:26:11,070 --> 00:26:12,790 And we will get a connection. 224 00:26:13,410 --> 00:26:16,250 And we're now running as the Cassandra user. 225 00:26:20,550 --> 00:26:22,270 Great, so... 226 00:26:22,270 --> 00:26:24,330 You can applaud now. 227 00:26:32,800 --> 00:26:34,000 Great. 228 00:26:34,160 --> 00:26:37,000 Thank you, Guy, again, for being so awesome. 229 00:26:38,040 --> 00:26:42,980 So now, let's conclude what we have been seeing up until now. 230 00:26:43,120 --> 00:26:46,740 Open source, just like Guy, is awesome. 231 00:26:47,040 --> 00:26:52,800 And this is what enables us to build amazing applications and do it. 232 00:26:52,800 --> 00:27:00,300 And on the contrary, because it's everywhere, that's why it's very important to secure those open source packages. 233 00:27:00,300 --> 00:27:09,380 And I think people even talk about Lock4Shell, or Spring4Shell, or everything with Shell, just keep recurring and showing us how important it is. 234 00:27:09,380 --> 00:27:21,460 And that's why we think, by showing here the concept of shadow vulnerabilities, that the industry has to realize that fixing by a CVE cannot be the only focus. 235 00:27:21,460 --> 00:27:32,440 There are other problems out there, and that's why shadow vulnerabilities and these libraries that have this type of being insecure by design, it's just, again, the tip of the iceberg. 236 00:27:32,440 --> 00:27:36,520 And that's why this shadow concept should be called out. 237 00:27:36,520 --> 00:27:44,060 Because you saw that even if we have a fix, or even if we have a CVE, a lot of the time it doesn't really solve the real issue. 238 00:27:44,060 --> 00:27:48,260 And that's why we don't think it's someone's responsibility. 239 00:27:48,260 --> 00:28:02,940 We think it's everyone's responsibility, because we are all using, knowingly or unknowingly, in these applications that are built upon this amazing open source project, and that's why we think it should be a community effort. 240 00:28:02,940 --> 00:28:06,340 And that's why we need your help in order to do it. 241 00:28:06,420 --> 00:28:10,300 So, again, thank you very much for attending this talk. 242 00:28:10,300 --> 00:28:19,780 Please stay tuned as we're going to publish more and more examples of shadow vulnerabilities, and we're going to publish the new project that we hacked. 243 00:28:19,780 --> 00:28:27,320 And, of course, if you have any questions, you can reach out via LinkedIn, or Twitter, or X, or whatever. 244 00:28:27,320 --> 00:28:29,880 Elon will decide to call it tomorrow morning. 245 00:28:29,960 --> 00:28:33,480 We will be there and be happy to answer any questions that you guys have. 246 00:28:33,480 --> 00:28:34,480 Thank you. 247 00:28:40,860 --> 00:28:42,280 Any questions? 248 00:28:45,080 --> 00:28:47,020 Where do I like to dive? 249 00:28:47,560 --> 00:28:50,420 I'm from Israel, so I mainly dive in Eilat. 250 00:28:50,480 --> 00:28:57,160 But I've been all over the world, like wherever I get to and there's water, so I try to dive there. 251 00:28:57,660 --> 00:28:59,600 And to memory corruptions. 252 00:29:02,100 --> 00:29:05,020 Did Cassandra fix the other bug that you found? 253 00:29:05,360 --> 00:29:08,100 Yeah, we found several bugs in Cassandra. 254 00:29:08,100 --> 00:29:12,420 One of them was fixed and issued a CVE by itself, you can see. 255 00:29:12,420 --> 00:29:26,220 It was a command injection, so it actually lets you run code, but we used it in this research in order to create an arbitrary file primitive in order to actually exploit the shadow vulnerability of Snake.YAML. 256 00:29:26,220 --> 00:29:29,380 But the shadow vulnerability of Snake.YAML is still unfixed. 257 00:29:30,900 --> 00:29:31,660 Yes. 258 00:29:35,300 --> 00:29:36,260 It's a good question. 259 00:29:36,260 --> 00:29:39,040 You can find our blog in the Oligo official website. 260 00:29:39,040 --> 00:29:42,020 We're going to publish everything, like the research and how we did it. 261 00:29:42,020 --> 00:29:46,480 We're going to publish some tools and the way we did and scaled the research. 262 00:29:46,480 --> 00:29:51,540 And of course, we're going to publish more and more examples of shadow vulnerabilities, so you can see it over there. 263 00:29:52,380 --> 00:29:53,160 Yes. 264 00:30:03,300 --> 00:30:06,380 Yeah, so that is a good question. 265 00:30:06,380 --> 00:30:09,600 How do you find more shadow vulnerabilities in more libraries? 266 00:30:09,860 --> 00:30:17,080 So what we wanted to do to do that is just focus on libraries that are actually doing dangerous stuff. 267 00:30:17,080 --> 00:30:21,180 This serialization is something that is known to be really dangerous. 268 00:30:22,360 --> 00:30:41,840 We didn't come up with a smart way to do this at scale, but it's basically focusing on the libraries that you know that can be dangerous and trying to find these patterns of documentation that says, it's your responsibility to do that and that in order to be secure. 269 00:30:43,120 --> 00:30:44,760 Here comes the payload. 270 00:30:46,200 --> 00:30:47,140 What, what? 271 00:30:47,580 --> 00:30:50,260 The payload? 272 00:30:50,260 --> 00:30:52,140 What payload we used? 273 00:30:52,240 --> 00:30:54,940 It was on the previous slide. 274 00:30:55,240 --> 00:31:05,060 It's basically the URL class loader that will initiate a connection to our controlled server that will serve the malicious jar that will be executed. 275 00:31:06,000 --> 00:31:07,800 This one, yeah. 276 00:31:10,640 --> 00:31:12,120 More questions? 277 00:31:12,900 --> 00:31:13,700 Yeah. 278 00:31:21,500 --> 00:31:26,920 So yes, if we are planning to release an open source tool to find this. 279 00:31:26,980 --> 00:31:28,280 So currently not. 280 00:31:28,280 --> 00:31:31,240 It is based on the data that we have collected. 281 00:31:31,600 --> 00:31:40,520 But we can suggest that there is another way to search for this kind of issues using a dynamic instrumentation. 282 00:31:40,620 --> 00:31:45,060 Like you can do the same thing with Frida, just in a lesser scale. 283 00:31:46,480 --> 00:31:47,140 Yeah. 284 00:31:49,060 --> 00:31:50,240 You only have what? 285 00:31:53,700 --> 00:31:55,480 Yeah, yeah. 286 00:31:58,510 --> 00:31:59,250 Cool. 287 00:31:59,250 --> 00:32:00,450 Thank you very much guys. 288 00:32:00,450 --> 00:32:01,590 Thank you for attending. 289 00:32:01,590 --> 00:32:07,110 It was a pleasure to be here and again, hit us up and we'd love to answer anything. 290 00:32:07,110 --> 00:32:07,950 Thank you very much.