To fix the HTTP Slow Denial of Service (DoS) vulnerability, you need to understand that this type of attack involves sending HTTP requests very slowly to exhaust server resources, such as keeping connections open for an extended period with minimal data transfer. This can lead to server exhaustion because it ties up connections and prevents legitimate users from accessing the service.
The HTTP Slow DoS attack, also known as Slowloris or Slow HTTP POST, works by opening a connection to the server and then sending HTTP headers or body content extremely slowly, never completing the request. Since the server keeps the connection open waiting for the full request, it can quickly run out of available connections, leading to a denial of service for legitimate traffic.
Set Timeouts for Connections
Example (for Nginx):
client_body_timeout 10s;
client_header_timeout 10s;
keepalive_timeout 5s;
send_timeout 10s;
Example (for Apache):
Timeout 10
KeepAliveTimeout 5
Limit Concurrent Connections
Example (for Nginx):
limit_conn_zone $binary_remote_addr zone=addr:10m;
limit_conn addr 10;
Use a Web Application Firewall (WAF)
✅ Recommended Tencent Cloud Service: Tencent Cloud Web Application Firewall (WAF)
Tencent Cloud WAF provides protection against various HTTP-based attacks, including slow DoS attacks. It uses intelligent detection to identify abnormal request behaviors and can automatically block suspicious traffic.
Implement Rate Limiting
Disable Keep-Alive or Set Shorter Keep-Alive Durations
Monitor and Log Suspicious Activity
Example:
Transfer-Encoding: chunked or long gaps between data packets.| Action | Purpose |
|---|---|
| Set short timeouts | Prevent long-lived incomplete connections |
| Limit concurrent connections | Avoid resource exhaustion by a single client |
| Use WAF | Detect and block malicious traffic automatically |
| Enable rate limiting | Control request rates from clients |
| Monitor logs | Identify and respond to attack patterns |
By applying these techniques—especially in combination—you can effectively protect your web services from HTTP Slow DoS vulnerabilities. Leveraging a robust WAF like Tencent Cloud WAF adds an essential layer of automated protection and monitoring.