Unrestriced Resource Consumption
This can lead to Denial of Service (DoS) attacks, server crashes, or performance degradation, impacting the availability and stability of the application or system.
Implement resource limits and quotas for users or requests, use rate limiting and throttling to control resource usage, and monitor system performance to detect and address excessive resource consumption.
The below example is based on HTB's API Attacks module.
Lack of limiting user-initiated requests that consume resources can lead to DoS attacks (Figure 1) as well as BF attacks (Figure 2).

# Creating a 30 megabytes PDF file
$ dd if=/dev/urandom of=certificateOfIncorporation.pdf bs=1M count=30
30+0 records in
30+0 records out
31457280 bytes (31 MB, 30 MiB) copied, 0.0632942 s, 497 MB/s
$ ls -l
-rw-r--r-- 1 x7331 x7331 31457280 Jul 11 09:18 certificateOfIncorporation.pdf

There are three main issues here:
The backend does not validate that the file size is within a specified size and since there are no rate-limiting measures, an attacker can consume all the marketplace's disk storage.
There is no check of the file extension or content, which means we can uploiad any file type we want.
The uploaded files are stored within the
wwwroot
directory. The web API is developed using ASP.NET Core which means that the static files withinwwwroot
are publicly accessible.

Last updated
Was this helpful?