WEBVTT

00:00.000 --> 00:08.120
So I'm happy to introduce Ronnie Carta and talk about practical exploitation in denial of service and bug bounties.

00:08.340 --> 00:09.780
Ronnie, thanks.

00:13.760 --> 00:17.220
Hi everyone, I'm really happy to be there today.

00:17.220 --> 00:29.060
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.

00:29.840 --> 00:34.680
So the talk is about practical exploitation of denial of service in bug bounty program.

00:34.680 --> 00:48.940
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.

00:50.100 --> 00:52.500
I love denial of service.

00:52.500 --> 00:59.700
I love denial of service because you can actually try to slow down or considerably take down an entire product environment.

00:59.920 --> 01:06.920
And so the goal of denial of service in bug bounties is to basically try to find the most business impact.

01:06.920 --> 01:12.340
Imagine like a website not having traffic anymore, that will be a huge bummer for the company.

01:13.280 --> 01:30.980
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.

01:31.040 --> 01:38.840
This is basically all about the resource that you have on your machine against the resources that you have on your target.

01:38.840 --> 01:53.860
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.

01:53.940 --> 01:56.320
So that's what we're going to talk about today.

01:56.920 --> 01:59.880
A little bit of definition debates here.

02:00.960 --> 02:06.400
Basically, there is a whole debate about denial of service being an availability or integrity impact.

02:06.740 --> 02:14.400
So basically, the impact of like the DDoS is not a vulnerability class, but more like an impact, I will say.

02:14.400 --> 02:25.320
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.

02:25.320 --> 02:30.600
So that whole blob of documentation, if you want to read it, is what the CVSS says.

02:30.600 --> 02:39.360
So basically, it says that availability is the performance and operation of the service itself and not the availability of the data.

02:39.360 --> 02:47.240
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.

02:47.240 --> 02:51.920
So be mindful of that if you want to argue with CVSS programs.

02:53.280 --> 02:55.720
So when DDoS is relevant?

02:55.760 --> 03:01.260
Basically, it is relevant for every feature where there is a strong dependency.

03:01.480 --> 03:10.480
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.

03:10.980 --> 03:16.560
For instance, if you can take that entire EKS cluster in production, well, that might be super impactful.

03:17.900 --> 03:20.120
But yeah, I know what you are going to say.

03:20.120 --> 03:22.200
DDoS is totally out of scope.

03:22.200 --> 03:28.100
Actually, on HackerOne default templates for program, it's marked as out of scope by default.

03:28.380 --> 03:33.280
And there's a reason for that, because companies in usual do not like DDoS.

03:33.280 --> 03:45.820
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.

03:46.200 --> 03:53.720
So basically, it's not because DDoS has low impact, but because sometimes that's too much impact.

03:53.880 --> 03:59.940
But we can test DDoS responsibly and actually make a few bucks with it.

04:00.820 --> 04:07.820
In order to test DDoS responsibly, you need to find the gadget of the problem to fully exploit it.

04:07.820 --> 04:17.060
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.

04:17.060 --> 04:22.080
But you do not need to actually take it down to just see that one request takes more than 10 seconds.

04:22.220 --> 04:30.740
And also, if you are allowed, you can still try to take down the non-production environment, so staging, integration, sandbox, et cetera.

04:30.760 --> 04:39.520
But if there is something to know about this entire talk, please, always ask the programs before even searching for their services.

04:39.840 --> 04:45.700
Because programs need to be aware of what kind of tests you are going to do in order for them to monitor.

04:45.720 --> 04:54.220
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.

04:55.700 --> 04:59.780
And DDoS service is all about program's maturity, right?

05:00.220 --> 05:09.540
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.

05:09.720 --> 05:14.960
But actually, some programs will allow you to completely take down their product environment.

05:15.500 --> 05:16.860
And I'm serious.

05:17.180 --> 05:20.300
They are completely allowing to take down their dub-dub-dub environment.

05:20.300 --> 05:21.840
So, this is amazing.

05:22.400 --> 05:30.620
Before starting going on all the different techniques, I need to thanks Rezo, Zack, Ixo, Snorlax, Befed, BonsoirD, and DoomerHunter.

05:30.620 --> 05:32.020
Those are amazing hunters.

