So I'm happy to introduce Ronnie Carta and talk about practical exploitation in denial of service and bug bounties. Ronnie, thanks. Hi everyone, I'm really happy to be there today. This is the first ever Bug Bounty Village and it's a true honor to do the first talk ever, well with some technical difficulties of not having an HDMI cable, but no worries, we are there now. So the talk is about practical exploitation of denial of service in bug bounty program. So first of all, my name is Ronnie, I go by the nickname Lupin, I'm the co-founder of Lupin Homes, we are a security research and development company, and I'm coming from the best city in the world, Grenoble, it's in the French Alps, a lot of skiing, beautiful place. I love denial of service. I love denial of service because you can actually try to slow down or considerably take down an entire product environment. And so the goal of denial of service in bug bounties is to basically try to find the most business impact. Imagine like a website not having traffic anymore, that will be a huge bummer for the company. And so denial of service, and like the difference between denial of service and DDoS is basically denial of service is from one single machine, but DDoS, the additional D is for distributed, of course, so it means that we require a series of different machines to be able to take down our target. This is basically all about the resource that you have on your machine against the resources that you have on your target. So if the attacker has more resources on its machine, then it can basically take down the target, but in a DDoS, you might have amplification or multiplicating factor in order to be able to completely take down the machine. So that's what we're going to talk about today. A little bit of definition debates here. Basically, there is a whole debate about denial of service being an availability or integrity impact. So basically, the impact of like the DDoS is not a vulnerability class, but more like an impact, I will say. And we can say that deleting a resource is in a sense denied, but the CVSS documentation says that the deletion of a resource is integrity and not availability at all. So that whole blob of documentation, if you want to read it, is what the CVSS says. So basically, it says that availability is the performance and operation of the service itself and not the availability of the data. For those who have been doing bug bounty hunting, you know that you are debating a lot about CVSS and you need to read all the documentation. So be mindful of that if you want to argue with CVSS programs. So when DDoS is relevant? Basically, it is relevant for every feature where there is a strong dependency. This means that it's a feature that a lot of users are going to use or maybe there's a dependency on the machines that you are targeting. For instance, if you can take that entire EKS cluster in production, well, that might be super impactful. But yeah, I know what you are going to say. DDoS is totally out of scope. Actually, on HackerOne default templates for program, it's marked as out of scope by default. And there's a reason for that, because companies in usual do not like DDoS. Not because of the low impact of security, but because actually, if you let all your bug hunters completely take down your website, it might be a huge problem for them. So basically, it's not because DDoS has low impact, but because sometimes that's too much impact. But we can test DDoS responsibly and actually make a few bucks with it. In order to test DDoS responsibly, you need to find the gadget of the problem to fully exploit it. So this means that, for instance, if you have a request that takes more than 10 seconds, this may be a cool gadget in order to take down the entire environment. But you do not need to actually take it down to just see that one request takes more than 10 seconds. And also, if you are allowed, you can still try to take down the non-production environment, so staging, integration, sandbox, et cetera. But if there is something to know about this entire talk, please, always ask the programs before even searching for their services. Because programs need to be aware of what kind of tests you are going to do in order for them to monitor. And if everything is going to fire, they need to identify that you are the one doing the test and just call you and say, hey, I think there is a problem here. And DDoS service is all about program's maturity, right? Some companies do not care about, you know, services risk, because they, I don't know, they don't have, like, user traffic or stuff like that. But actually, some programs will allow you to completely take down their product environment. And I'm serious. They are completely allowing to take down their dub-dub-dub environment. So, this is amazing. Before starting going on all the different techniques, I need to thanks Rezo, Zack, Ixo, Snorlax, Befed, BonsoirD, and DoomerHunter. Those are amazing hunters. We did all this research together on the span of two years. So, I needed to quickly show that to them. Amazing people to follow, too. Okay. Let's start with a quick vulnerability. This one is really fun. So, one evening, we were hacking with Snorlax. And there was this application that was sending service to send chat messages. And so, with Snorlax, when we're hunting together, we have this game where the goal is to basically try to XSS the other one. So, we were contacting one another, sending messages, and we're, like, the first that got XSS wins it. But at some point, we were doing a test, and my page completely goes blank. And I was, like, maybe I lost internet. But I was still hearing Snorlax on Discord, and I was, like, there's something weird, right? Until he tells me, hey, Lupin, is your page blank, too? So, those are the payloads that we sent at this moment. So, try to think about which one did manage to make the page entirely blank. Do you have it? Yeah. This is the one. And so, to understand why this payload made the page blank, you need to understand that the service was using a library called sanitize HTML. So, basically, it's some kind of DOM purify that will try to sanitize every XSS that you are going to send. And this library actually tried to sanitize every href attribute in your frontend. So, for instance, if you have a JavaScript schema, it will try to remove it from the href. However, in this payload, where is the href? There's a problem here. And so, the library actually called the function href and take an argument href and do a dot replace on it. However, when it's undefined, it completely crashed the entire frontend. Okay. That was a pretty cool one. And so, for every kind of client-side service, I would say that the impact is not that huge. It's all depending on the target. Overall, with this specific technique of malformed data, HTML, we did $350 bounty. But that's just the start. If you want to actually search for more malformed data in the frontend, you can... there was a cool vulnerability where we had, like, a post request and we could send any invalid JSON. That was validated by the backend, but it was a completely malformed JSON. And so, when the frontend was using it, it will also completely crash. And so, the malformed JSON was really simple. It was using two back quotes at the same time. Two escape back quotes. And so, it was somehow accepted by the backend. But when you were doing a JSON.parse on the frontend, it would completely crash. And so, this technique actually worked on TikTok and we got paid for that. So, that was a cool one. But there's some cooler techniques now. Okay. So, that guy here is one of the biggest problems for all developers. The N plus one problem. Basically, this technique... I actually knew about it because my brother, who is a backend developer, told me about... like, we were talking about services and how I was trying to exploit them. And he was like, do you know what's an N plus one problem? And I was like, no. And he told me that, basically, an N plus one problem was a database when one query leads to N additional queries, causing inefficient data retrieval. So, basically, an attacker can exploit N plus one queries to trigger numerous calls to the database and potentially overwhelm the system. And the impact of an N plus one query often scales with the data size. So, the more data that you have, the more DOS capability you can have on your target. So, how do you detect an N plus one query? Basically, you find an endpoint that creates data in the API. You find a request that gets all the data at the same time. So, usually a get request. And if there is pagination, try to increase the limit. For instance, you have some request that is page equal 10. Try to put 10,000 and see what's going to happen. And if the more data you add in the backend, the more time delay there is in the response, then you have an N plus one error. I also created a BURP extension that I'm going to release right after this talk. That's called Tridos. And basically, it's going to search in your proxy passively all the requests that takes more than X seconds, where X is a threshold that you set yourself. I personally put it to three seconds. And this is a good way to actually identify queries that might take a lot of time on the backend and that you can actually use for your exploitation. So, let's take an example of an N plus one problem. There was an app that could accept to get as many objects as we wanted. The JSON blob was something like that, where you had a list of users. And then on each user, you can create... on each array of the list, you can create a new user. And then there was another sub object with another array with new objects. So, that's basically an N plus one problem, when one request can create as many sub objects as you want. And so, how did we exploit that? Well, we sent the request to create all those objects and we created approximately 10,000 objects in the backend. And then our get request to retrieve all the objects took 10 seconds per request. So, that's a really, really good sign that you have an N plus one problem. We took that request, we put it into an intruder on Burp, and we set it with no payloads, concurrent requests, and we basically set it to run indefinitely. And the result... complete crash. Overall, this technique, not only single-vulnerability, but overall, we did 46,000 dollars in bounty. There was an LHE this week, so we can add 10,000 more to this slide. I think that 30k of this was Snorlax alone, because he's so good at just taking one technique and spreading it. I think he did 15k per vulnerability, so in two vulnerabilities, 30k. That guy is insane. Okay, let's talk about network-based denial of services. Have you ever been in that situation where you have a blind SSRF and you don't know what to do with it? And that you are desperate for a technique that will help you transform this sometimes informative vulnerability into a higher crit? Well, we have a technique for you. Basically, do you guys know something called, like, slow low-risk attack? Well, basically, we are going to try to do something really similar where we are going to try to make the bucket hang on the network level as much as possible. We can do it with several ways. You can make your server hang and just time out after 10 seconds, or you can create a request loop. So what do I mean by request loop? Well, you have your server that has a path that will reject 301 on path 2, and then the path 2 will reject again on path 1, so we create, like, an infinite loop of redirects. And the goal is to make the server time out as much as possible. So we have that kind of schema happening. And the goal of that technique is actually to fill all the available sockets of the server so it couldn't actually treat the next request. Until we have this bottleneck happening and there is no available sockets anymore. For this technique, I think it was on two separate vulnerabilities, we made 15k. So it's actually a great technique to transform blind SSRF into a critical. Again, every time that we take down product environments, we always ask for the programs. Really be mindful of that. But that's a pretty cool one if you're ever stuck. Okay. Let's go to sign-in denial of services. This one was really cool because we had a target with an employee web page. And basically when we see an employee web page, we try password stuffing or brute forcing, we see proclamation, injection, et cetera, et cetera. But why this target was particularly interesting for us is it was a target with more than 1,000 employees, there was no rate limiting on the login, no 2FA at all, and they were using first name dot last name for the user. So we could pull everything on LinkedIn and we had a great world list to work with. So what do we do? We managed to automate the attack, no rate limiting at all, and then no login found. Wait. No login found? But we still got a crit. Okay. Guess what protection they implemented for brute forcing attack? Is it A, delay the next attempt? B, capture? C, ban the IP address? Or D, ban the employee account? There is actual documentation on the internet that says that this is the right thing to do. So, yeah. What happened? 600 accounts locked. They had integration with the ID, so active directory completely down, no access to the VPN anymore. Completely take down of the internet environment. So funny. I would say that the impact of this technique is actually like a three out of five, but it's because the presence in the world is also reduced. I don't think that a lot of companies are doing that anymore. But pretty cool bug. Okay. Let's go to another type of DOS. Disconception DOS. So, this story is quite cool. It started because I read this asset node research. If you guys don't know asset nodes, you should read every blog post of them. It's amazing. And there was this blog post from 2019 called discovering a zero day and getting code execution on modular AWS network. So, how did asset node achieve that? Basically, there was an instance called web page test. And it was completely open source. So, they read the code. And there was like this piece of code where you could extract a zip file that was given by the user. And then with some kind of quick race condition, you could actually call a PHP file. And so, for this race condition to work, you needed to set up an intruder and just run as many requests as possible. What happened when I tried it? The backend didn't have enough inodes to take the charge of requests. So, every time it was creating a zip file and trying to extract it, it was allocating inodes. And so, the disk was full in like maybe two, three seconds. So, yeah. I took down the instance. And I thought that this instance wasn't used by anyone until someone told me, hey, all the pipelines are down. And so, every time they were running a pipeline, they were going to that instance. That's cool. So, total crash of the server. No access to the disk. They needed to clean everything, wipe out, restart the server. That was a cool one. I would say that, again, the impact is reduced because of the presence in the world. So, it's a three out of five. Cache poisoning. That's a good one. So, one day, we were developing a new feature for our tool in research mode. Research mode for us is when we want to test an idea and spread it to see if it should be incorporated into our tool for our customers. And so, the idea was, what if registries, when you install a dependency and have two factories, used by the clients were vulnerable to cache poisoning in our service? It's a good thing to try. So, we developed a proof concept. And on the first run, we managed to get a hit on registry.npmjs.org. And I was like, no. That didn't happen. Like, no way. So, we thought it was a fault positive. And lo and behold, it worked. So, what is CPDOS? CPDOS is a web attack technique described by Paul Truger. Paul Truger actually made it really, really famous. Again, if you didn't read in your life a James Kettle research, you should do it. This guy is amazing. Always breaking the internet. And basically, it's in the web caching system in order to deliver malicious content to the users. So, the methodology is to first understand how the cache keys of our target is working. And then understand how the output of the request is linked to your HTTP input. So, for instance, is the cache key inside the path? The headers? Or maybe the post requests? Once you identify the cache key, try to understand how you can manipulate it in order to catch unwanted content. So, it could be a malicious content like an XSS payload or it could just take down the page for all the users. So, the case of registry.mpmjs.org was pretty cool. Basically, my assumption is that the cache key was actually the full path. And when we added our malicious header, it will create a fall for error. However, the cache key is still remaining the same. And so, it will just override the cache key with a 404. So, at this point, we called deny packages. That's a screenshot of my script running in the back and I'm trying to do an npm install and then that's it. We got a 404 in production environment. So, that was kind of cool. Don't worry, I did it on the package that I created myself. I didn't take down anything, hopefully. And so, the impact was a complete denial of any npm package in the world. Imagine experts as 30 million plus downloads per week. Actually, there was a lot of mitigation in place on GitHub and npm side. But what's quite cool about VT. And so, first, they awarded a $500 informative. But then, they actually did an awesome work to reconsider the severity and they added a $10,000 bounty for this npm crash. So, I was so happy. Especially for something that we didn't do on purpose, again. Okay. Let's go to another cool attack vector for denial of services. Everything related to GraphQL. So, why are we talking about GraphQL today? Because it has a huge adoption in the last few years. And there is so many denial of services in the default configuration. But when I say so many, I say so many. First case of denial of services on GraphQL is a circular definition. Basically, a circular definition occurs when an object references itself directly or indirectly. For instance, here we have a type user that has a best friend user. But imagine if your best friend is also best friend with you. You are basically referencing yourself. So, we have a circular definition here. But no need to check for the introspection and actually understand the structure of your target. GraphQL is vulnerable by default in the introspection schema. So, you can just do an introspection and actually DOS your target without understanding their data structure. That's insane. And so, there's another kind of technique called GraphQL batching that is pretty cool. Basically, the goal is to compile a lot of different requests in the same HTTP request. Again, this could be used to actually DOS your target. We're going to talk about this a little bit later. Something really similar to GraphQL batching, there is aliases where basically you can use different aliases for the same request, but also use different arguments. So, that also could be a huge attack vector for denial of service. So, quick tip for batching and aliases is to actually try to find gadget. What I call gadget, if it's the right definition, but what I call gadget for this specific vulnerability is to find a query in the structure of a target that takes already 200 milliseconds up to 500 milliseconds. Sometimes more. When you don't optimize anything, I guess. And use this specific query in every batching request that you do, or in every aliases. And this will allow you to send a lot of requests to maybe the disk operation that it does, the memory. It really depends on how the backend implemented it. But this could take you like a batching that takes five seconds per request up to five minutes per request. So, this is a good way to multiply and amplify your DOS. And there is this one. The GraphQL directives. So, what's a directive? It's a way for GraphQL to decorate a part of the schema and actually to do an operation on top of it or additional configuration. And there is a technique called GraphQL directive overloading, where basically you can just make that payload, repeat the at eight as many times as you like, and it will totally crash the server somehow. But we had a cool story on the Google console with evolving that. So, let's imagine that a directive could be used for, again, our type user. And you can query every user with the admin or user. So, that's the way that normally we could use a directive. But then Google was using the directive in a very, very strange way. Basically, you add the query list operation, for instance, and then you see that we have a directive at signature with bytes inside. And what they were doing, they were actually signing the body of the request from within the GraphQL request. And every time that we wanted to modify any variables or anything in the schema, we will get an error. So, you know, when we're trying to attack a backend, we really want to modify the request in our proxy. So, that was a huge bummer because it means that everything was totally signed. So, we tried to see if we could sign out our requests. But the problem is that they were outcoding everything in the JavaScript. So, generating everything on the build and putting this in the JavaScript. And so, they actually told us that they were using a secret that was a passphrase. And it was also outcoded inside the codebase. So, they awarded $1,000 for that. But that was a fun one. But nothing related to DOS. But there is something interesting. How they can sign the body and put the signature inside the body. This means that there is something in the GraphQL that is not being checked correctly, right? That is not inside the signature. And normally, it's just the signature itself. So, this means that we can add as many signatures as possible. And every time we had a signature, they were running the check of the entire body all over again. So, we wrote a script where we will add 10 directives, 500, 1,000, up to a million. And check the request every time. What happened? The first 10 directives, 0.9 seconds to answer. 500 directives, one second. We had 5,000 directives, 2.7. 10,000, 2.6. Don't know what happened here. 50,000, 6.5, and then up to 1,109,000 seconds. So, we had 1 minute 40 per request, which is huge. This was found with Rezo and Google gave us a 6K for that. And I think that compared to the presence in the world, the impact is really high for that kind of stuff. And overall, for all the GraphQL DOS that we did in the back... oh, sorry. Pro tips. Yeah, this one is important. GraphQL exposes WebSockets, depending on the configuration and on the backend. But this WebSocket server usually do not have any WAF or any check, and people often forget that it exists. So, if you have rate limiting in place and you want to exploit any GraphQL DOS, you can just go to the WebSocket and there is no security anymore. And if you like actually GraphQL hunting, if you go to the WebSocket, you can also have introspection and other GraphQL configurations. So, it might actually give you a lot more attack surface. So, that's another GraphQL pro tip. And overall, with all the GraphQL services, we made 70K bounty. So, every time you see GraphQL, just say to yourself, we can take it down. Okay. I had to rush a little bit this presentation because we were having this HTML problem. So, let's go to the conclusion. Let's talk about the timeline of this entire dinner of service research. The first dinner of service that we found with Snorlax was in 2022. And the last one that we found was last week. But the main focus of the entire research was doing eight months last year. So, most of the bounties were made in a span of eight months. And so, how much bounty overall we made with this entire research? We made almost $150,000 in bounty, which is a lot. I would say for a technique that is out of scope. And something that is actually quite interesting is that I think that this could be a main vulnerability for a lot of bug hunters, but I would say it's better to use it as a side golden goose. So, for instance, if you like to find a lot of vulnerabilities and then at one point you have no ideas anymore, just look for a DOS, you'll find one, send it, make a quick bug out of it. I think it's a good way to do it. Before finishing this presentation, I needed to do a huge shoutout to Idnama. She's our graphical designer. When I asked her, hey, can you do this entire presentation for DEF CON, she was like, what do you want me to do again? 2,000 memes, a lot of reference, a lot of things. I think she did an amazing job. So, huge shoutout to her. Thanks a lot, everyone, for attending this presentation. I hope you liked it. And if you have any questions later, I will be happy to answer them.