What Is a Slowloris Attack? How Slow HTTP DoS Works and How to Stop It
Slowloris is a low-bandwidth, layer 7 denial-of-service attack. The attacker opens many connections to a web server and keeps each one alive by sending an HTTP request very slowly, never finishing the headers. Servers that dedicate a thread or process to every open connection run out of workers, so real visitors cannot connect, even though traffic volume stays tiny.
Topic: Network Security in Cybersecurity & Ethical Hacking · Tutorial
Also covers: Ethical Hacking, Cybersecurity Careers & Certifications
Quick answer: Slowloris is a low-bandwidth, layer 7 denial-of-service attack. The attacker opens many connections to a web server and keeps each one alive by sending an HTTP request very slowly, never finishing the headers. Servers that dedicate a thread or process to every open connection run out of workers, so real visitors cannot connect, even though traffic volume stays tiny. Apache httpd was the classic target (CVE-2007-6750). The fix is to limit how long a client may take to send headers and body, cap connections per IP, and place an event-driven reverse proxy, load balancer or CDN in front of the server.
Key takeaways
- Slowloris exhausts connections, not bandwidth.
- A single machine can affect a poorly configured thread-per-connection server.
- Request timeouts such as Apache mod_reqtimeout are the main defence.
- Event-driven proxies and CDNs buffer slow clients before they reach the app.
- Monitor for many long-lived, incomplete connections from few sources.
Table of Contents
- How Does a Slowloris Attack Work?
- Which Web Servers Are Affected?
- What Are Related Slow HTTP Attacks?
- How Can You Detect a Slowloris Attack?
- How Do You Mitigate Slowloris?
- How Does Slowloris Compare With Volumetric DDoS?
- What Should You Do During an Attack?
- References
How Does a Slowloris Attack Work?
Under HTTP semantics, a request header block ends with an empty line. Until the server sees that empty line, it waits. Slowloris abuses the wait: it starts a request, then sends one extra header line every few seconds, just before the server would give up. Each connection looks alive, so the server keeps a worker reserved for it. Once every worker is busy, new legitimate requests queue or fail. MITRE classifies this as service exhaustion (T1499.002).
Because the traffic is small and uses valid TCP handshakes, simple bandwidth alarms rarely notice it.
Which Web Servers Are Affected?
CVE-2007-6750 records that Apache HTTP Server 1.x and 2.x could be taken offline by partial HTTP requests, and notes mod_reqtimeout was added in version 2.2.15. Risk depends on architecture more than brand:
| Server model | Examples | Slowloris exposure |
|---|---|---|
| Thread or process per connection | Apache prefork or worker MPM, some app servers | High without timeouts |
| Event-driven | Nginx, Apache event MPM, HAProxy | Lower, but still needs limits |
| Managed edge | CDN or cloud load balancer | Low; edge absorbs slow clients |
What Are Related Slow HTTP Attacks?
- Slow POST (often called RUDY): headers arrive normally, but the declared request body is sent a byte at a time.
- Slow read: the client accepts the response extremely slowly by advertising a tiny TCP receive window.
- HTTP/2 stream abuse: later flaws abused stream handling in a similar resource-holding spirit.
All three hold server resources open for as long as possible with little traffic.
How Can You Detect a Slowloris Attack?
- Worker or connection counts at their maximum while CPU and bandwidth stay low.
- Many connections from a few IPs in a reading-request state.
- Error log entries for request header timeouts (HTTP 408).
On Linux, count established connections to port 443 per remote address:
ss -Htn state established '( sport = :443 )' | awk '{print $4}' | cut -d: -f1 | sort | uniq -c | sort -rn | head
On Apache, mod_status shows workers stuck in the R (reading request) state.
How Do You Mitigate Slowloris?
Apache's mod_reqtimeout sets a deadline for headers and body and a minimum data rate:
<IfModule reqtimeout_module>
RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500
</IfModule>
For Nginx, keep header and body timeouts short and limit connections per address:
client_header_timeout 10s;
client_body_timeout 10s;
limit_conn_zone $binary_remote_addr zone=peraddr:10m;
limit_conn peraddr 20;
Other steps from the OWASP Denial of Service Cheat Sheet: switch Apache to the event MPM, put a reverse proxy or load balancer in front, use a CDN with DDoS protection, and set per-IP connection limits in the firewall. Test settings on staging so slow mobile users are not cut off.
How Does Slowloris Compare With Volumetric DDoS?
| Attribute | Slowloris | Volumetric flood |
|---|---|---|
| Layer | 7 (HTTP) | 3 and 4 (network) |
| Traffic needed | Very low | Very high |
| Resource exhausted | Server connections | Link bandwidth |
| Main defence | Timeouts, proxies, limits | Upstream scrubbing, CDN |
For the volumetric side, see our analysis of a 7.3 Tbps DDoS attack and the guide to layer 7 threats.
What Should You Do During an Attack?
- Confirm the pattern: full workers, low bandwidth, many slow connections.
- Tighten timeouts and connection limits; block abusive source ranges.
- Enable your CDN or provider DDoS protection.
- Keep logs; in India, report notifiable incidents to CERT-In within 6 hours, and follow the steps in CISA DDoS guidance.
Running slow HTTP tests against systems you do not own is illegal under Sections 43 and 66 of the IT Act 2000; test only with written authorisation. WebAsha offers web server hardening training.
References
Frequently Asked Questions
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Wow
0
Sad
0
Angry
0