05:32.080 --> 05:35.800
We did all this research together on the span of two years.

05:35.800 --> 05:38.540
So, I needed to quickly show that to them.

05:38.580 --> 05:40.600
Amazing people to follow, too.

05:41.680 --> 05:42.000
Okay.

05:42.000 --> 05:44.960
Let's start with a quick vulnerability.

05:44.960 --> 05:46.800
This one is really fun.

05:46.800 --> 05:49.520
So, one evening, we were hacking with Snorlax.

05:49.520 --> 05:55.740
And there was this application that was sending service to send chat messages.

05:56.020 --> 06:04.420
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.

06:04.420 --> 06:09.960
So, we were contacting one another, sending messages, and we're, like, the first that got XSS wins it.

06:10.420 --> 06:14.840
But at some point, we were doing a test, and my page completely goes blank.

06:14.840 --> 06:17.020
And I was, like, maybe I lost internet.

06:17.020 --> 06:21.080
But I was still hearing Snorlax on Discord, and I was, like, there's something weird, right?

06:21.180 --> 06:26.260
Until he tells me, hey, Lupin, is your page blank, too?

06:27.040 --> 06:31.360
So, those are the payloads that we sent at this moment.

06:31.360 --> 06:36.620
So, try to think about which one did manage to make the page entirely blank.

06:36.920 --> 06:38.320
Do you have it?

06:40.140 --> 06:40.840
Yeah.

06:40.840 --> 06:42.000
This is the one.

06:42.000 --> 06:53.040
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.

06:53.040 --> 07:01.180
So, basically, it's some kind of DOM purify that will try to sanitize every XSS that you are going to send.

07:01.420 --> 07:07.540
And this library actually tried to sanitize every href attribute in your frontend.

07:07.540 --> 07:13.420
So, for instance, if you have a JavaScript schema, it will try to remove it from the href.

07:13.420 --> 07:16.660
However, in this payload, where is the href?

07:16.660 --> 07:18.260
There's a problem here.

07:18.460 --> 07:26.440
And so, the library actually called the function href and take an argument href and do a dot replace on it.

07:26.440 --> 07:30.780
However, when it's undefined, it completely crashed the entire frontend.

07:30.980 --> 07:31.680
Okay.

07:31.680 --> 07:33.660
That was a pretty cool one.

07:34.040 --> 07:40.280
And so, for every kind of client-side service, I would say that the impact is not that huge.

07:40.280 --> 07:44.120
It's all depending on the target.

07:44.120 --> 07:50.800
Overall, with this specific technique of malformed data, HTML, we did $350 bounty.

07:50.820 --> 07:52.740
But that's just the start.

07:53.280 --> 08:07.120
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.

08:07.120 --> 08:11.720
That was validated by the backend, but it was a completely malformed JSON.

08:11.720 --> 08:16.720
And so, when the frontend was using it, it will also completely crash.

08:16.800 --> 08:19.980
And so, the malformed JSON was really simple.

08:20.140 --> 08:25.060
It was using two back quotes at the same time.

08:25.060 --> 08:26.220
Two escape back quotes.

08:26.220 --> 08:29.040
And so, it was somehow accepted by the backend.

08:29.040 --> 08:34.220
But when you were doing a JSON.parse on the frontend, it would completely crash.

08:34.600 --> 08:40.500
And so, this technique actually worked on TikTok and we got paid for that.

08:40.500 --> 08:42.360
So, that was a cool one.

08:42.520 --> 08:44.960
But there's some cooler techniques now.

08:45.420 --> 08:46.120
Okay.

08:46.120 --> 08:51.140
So, that guy here is one of the biggest problems for all developers.

08:51.860 --> 08:54.100
The N plus one problem.

08:54.100 --> 09:07.240
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.

09:07.240 --> 09:09.520
And he was like, do you know what's an N plus one problem?

09:09.520 --> 09:10.340
And I was like, no.

09:10.340 --> 09:22.240
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.

09:22.960 --> 09:32.260
So, basically, an attacker can exploit N plus one queries to trigger numerous calls to the database and potentially overwhelm the system.

09:32.640 --> 09:37.260
And the impact of an N plus one query often scales with the data size.

