The Attack You Can’t Stop in Your Application

F5 Ecosystem | November 09, 2015

A wide variety of HTTP-based attacks can (and should) be prevented in your application. The OWASP Top 10 is a prime example of attack techniques that are both detectable and preventable from within any application. A plethora of tools including static and dynamic analysis as well as penetration testing can ensure that these vulnerabilities do not pass go, into production. Provided, of course, that such security testing is shifted left into the CI/CD process rather than left as the final step before flipping the switch (or bits, as it were) that makes it accessible to users.

Even if you’ve eliminated every potential vulnerability found in dev, applications are still at risk. That’s because some attacks can’t – and by can’t I really mean can’t – be detected by the application. In fact, by the time the attack reaches the application, it’s already too late.

fuel empty

Of course I’m talking about application layer (HTTP) DDoS attacks. You know, the vampiric ones that exploit the HTTP protocol itself to basically suck up every last available drop of compute and memory from an application so as to render it useless for legitimate users.

There are basically two types of HTTP DDOS attacks: the fast and the slow; the flood and the drain.

The Flood Attack

An HTTP DDoS attack based on flooding uses the fact that apps are expected to accept HTTP requests and respond to them. That’s kind of their shtick, isn’t it? So they do. And they do regardless of how fast those requests are coming in. Even if the requests are coming in at a rate that will deplete the resources available to that server in minutes – or seconds – it tries to respond. See, every app (in fact every device, service, system, etc…) has an upper limit to the number of TCP connections it can hold open at any time before it simply can’t open any more. When it hits that upper limit any subsequent requests are simply ignored. Users experience this with the innocuous status “Trying to connect…” as their browser or app waits until the system-specified amount of time it must wait has passed, and then apologizes for being unable to connect.

This kind of attack can come in so fast (hence the analogy of a “flash flood”) that it outstrips the systems’ ability to scale to meet the demand. Not even auto-scaling can help in this scenario, as the time it takes to provision and launch a new instance of the app is greater than the time it takes for the attack to strip the existing instances of all their resources.

The Drain Attack

The opposite – a draining attack – accomplishes the same task but does so by forcing the app to keep a connection open longer than necessary. It manages this by pretending it’s on dial-up; trickling a few drops of data out of the app per second rather than the rate at which it is actually capable of receiving it. Doing so means connections last longer, and if you do that with enough connections you basically end up in the same situation as the flooding attack: resource depletion.

Neither of these attacks are detectable from within an application. Why would they be? To the application these requests are all legitimate; they are all well-formed, HTTP-based requests for data that it likely answers thousands of times a day. There is no flag in the HTTP headers or payload that indicate the nefarious nature of the requests. The application is completely and utterly blind to the malicious intentions behind these requests because it has no visibility into the network or into the broader environment – specifically the server’s session table that maintains the master list of all open connections. I’ll spare you the technical details and lecture on threads, processes, and volatility of data in multi-threaded environments and just stick with the “no visibility into the processing of other requests.”

Suffice to say, the application itself has no way to determine whether or not any given request is part of a larger attack (flooding) or whether its behavior is inconsistent with its known capabilities (draining).

The Proxy to the Rescue

vampire_garlic

What does have visibility into both is the proxy sitting upstream (in front of) the application. That’s because the proxy is probably doing load balancing and thus has to pay attention to how many requests are currently in process as well as how many are coming in because it has to send them to one of the apps in the cluster (or pool, if you prefer).

It further more has to know where to send the response, so it knows about the client and its network connection (only the client IP address is typically sent to the app, nothing more). Unlike the application, it has the visibility necessary to detect both flooding and draining attacks – and stop them before they can sink their vampiric teeth into the app’s resources.

That’s why proxy-based services like a WAF (Web Application Firewall) or even an advanced load balancer is a critical player in today’s application security strategies. Because they have the visibility and the means to detect the anomalous behavior indicative of an attack – and repel it like garlic and a vampire.

And because these traditionally “network” services should necessarily become part of the application architecture, it seems logical that a DevOps approach would tend to stretch its wings and be more inclusive of those services that naturally gravitate toward the application in the first place, like app security and scalability (load balancing).

Applications can’t stop every attack, particularly those that require a level of visibility that simply isn’t available to them. Working in concert with application-affine services like web app security and load balancing, however, can provide the means by which a more comprehensive set of attacks can be detected and repulsed to ensure fewer outages and breaches.

Share
Tags: 2015

About the Author

Related Blog Posts

F5 accelerates and secures AI inference at scale with NVIDIA Cloud Partner reference architecture
F5 Ecosystem | 10/28/2025

F5 accelerates and secures AI inference at scale with NVIDIA Cloud Partner reference architecture

F5’s inclusion within the NVIDIA Cloud Partner (NCP) reference architecture enables secure, high-performance AI infrastructure that scales efficiently to support advanced AI workloads.

F5 Silverline Mitigates Record-Breaking DDoS Attacks
F5 Ecosystem | 08/26/2021

F5 Silverline Mitigates Record-Breaking DDoS Attacks

Malicious attacks are increasing in scale and complexity, threatening to overwhelm and breach the internal resources of businesses globally. Often, these attacks combine high-volume traffic with stealthy, low-and-slow, application-targeted attack techniques, powered by either automated botnets or human-driven tools.

F5 Silverline: Our Data Centers are your Data Centers
F5 Ecosystem | 06/22/2021

F5 Silverline: Our Data Centers are your Data Centers

Customers count on F5 Silverline Managed Security Services to secure their digital assets, and in order for us to deliver a highly dependable service at global scale we host our infrastructure in the most reliable and well-connected locations in the world. And when F5 needs reliable and well-connected locations, we turn to Equinix, a leading provider of digital infrastructure.

Volterra and the Power of the Distributed Cloud (Video)
F5 Ecosystem | 04/15/2021

Volterra and the Power of the Distributed Cloud (Video)

How can organizations fully harness the power of multi-cloud and edge computing? VPs Mark Weiner and James Feger join the DevCentral team for a video discussion on how F5 and Volterra can help.

Phishing Attacks Soar 220% During COVID-19 Peak as Cybercriminal Opportunism Intensifies
F5 Ecosystem | 12/08/2020

Phishing Attacks Soar 220% During COVID-19 Peak as Cybercriminal Opportunism Intensifies

David Warburton, author of the F5 Labs 2020 Phishing and Fraud Report, describes how fraudsters are adapting to the pandemic and maps out the trends ahead in this video, with summary comments.

The Internet of (Increasingly Scary) Things
F5 Ecosystem | 12/16/2015

The Internet of (Increasingly Scary) Things

There is a lot of FUD (Fear, Uncertainty, and Doubt) that gets attached to any emerging technology trend, particularly when it involves vast legions of consumers eager to participate. And while it’s easy enough to shrug off the paranoia that bots...

Deliver and Secure Every App
F5 application delivery and security solutions are built to ensure that every app and API deployed anywhere is fast, available, and secure. Learn how we can partner to deliver exceptional experiences every time.
Connect With Us
The Attack You Can’t Stop in Your Application | F5