Mitigating OWASP API Security Risks: Unrestricted Resource Consumption using BIG-IP

Introduction:

In modern applications, APIs are heavily utilized and often exposed to the public, making them prime targets for malicious actors. When proper safeguards are not in place, attackers can exploit API endpoints by sending overly large or complex payloads, repeatedly invoking resource-intensive operations, or uploading excessive data. These actions can exhaust backend resources, potentially degrading performance or disrupting service availability for legitimate users.

Unrestricted Resource Consumption is a critical vulnerability that arises when an API fails to enforce limits on the use of system resources such as CPU, memory, disk space, network bandwidth, or database connections. If left unmitigated, this issue can lead to a denial of service (DoS), significant performance degradation, or even complete system failure.

 

Dangers Associated:

  • Denial of Service (DoS): A flood of excessive requests or large payloads can overwhelm system resources, rendering the API or entire application unresponsive.
  • Increased Operational Costs: Unrestricted use of APIs in cloud environments can lead to unexpectedly high expenses, especially when resources are billed based on usage.
  • Data Integrity Risks: Exhausted resources may cause operations to fail or execute improperly. This could lead to potential data loss, corruption, or incomplete transactions.

 

Triggers:

  • Absence of Rate Limiting: Without controls to limit the frequency of requests, APIs become vulnerable to abuse and resource exhaustion.
  • Unrestricted File Uploads: Failing to impose limits on file size or the number of uploads can lead to excessive storage usage and processing overhead.
  • Unbounded Processing Logic: Loops or recursive operations that lack proper constraints can consume excessive CPU or memory resources.
  • Improper Input Validation: Not enforcing limits on input structures—such as array lengths, nested JSON depth, or parameter sizes, can lead to excessive parsing and memory consumption.

 

Demonstration example:

Assume a scenario where a large number of requests are continuously sent to a single API endpoint within a short period using the benchmarking tools like AB(ApacheBench), WRK,  Hey, Apache JMeter, etc. Under this abnormal traffic load, a significant increase in response time is observed compared to normal usage. As the volume of incoming requests grows, the server's performance progressively degrades. This could lead to slow responses, denial of access for legitimate users, and eventually a full-scale Denial of Service (DoS).

This demonstration highlights how BIG-IP can effectively mitigate risks and strengthen application security. For this setup, we use the Petstore Swagger JSON as the API definition to protect the API endpoints.

The first step is to configure BIG-IP with a virtual server and link it to the demo application, represented here by the Petstore Swagger API. Next, we will begin mitigating risks by applying a rate-limiting profile to the virtual server.

 

BIG-IP Configuration Steps:

  • Log in to the BIG-IP console and navigate to Access > API Protection > Profile, then click Create to set up a new profile.
  • Under the Rate Limiting section, create a new rate limiting profile and specify the allowed number of requests per user per second.
  • Under the Rate Limiting section, create a new rate limiting profile and specify the allowed number of requests per user per second.
  • Next, navigate to the Access Control section and configure the Per-Request Policy to define how incoming requests are evaluated and handled.
  • Apply the rate limiting profile and configure the necessary headers for the specific endpoints you intend to test or protect.
  • Save the profile, then associate it with the virtual server and apply the updates to finalize the configuration.
  • Now, let's generate traffic to the Petstore endpoints—specifically, /store/id without rate limiting and /pet/id with rate limiting—using the tools AB and WRK. This will allow us to compare response times and evaluate the effectiveness of rate-limiting protection against potential attacks. 

     

Conclusion:

As demonstrated, F5 BIG-IP’s rate limiting functionality acts as a critical line of defense against unrestricted resource consumption attacks by effectively identifying and controlling excessive traffic, thereby ensuring application stability and enhancing overall security.

 

Reference Links: 

 

Published Jun 24, 2025
Version 1.0
No CommentsBe the first to comment