09:37.260 --> 09:42.200
So, the more data that you have, the more DOS capability you can have on your target.

09:43.140 --> 09:45.660
So, how do you detect an N plus one query?

09:45.700 --> 09:48.540
Basically, you find an endpoint that creates data in the API.

09:49.140 --> 09:52.400
You find a request that gets all the data at the same time.

09:52.400 --> 09:53.960
So, usually a get request.

09:53.960 --> 09:56.660
And if there is pagination, try to increase the limit.

09:56.660 --> 09:59.740
For instance, you have some request that is page equal 10.

09:59.740 --> 10:02.960
Try to put 10,000 and see what's going to happen.

10:03.660 --> 10:11.260
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.

10:12.520 --> 10:17.660
I also created a BURP extension that I'm going to release right after this talk.

10:17.860 --> 10:19.540
That's called Tridos.

10:19.540 --> 10:29.860
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.

10:29.860 --> 10:32.260
I personally put it to three seconds.

10:32.260 --> 10:42.180
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.

10:42.840 --> 10:48.280
So, let's take an example of an N plus one problem.

10:48.420 --> 10:53.280
There was an app that could accept to get as many objects as we wanted.

10:53.280 --> 10:57.160
The JSON blob was something like that, where you had a list of users.

10:57.160 --> 11:04.660
And then on each user, you can create... on each array of the list, you can create a new user.

11:04.660 --> 11:09.360
And then there was another sub object with another array with new objects.

11:09.360 --> 11:16.220
So, that's basically an N plus one problem, when one request can create as many sub objects as you want.

11:16.860 --> 11:18.800
And so, how did we exploit that ?

11:18.800 --> 11:26.600
Well, we sent the request to create all those objects and we created approximately 10,000 objects in the backend.

11:26.860 --> 11:33.800
And then our get request to retrieve all the objects took 10 seconds per request.

11:33.800 --> 11:38.700
So, that's a really, really good sign that you have an N plus one problem.

11:38.700 --> 11:49.920
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.

11:50.280 --> 11:51.120
And the result...

11:54.300 --> 11:55.980
complete crash.

11:56.160 --> 12:03.060
Overall, this technique, not only single-vulnerability, but overall, we did 46,000 dollars in bounty.

12:03.060 --> 12:07.860
There was an LHE this week, so we can add 10,000 more to this slide.

12:08.000 --> 12:17.140
I think that 30k of this was Snorlax alone, because he's so good at just taking one technique and spreading it.

12:17.140 --> 12:22.100
I think he did 15k per vulnerability, so in two vulnerabilities, 30k.

12:22.100 --> 12:23.880
That guy is insane.

12:25.100 --> 12:28.980
Okay, let's talk about network-based denial of services.

12:29.460 --> 12:35.940
Have you ever been in that situation where you have a blind SSRF and you don't know what to do with it?

12:36.000 --> 12:43.900
And that you are desperate for a technique that will help you transform this sometimes informative vulnerability into a higher crit?

12:44.300 --> 12:46.880
Well, we have a technique for you.

12:48.380 --> 12:52.640
Basically, do you guys know something called, like, slow low-risk attack?

12:52.640 --> 13:02.560
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.

13:02.560 --> 13:04.960
We can do it with several ways.

13:04.980 --> 13:12.880
You can make your server hang and just time out after 10 seconds, or you can create a request loop.

13:13.600 --> 13:15.920
So what do I mean by request loop?

13:15.920 --> 13:27.600
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.

13:27.600 --> 13:32.760
And the goal is to make the server time out as much as possible.

13:32.760 --> 13:36.360
So we have that kind of schema happening.

13:37.320 --> 13:47.320
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.

13:48.580 --> 13:54.080
Until we have this bottleneck happening and there is no available sockets anymore.

13:56.820 --> 14:03.040
For this technique, I think it was on two separate vulnerabilities, we made 15k.

14:03.040 --> 14:08.060
So it's actually a great technique to transform blind SSRF into a critical.

14:08.220 --> 14:12.980
Again, every time that we take down product environments, we always ask for the programs.

14:12.980 --> 14:14.580
Really be mindful of that.

14:14.580 --> 14:18.560
But that's a pretty cool one if you're ever stuck.

