Designing application limits to resist denial of service
Designing application limits to resist denial of service connects a security requirement to the behaviour of a real feature. The relevant controls need to remain effective across custom code, integrations and the production configuration. Understanding application limits to resist denial of service helps establish which security property the feature needs and where that property is actually enforced.
What does this involve?
Availability controls need to bound the total work an operation can cause, including background jobs, nested queries, retries and paid services. Request size alone is a poor measure of cost when small inputs can trigger expensive processing.
Because anti-DoS methods cannot be one-step solutions, your developers and application/infrastructure architects must develop DoS solutions carefully. They must keep in mind that "availability" is a basic part of the CIA triad.
Remember that if every part of the computing system within the interoperability flow does not function correctly, your infrastructure suffers. A successful DoS attack hinders the availability of instances or objects to a system and can eventually render the entire system inaccessible.
Why it matters
Consider a realistic failure: a small public request triggers an unbounded amount of processing or stored work.
Resource abuse can slow legitimate work, increase service costs or leave queues and business state in an unhealthy condition. Assessment should use proportionate workloads and distinguish a missing limit from a demonstrated operational effect.
Implementation guidance should be applied to a real feature and its deployment. Framework defaults, custom handlers and integrated services all influence whether the intended protection remains effective.
How penetration testers check for it
Trace the relevant feature from its entry point to the data or operation it protects, including custom code and alternate paths.
- Identify expensive operations and downstream dependencies.
- Review time, size, concurrency and cost limits.
- Check retries, cancellation and identity-based quotas.
- Observe useful service behaviour during bounded failure conditions.
How to fix it
Use the appropriate maintained mechanisms and verify the result in the actual production configuration.
- Using validation that is cheap in resources first: We want to reduce impact on these resources as soon as possible. More (CPU, memory and bandwidth) expensive validation should be performed afterward.
- Protect overflow and underflow Since buffer overflow and underflow often lead to vulnerabilities, learning how to prevent them is key. OWASP Overflow-Underflow-C Overflow.
- Threading: Avoid operations which must wait for completion of large tasks to proceed. Asynchronous operations are useful in these situations.
- Limit server side session time based on inactivity and a final timeout: (resource exhaustion) While sessions timeout is most of the time discussed in relation to session security and preventing session hijacking, it is also an important measure to prevent resource exhaustion.
- Use bounded retries and safe cancellation.
- Monitor meaningful capacity and cost signals.
Load testing and penetration testing have different operational impacts. The test conditions should be agreed so the review can establish control behaviour without unnecessary service disruption.
Recheck the changed behaviour against the original failure conditions and the legitimate user journey. Keep enough evidence to show which release and configuration were verified, and include related entry points that depend on the same security decision.
Related issues
- Preserving user identity across application service boundaries
- Designing controlled AI agent payment and screening workflows
- Implementing trustworthy SAML assertions and service provider checks
Read about our methodology or contact pentested.com to discuss secure development and code review.