A single ordinary machine can take a web server offline without a flood of traffic, simply by opening connections and never quite finishing its requests. Slowloris is the best known of these "low and slow" denial of service attacks: it holds HTTP connections open by trickling incomplete headers until the server has no free connection slots left. Because the bandwidth is tiny and every packet is valid, volumetric DDoS protection and traffic graphs often miss it. This guide explains how the attack works, which server designs are more exposed, the exact timeout and connection settings that defend against it on common web servers, and how to detect it. It is for web operations, platform and network security engineers. Volumetric attacks and broader planning are covered in the DDoS Protection Guide, and wider application-layer denial of service in the Denial of Service at Application Layer Guide.
Key takeaways
- The target is connection capacity, not bandwidth. Slowloris wins when every worker slot or connection is held by a client that is sending almost nothing.
- Timeouts that measure progress are the core fix. A header deadline that cannot be extended forever, plus a minimum data rate, closes the gap the attack relies on (Apache
RequestReadTimeout, NGINXclient_header_timeout, Caddyread_header). - Buffering at a proxy or CDN moves the problem off the origin. A front end that receives the complete request before forwarding it means slow clients never occupy an application worker.
- Per-client connection limits help but are not enough. They stop one source; a distributed version needs rate-based timeouts and edge buffering as well.
- Watch connection states, not just requests per second. A rising count of connections stuck reading headers, with flat request throughput and many 408 responses, is the clearest signal.
What Slowloris is
Slowloris was published by Robert Hansen in June 2009 as a proof of concept, and MITRE CAPEC catalogues the technique as CAPEC-469 HTTP DoS. CAPEC describes it as the HTTP equivalent of a SYN flood: the attacker keeps HTTP sessions alive indefinitely and repeats that hundreds of times, so the server waits on the attacker while its connection threads are exhausted. In MITRE ATT&CK the behaviour sits under T1499.002 Service Exhaustion Flood, part of T1499 Endpoint Denial of Service.
It differs from an HTTP flood in one important way. A flood sends many complete requests and depends on volume. Slowloris sends very few bytes, deliberately never completes a request, and depends on the server being willing to wait. That makes it cheap for the attacker, quiet in network telemetry, and effective against servers that dedicate a scarce resource to each open connection.
How low and slow attacks work
This section explains the mechanism at the level a defender needs to configure limits. It does not describe tooling.
- Open many connections. The client opens a large number of TCP (often TLS) connections to the server, each one legitimate at the network layer.
- Start a request and stall. On each connection it sends the beginning of an HTTP request but never sends the blank line that ends the header block, so the server keeps waiting for the rest.
- Keep the connection looking alive. Every so often it sends another small header fragment, just before the server's idle timer would expire, which resets per-read timers on servers that only measure the gap between reads.
- Exhaust the pool. When every worker thread, process or connection slot is held this way, new legitimate clients queue or are refused, even though CPU, memory and bandwidth look normal.
Two variants apply the same idea to other phases of the request. In a slow POST (popularised as R.U.D.Y., "R U Dead Yet"), the headers complete but the request body is sent a byte at a time, so the server holds the connection while waiting for form data. In a slow read, described by Sergey Shekyan of Qualys in January 2012, the client sends a valid request and then reads the response very slowly by advertising a tiny TCP receive window, so the server's send buffer fills and the connection stays in the write state. Defences therefore need to cover the handshake, header, body and response phases, not just headers.
| Variant | Phase held open | What the server waits for | Primary control |
|---|---|---|---|
| Slowloris | Request headers | The end of the header block | Absolute or rate-based header read timeout |
| Slow POST (R.U.D.Y.) | Request body | The rest of the declared body | Body read timeout with a minimum data rate; body size limit |
| Slow read | Response | The client to accept response bytes | Write or send timeout; maximum connection lifetime; reject tiny TCP windows |
| Stalled TLS handshake | TLS negotiation | The client to finish the handshake | Handshake timeout (for example Apache handshake= stage) |
Which servers are susceptible
Susceptibility depends on the cost of an idle open connection, not on brand. Servers are listed alphabetically below and in the tables; the order is not a ranking.
- Connection-per-worker designs: where each open connection occupies a thread or process until the request is complete, the number of workers is the ceiling. A few hundred stalled connections can reach it. The Apache HTTP Server security tips note that a threaded MPM may allow more simultaneous connections and that the
eventMPM uses asynchronous processing to avoid devoting a thread to each connection. - Event-driven designs: servers built around an event loop hold an idle connection as a small amount of memory and a file descriptor, so the ceiling is much higher. They are not immune: file descriptor limits, memory and configured connection caps can still be reached, and long or missing timeouts still let connections live indefinitely.
- Application servers behind a proxy: an application server that is safe because a proxy buffers requests becomes exposed again the moment someone opens a path that bypasses the proxy, such as a direct origin IP or a debugging port.
- Defaults matter more than architecture: in the Qualys slow read research, the tested versions of Apache, lighttpd, NGINX and IIS 7.5 were all found vulnerable to slow read in their default configurations. Treat any server as exposed until its timeouts have been reviewed.
Mitigations at server, proxy and CDN layers
Defend in layers: tighten the origin so it fails safely, put a buffering proxy in front of it, and use the edge to absorb distributed versions. Hardening detail for each server is in the Apache HTTP Server Hardening Guide, Caddy Web Server Security Guide, HAProxy Hardening Guide and IIS Hardening Guide.
Server settings reference
| Server | Setting | Documented default | What it bounds |
|---|---|---|---|
| Apache HTTP Server | RequestReadTimeout (mod_reqtimeout) | handshake=0 header=20-40,MinRate=500 body=20,MinRate=500 | Time to complete the TLS handshake, headers and body; MinRate extends the deadline only while data arrives at the given bytes per second, up to the maximum |
| Apache HTTP Server | TimeOut, KeepAliveTimeout, LimitRequestFields, LimitRequestFieldSize, LimitRequestLine, LimitRequestBody, MaxRequestWorkers | See Apache core docs | General I/O wait, idle keep-alive, header and body size, worker ceiling |
| Caddy | servers > timeouts: read_header, read_body, write, idle | read_header 1m; read_body and write no timeout; idle 5m | Header and body read time, response write time, keep-alive idle time |
| IIS | <limits>: connectionTimeout, maxConnections | connectionTimeout 00:02:00; maxConnections 4294967295 | Inactive connections, including requests whose entity body has not arrived; per-site connection ceiling |
| NGINX | client_header_timeout, client_body_timeout, send_timeout, keepalive_timeout | 60s, 60s, 60s, 75s | Whole header (408 on expiry); gap between successive body reads; gap between successive writes; idle keep-alive |
| NGINX | limit_conn_zone with limit_conn | Not set; rejection status 503 (limit_conn_status) | Concurrent connections per key, such as client address |
Some practical points from the vendor documentation:
- Prefer rate-aware or absolute deadlines over per-read gaps: NGINX
client_body_timeoutandsend_timeoutmeasure the time between two successive operations, so a client that sends one byte just inside the window can keep a body upload or response alive. Pair them with body size limits and, where available, a maximum connection lifetime. Apache'sheader=20-40,MinRate=500form shows the pattern: a base deadline, extension only for real progress, and a hard cap. - Know what connection limits count: the NGINX documentation states that
limit_conncounts a connection only when it has a request being processed and the whole request header has been read. A Slowloris connection still sending headers is not yet counted, solimit_conncomplements header timeouts rather than replacing them. Uselimit_conn_dry_runto measure before enforcing. - Set explicit timeouts where the default is unlimited: Caddy documents no default timeout for
read_bodyandwrite. Set values that fit your largest legitimate upload and download. - Do not set the TLS handshake stage to unlimited on exposed listeners: Apache's default
handshake=0means no limit; the documentation's example useshandshake=5. - Cap worker counts to what memory allows: raising
MaxRequestWorkersor thread counts buys headroom, but the attacker can open more connections, so capacity alone is a delay, not a fix.
Reverse proxy buffering
The most robust structural fix is a front end that accepts the slow connection cheaply and only forwards a request to the application once it is complete. An event-driven reverse proxy or load balancer with full request buffering turns thousands of stalled clients into memory on the proxy rather than blocked workers on the origin. Apply the same timeouts on the proxy that you would on the origin, buffer request bodies where upload sizes allow, and make sure the origin accepts traffic only from the proxy (firewall or security group allow list, or mutual TLS) so the protection cannot be bypassed. See the API Gateway vs Reverse Proxy guide for where each component fits.
CDN and edge
A CDN or cloud DDoS service terminates client connections at the edge and buffers requests before they reach the origin, which absorbs distributed low and slow attacks that per-IP limits cannot. It only protects what is routed through it: hide or restrict the origin address, and review edge timeouts and connection limits rather than assuming defaults suit your application. See the CDN Security Guide and DDoS Protection vs WAF.
Network and operating system
The Apache security tips note that a firewall restricting simultaneous connections from one IP address or network often stops simple attacks, though it does not help against distributed attacks. Raise file descriptor limits so an event-driven server is not capped artificially, and consider the Qualys recommendation to reject connections advertising abnormally small TCP windows, after testing that legitimate mobile clients are not affected.
Choosing controls: small and large estates
| Situation | First control | Add next | Trade-off |
|---|---|---|---|
| Single server, small site | Header and body timeouts with a minimum rate; firewall per-IP connection cap | A CDN or managed proxy in front | Aggressive timeouts can cut off users on very poor connections |
| Connection-per-worker origin you cannot replace | Buffering reverse proxy in front; lock origin to proxy only | Edge buffering for distributed attacks | Extra hop and configuration to keep in step |
| Large estate behind CDN and load balancers | Consistent timeout baseline across edge, proxy and origin, enforced as code | Connection state monitoring and alerting per tier | Large uploads and streaming endpoints need documented exceptions |
| APIs with long-lived streams (WebSocket, server-sent events) | Separate listeners or locations with their own limits | Authentication before the long-lived phase | Global short timeouts would break legitimate streams |
Rolling out the controls
- Inventory exposed listeners: list every internet-facing HTTP endpoint, including origins that should sit behind a CDN, and record the server, worker model and current timeout values.
- Measure normal behaviour: capture the distribution of request header time, upload duration, response size and connection lifetime for a week, so limits are set from data rather than guesses.
- Set limits in observe mode first: where a dry run exists (NGINX
limit_conn_dry_run), enable it; elsewhere apply new timeouts to a staging or canary pool and watch 408 rates and user complaints. - Enforce on the edge and proxy, then the origin: start where buffering gives the most protection, then tighten origin settings as a backstop.
- Test against a slow client in an authorised environment: run approved slow header, slow body and slow read tests against staging and confirm connections are closed at the expected times and the service stays available.
- Keep rollback simple: manage timeouts as configuration in version control so a change can be reverted in minutes if legitimate uploads or long polls fail.
- Add to the response plan: document who can tighten limits during an attack and how to engage the CDN provider. See the DDoS Response Playbook and the DDoS Readiness Checklist.
Detection signals
Low and slow attacks rarely show as a traffic spike, so look at connection state and request completion.
- Connection states: a growing number of open connections in the reading-request state (Apache
mod_statusshows per-worker states), or established TCP connections that far exceed requests per second. - Worker saturation: busy workers at or near
MaxRequestWorkersor the thread pool limit while CPU and bandwidth stay low. - Timeout responses: a rise in HTTP 408 Request Timeout responses (NGINX returns 408 when
client_header_timeoutorclient_body_timeoutexpire), and in 503 responses fromlimit_connrejections. - Few sources, many connections: a small number of client addresses each holding dozens or hundreds of connections, or many sources each holding connections with almost no bytes transferred.
- Synthetic checks failing first: external uptime probes timing out on connect or first byte while internal health checks still pass.
Metrics that show the controls work
- Peak concurrent connections as a percentage of the configured worker or connection ceiling (target: a comfortable margin under attack tests).
- Median and 99th percentile time to receive complete request headers.
- Count of 408 responses per hour, with alerts on sudden change.
- Maximum connections held by a single client address.
- Time from alert to applied mitigation during exercises.
- Percentage of internet-facing origins reachable only through the proxy or CDN.
Framework mapping
| Framework | Reference | Relevance |
|---|---|---|
| MITRE ATT&CK | T1499.002 Service Exhaustion Flood | Exhausting a network service such as a web server |
| MITRE CAPEC | CAPEC-469 HTTP DoS | Keeping HTTP sessions alive to exhaust connection threads |
| NIST SP 800-53 Rev 5 | SC-5 Denial-of-service Protection; SC-10 Network Disconnect; SC-7 Boundary Protection; SI-4 System Monitoring | Limits and buffering, closing inactive connections, edge controls, monitoring |
| NIST CSF 2.0 | PR.IR-03; PR.IR-04; DE.CM-01; RS.MI-01 | Resilience mechanisms, capacity, network monitoring, containment |
Common failure patterns
- Relying on volumetric protection alone: scrubbing services tuned for bandwidth floods may pass a few kilobits of valid but stalled requests straight to the origin.
- Origin reachable directly: the CDN buffers requests, but the origin IP is in old DNS records or certificates, so the attacker connects to it and bypasses every edge control.
- Per-read timeouts treated as total limits: a 60 second gap timer looks strict but allows a connection to live for hours if one byte arrives each minute.
- Raising worker counts as the fix: more workers raise memory use and only move the threshold the attacker has to reach.
- One global timeout for everything: a short timeout breaks large uploads or streaming endpoints, the change is reverted, and the site ends up with no protection. Use per-location limits instead.
- No connection-state monitoring: dashboards show requests per second, which stays flat during the attack, so the outage is diagnosed late.
Practitioner checklist
- Inventory every internet-facing HTTP listener and its worker model and timeouts.
- Set header read deadlines with a hard cap and a minimum data rate where the server supports it.
- Set body read and response write timeouts, and body size limits, sized from measured legitimate use.
- Set a TLS handshake timeout on exposed listeners.
- Put a buffering reverse proxy or CDN in front of connection-per-worker origins.
- Restrict origins so they accept traffic only from the proxy or CDN.
- Apply per-client connection limits, tested first in observe mode.
- Monitor connection states, worker saturation and 408 rates, with alerts.
- Run authorised slow-client tests in staging after every timeout change.
- Document limit changes and provider escalation in the DDoS response plan.
Standards and references
- MITRE: CAPEC-469 HTTP DoS
- MITRE ATT&CK: T1499.002 Service Exhaustion Flood
- Apache HTTP Server: mod_reqtimeout
- Apache HTTP Server: Security Tips
- Caddy: Global options (server timeouts)
- Microsoft Learn: IIS Default Limits for a Web Site
- NGINX: ngx_http_core_module
- NGINX: ngx_http_limit_conn_module
Related NHI Mgmt Group resources: DDoS Protection Guide · Denial of Service at Application Layer Guide · HTTP/2, HTTP/3 and QUIC Security Guide · DDoS Response Playbook