14:19.680 --> 14:20.240
Okay.

14:20.240 --> 14:23.340
Let's go to sign-in denial of services.

14:24.520 --> 14:30.400
This one was really cool because we had a target with an employee web page.

14:30.400 --> 14:38.540
And basically when we see an employee web page, we try password stuffing or brute forcing, we see proclamation, injection, et cetera, et cetera.

14:38.700 --> 14:53.420
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.

14:53.420 --> 14:58.580
So we could pull everything on LinkedIn and we had a great world list to work with.

14:58.960 --> 15:00.840
So what do we do?

15:00.840 --> 15:06.800
We managed to automate the attack, no rate limiting at all, and then no login found.

15:06.800 --> 15:07.440
Wait.

15:07.440 --> 15:08.740
No login found?

15:08.740 --> 15:11.020
But we still got a crit.

15:11.520 --> 15:12.300
Okay.

15:12.440 --> 15:17.420
Guess what protection they implemented for brute forcing attack?

15:17.420 --> 15:19.660
Is it A, delay the next attempt?

15:19.660 --> 15:21.000
B, capture?

15:21.120 --> 15:23.440
C, ban the IP address?

15:23.440 --> 15:25.540
Or D, ban the employee account?

15:30.270 --> 15:35.610
There is actual documentation on the internet that says that this is the right thing to do.

15:35.750 --> 15:37.310
So, yeah.

15:37.310 --> 15:38.190
What happened?

15:38.190 --> 15:39.970
600 accounts locked.

15:40.530 --> 15:48.830
They had integration with the ID, so active directory completely down, no access to the VPN anymore.

15:49.390 --> 15:52.610
Completely take down of the internet environment.

15:52.610 --> 15:53.910
So funny.

15:54.470 --> 16:04.910
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.

16:04.910 --> 16:07.670
I don't think that a lot of companies are doing that anymore.

16:08.070 --> 16:10.090
But pretty cool bug.

16:11.050 --> 16:11.550
Okay.

16:11.550 --> 16:14.710
Let's go to another type of DOS.

16:14.810 --> 16:16.310
Disconception DOS.

16:16.330 --> 16:17.730
So, this story is quite cool.

16:17.730 --> 16:20.870
It started because I read this asset node research.

16:20.870 --> 16:25.590
If you guys don't know asset nodes, you should read every blog post of them.

16:25.590 --> 16:26.610
It's amazing.

16:26.610 --> 16:34.610
And there was this blog post from 2019 called discovering a zero day and getting code execution on modular AWS network.

16:34.610 --> 16:36.930
So, how did asset node achieve that?

16:36.930 --> 16:39.870
Basically, there was an instance called web page test.

16:40.310 --> 16:42.390
And it was completely open source.

16:42.390 --> 16:43.430
So, they read the code.

16:43.430 --> 16:48.930
And there was like this piece of code where you could extract a zip file that was given by the user.

16:48.930 --> 16:55.010
And then with some kind of quick race condition, you could actually call a PHP file.

16:55.070 --> 17:03.050
And so, for this race condition to work, you needed to set up an intruder and just run as many requests as possible.

17:03.770 --> 17:06.070
What happened when I tried it?

17:07.070 --> 17:11.010
The backend didn't have enough inodes to take the charge of requests.

17:11.010 --> 17:17.290
So, every time it was creating a zip file and trying to extract it, it was allocating inodes.

17:17.290 --> 17:21.590
And so, the disk was full in like maybe two, three seconds.

17:21.730 --> 17:22.510
So, yeah.

17:22.510 --> 17:24.330
I took down the instance.

17:24.330 --> 17:30.650
And I thought that this instance wasn't used by anyone until someone told me, hey, all the pipelines are down.

17:30.650 --> 17:34.530
And so, every time they were running a pipeline, they were going to that instance.

17:35.270 --> 17:36.390
That's cool.

17:37.050 --> 17:39.230
So, total crash of the server.

17:39.230 --> 17:40.270
No access to the disk.

17:40.270 --> 17:43.930
They needed to clean everything, wipe out, restart the server.

17:43.930 --> 17:45.430
That was a cool one.

17:45.490 --> 17:50.330
I would say that, again, the impact is reduced because of the presence in the world.

17:50.330 --> 17:52.390
So, it's a three out of five.

17:53.550 --> 17:55.030
Cache poisoning.

17:55.030 --> 17:56.630
That's a good one.

17:57.190 --> 18:05.490
So, one day, we were developing a new feature for our tool in research mode.

18:05.490 --> 18:14.370
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.

18:14.990 --> 18:25.030
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?

18:25.330 --> 18:27.250
It's a good thing to try.

18:27.250 --> 18:29.110
So, we developed a proof concept.

18:29.370 --> 18:34.370
And on the first run, we managed to get a hit on registry.npmjs.org.

18:34.370 --> 18:36.890
And I was like, no.

18:36.890 --> 18:38.230
That didn't happen.

18:38.230 --> 18:39.470
Like, no way.

18:40.510 --> 18:42.870
So, we thought it was a fault positive.

18:42.870 --> 18:45.750
And lo and behold, it worked.

18:46.590 --> 18:49.190
So, what is CPDOS?

18:49.490 --> 18:53.980
CPDOS is a web attack technique described by Paul Truger.

18:54.750 --> 18:57.670
Paul Truger actually made it really, really famous.

18:57.670 --> 19:02.090
Again, if you didn't read in your life a James Kettle research, you should do it.

19:02.490 --> 19:03.950
This guy is amazing.

19:03.950 --> 19:05.650
Always breaking the internet.

19:05.930 --> 19:13.290
And basically, it's in the web caching system in order to deliver malicious content to the users.

19:14.110 --> 19:21.590
So, the methodology is to first understand how the cache keys of our target is working.

19:21.590 --> 19:28.170
And then understand how the output of the request is linked to your HTTP input.

19:28.170 --> 19:31.290
So, for instance, is the cache key inside the path?

19:31.290 --> 19:32.290
The headers?

19:32.290 --> 19:35.050
Or maybe the post requests?

19:35.050 --> 19:41.650
Once you identify the cache key, try to understand how you can manipulate it in order to catch unwanted content.

19:41.650 --> 19:49.190
So, it could be a malicious content like an XSS payload or it could just take down the page for all the users.

19:49.910 --> 19:54.430
So, the case of registry.mpmjs.org was pretty cool.

19:54.510 --> 19:59.590
Basically, my assumption is that the cache key was actually the full path.

19:59.650 --> 20:07.110
And when we added our malicious header, it will create a fall for error.

20:07.110 --> 20:10.310
However, the cache key is still remaining the same.

20:10.310 --> 20:13.950
And so, it will just override the cache key with a 404.

20:14.690 --> 20:19.050
So, at this point, we called deny packages.

20:19.210 --> 20:26.630
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.

20:26.630 --> 20:29.570
We got a 404 in production environment.

20:29.570 --> 20:31.250
So, that was kind of cool.

20:31.250 --> 20:34.070
Don't worry, I did it on the package that I created myself.

20:34.070 --> 20:36.670
I didn't take down anything, hopefully.

20:37.650 --> 20:43.810
And so, the impact was a complete denial of any npm package in the world.

20:43.810 --> 20:47.530
Imagine experts as 30 million plus downloads per week.

20:48.110 --> 20:54.030
Actually, there was a lot of mitigation in place on GitHub and npm side.

20:54.190 --> 20:58.050
But what's quite cool about VT.

20:58.050 --> 21:03.690
And so, first, they awarded a $500 informative.

21:03.690 --> 21:14.570
But then, they actually did an awesome work to reconsider the severity and they added a $10,000 bounty for this npm crash.

21:14.570 --> 21:17.070
So, I was so happy.

21:17.070 --> 21:20.990
Especially for something that we didn't do on purpose, again.

21:21.970 --> 21:22.550
Okay.

21:22.550 --> 21:26.830
Let's go to another cool attack vector for denial of services.

21:26.830 --> 21:28.460
Everything related to GraphQL.

21:29.030 --> 21:31.620
So, why are we talking about GraphQL today?

21:31.620 --> 21:35.880
Because it has a huge adoption in the last few years.

21:35.900 --> 21:40.340
And there is so many denial of services in the default configuration.

21:40.340 --> 21:43.800
But when I say so many, I say so many.

21:45.160 --> 21:51.160
First case of denial of services on GraphQL is a circular definition.

21:51.160 --> 21:59.600
Basically, a circular definition occurs when an object references itself directly or indirectly.

21:59.600 --> 22:04.120
For instance, here we have a type user that has a best friend user.

22:04.120 --> 22:08.540
But imagine if your best friend is also best friend with you.

22:08.540 --> 22:10.580
You are basically referencing yourself.

22:10.580 --> 22:12.860
So, we have a circular definition here.

22:13.460 --> 22:18.960
But no need to check for the introspection and actually understand the structure of your target.

22:19.040 --> 22:22.820
GraphQL is vulnerable by default in the introspection schema.

22:22.820 --> 22:28.280
So, you can just do an introspection and actually DOS your target without understanding their data structure.

22:28.640 --> 22:30.220
That's insane.

22:31.680 --> 22:37.300
And so, there's another kind of technique called GraphQL batching that is pretty cool.

22:37.300 --> 22:43.580
Basically, the goal is to compile a lot of different requests in the same HTTP request.

22:43.580 --> 22:48.420
Again, this could be used to actually DOS your target.

22:48.420 --> 22:50.820
We're going to talk about this a little bit later.

22:51.260 --> 23:02.220
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.

23:02.260 --> 23:06.900
So, that also could be a huge attack vector for denial of service.

23:07.440 --> 23:13.460
So, quick tip for batching and aliases is to actually try to find gadget.

23:13.460 --> 23:27.780
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.

23:27.840 --> 23:29.240
Sometimes more.

23:29.660 --> 23:32.360
When you don't optimize anything, I guess.

23:33.000 --> 23:40.200
And use this specific query in every batching request that you do, or in every aliases.

23:40.200 --> 23:46.660
And this will allow you to send a lot of requests to maybe the disk operation that it does, the memory.

23:46.660 --> 23:50.060
It really depends on how the backend implemented it.

23:50.300 --> 23:57.700
But this could take you like a batching that takes five seconds per request up to five minutes per request.

23:57.700 --> 24:02.840
So, this is a good way to multiply and amplify your DOS.

24:04.080 --> 24:06.200
And there is this one.

24:06.200 --> 24:08.040
The GraphQL directives.

24:08.040 --> 24:09.780
So, what's a directive?

24:10.000 --> 24:19.600
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.

24:20.140 --> 24:34.890
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.

24:35.600 --> 24:42.320
But we had a cool story on the Google console with evolving that.

24:42.320 --> 24:48.660
So, let's imagine that a directive could be used for, again, our type user.

24:48.660 --> 24:54.360
And you can query every user with the admin or user.

24:54.380 --> 24:58.820
So, that's the way that normally we could use a directive.

24:59.660 --> 25:05.300
But then Google was using the directive in a very, very strange way.

25:05.300 --> 25:15.280
Basically, you add the query list operation, for instance, and then you see that we have a directive at signature with bytes inside.

25:15.460 --> 25:24.500
And what they were doing, they were actually signing the body of the request from within the GraphQL request.

25:25.100 --> 25:32.300
And every time that we wanted to modify any variables or anything in the schema, we will get an error.

25:32.320 --> 25:38.520
So, you know, when we're trying to attack a backend, we really want to modify the request in our proxy.

25:38.520 --> 25:43.620
So, that was a huge bummer because it means that everything was totally signed.

25:43.620 --> 25:47.440
So, we tried to see if we could sign out our requests.

25:47.540 --> 25:52.000
But the problem is that they were outcoding everything in the JavaScript.

25:52.000 --> 25:55.960
So, generating everything on the build and putting this in the JavaScript.

25:56.100 --> 26:02.380
And so, they actually told us that they were using a secret that was a passphrase.

26:02.440 --> 26:05.280
And it was also outcoded inside the codebase.

26:05.280 --> 26:08.040
So, they awarded $1,000 for that.

26:08.180 --> 26:09.560
But that was a fun one.

26:09.560 --> 26:11.520
But nothing related to DOS.

26:11.900 --> 26:13.660
But there is something interesting.

26:13.820 --> 26:19.580
How they can sign the body and put the signature inside the body.

26:19.580 --> 26:25.520
This means that there is something in the GraphQL that is not being checked correctly, right?

26:25.520 --> 26:28.120
That is not inside the signature.

26:28.120 --> 26:31.420
And normally, it's just the signature itself.

26:31.420 --> 26:35.820
So, this means that we can add as many signatures as possible.

26:35.820 --> 26:41.940
And every time we had a signature, they were running the check of the entire body all over again.

26:42.400 --> 26:49.600
So, we wrote a script where we will add 10 directives, 500, 1,000, up to a million.

26:49.600 --> 26:52.880
And check the request every time.

26:52.900 --> 26:54.240
What happened?

26:54.240 --> 26:58.800
The first 10 directives, 0.9 seconds to answer.

26:58.800 --> 27:00.960
500 directives, one second.

27:01.100 --> 27:04.200
We had 5,000 directives, 2.7.

27:04.200 --> 27:05.440
10,000, 2.6.

27:05.440 --> 27:06.980
Don't know what happened here.

27:07.500 --> 27:13.180
50,000, 6.5, and then up to 1,109,000 seconds.

27:13.180 --> 27:18.280
So, we had 1 minute 40 per request, which is huge.

27:19.340 --> 27:25.500
This was found with Rezo and Google gave us a 6K for that.

27:25.500 --> 27:34.420
And I think that compared to the presence in the world, the impact is really high for that kind of stuff.

27:34.420 --> 27:40.520
And overall, for all the GraphQL DOS that we did in the back... oh, sorry.

27:40.760 --> 27:41.720
Pro tips.

27:41.860 --> 27:43.440
Yeah, this one is important.

27:44.120 --> 27:49.400
GraphQL exposes WebSockets, depending on the configuration and on the backend.

27:49.860 --> 27:58.140
But this WebSocket server usually do not have any WAF or any check, and people often forget that it exists.

27:58.140 --> 28:06.800
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.

28:06.800 --> 28:18.440
And if you like actually GraphQL hunting, if you go to the WebSocket, you can also have introspection and other GraphQL configurations.

28:18.440 --> 28:21.740
So, it might actually give you a lot more attack surface.

28:21.740 --> 28:23.840
So, that's another GraphQL pro tip.

28:23.840 --> 28:29.960
And overall, with all the GraphQL services, we made 70K bounty.

28:30.180 --> 28:35.740
So, every time you see GraphQL, just say to yourself, we can take it down.

28:37.080 --> 28:37.800
Okay.

28:37.800 --> 28:42.900
I had to rush a little bit this presentation because we were having this HTML problem.

28:42.900 --> 28:45.020
So, let's go to the conclusion.

28:45.020 --> 28:50.020
Let's talk about the timeline of this entire dinner of service research.

28:50.020 --> 28:55.440
The first dinner of service that we found with Snorlax was in 2022.

28:56.140 --> 28:59.020
And the last one that we found was last week.

28:59.020 --> 29:05.920
But the main focus of the entire research was doing eight months last year.

29:05.920 --> 29:09.720
So, most of the bounties were made in a span of eight months.

29:10.460 --> 29:15.600
And so, how much bounty overall we made with this entire research?

29:16.840 --> 29:24.280
We made almost $150,000 in bounty, which is a lot.

29:24.280 --> 29:27.720
I would say for a technique that is out of scope.

29:27.720 --> 29:41.120
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.

29:41.120 --> 29:51.900
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.

29:51.900 --> 29:54.280
I think it's a good way to do it.

29:54.980 --> 30:01.080
Before finishing this presentation, I needed to do a huge shoutout to Idnama.

30:01.080 --> 30:03.600
She's our graphical designer.

30:03.600 --> 30:10.480
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?

30:10.480 --> 30:13.380
2,000 memes, a lot of reference, a lot of things.

30:13.380 --> 30:15.220
I think she did an amazing job.

30:15.220 --> 30:17.560
So, huge shoutout to her.

30:18.280 --> 30:21.280
Thanks a lot, everyone, for attending this presentation.

30:21.280 --> 30:22.880
I hope you liked it.

30:22.880 --> 30:27.940
And if you have any questions later, I will be happy to answer them.

