-
Threat: HTTP/2 Rapid Reset Denial of Service (CVE-2023-44487)
- Description: If HTTP/2 is enabled, an attacker sends a stream of requests and immediately resets them using the RST_STREAM frame. This exploits a flaw in how httpd handles these resets, leading to excessive resource consumption.
- Impact: Denial of service; the website becomes unavailable. Server CPU and potentially memory are exhausted.
- Affected Component:
mod_http2
(the HTTP/2 module). - Risk Severity: Critical (if HTTP/2 is enabled and unpatched).
- Mitigation Strategies:
- Update httpd: Apply the patch that addresses CVE-2023-44487. This is the most important mitigation.
- Disable HTTP/2 (if not essential): If HTTP/2 is not strictly required, disabling it eliminates the vulnerability. This can be done by not loading
mod_http2
. - WAF (limited effectiveness): Some WAFs may offer partial mitigation, but updating httpd is crucial.
Threat: Slowloris Denial of Service
-
Threat: Slowloris Denial of Service
- Description: An attacker opens numerous connections to the Apache server but sends data extremely slowly (or not at all after the initial request). This keeps connections open and consumes server resources (threads/processes), preventing legitimate users from connecting. The attacker doesn't need significant bandwidth.
- Impact: Denial of service; the website becomes unavailable to legitimate users. Server resources are exhausted.
- Affected Component: Core httpd connection handling; potentially exacerbated by modules that hold connections open (e.g., modules that wait for long-running processes). Specifically, the way Apache handles worker threads/processes and their allocation to connections.
- Risk Severity: High (can easily render a server unresponsive with minimal attacker resources).
- Mitigation Strategies:
- Use
mod_reqtimeout
: Configure this module to set timeouts for receiving request headers and bodies. This is the primary defense. - Tune connection limits: Carefully configure
MaxRequestWorkers
,ThreadsPerChild
,KeepAliveTimeout
, andTimeout
. LoweringKeepAliveTimeout
can help, but balance this against performance for legitimate users. - Use a reverse proxy: A reverse proxy (like Nginx) can often handle Slowloris attacks more effectively than Apache alone.
- Employ a WAF: A Web Application Firewall can detect and block Slowloris-like behavior.
- Use
Threat: .htaccess File Exposure
-
Threat: .htaccess File Exposure
- Description: If misconfigured,
.htaccess
files (which contain per-directory configuration directives) can be directly accessed by attackers via a web browser. These files can reveal sensitive configuration settings, including access control rules, rewrite rules, and potentially even database credentials (if poorly configured). - Impact: Information disclosure; attackers gain access to sensitive configuration details, which can be used to further compromise the server.
- Affected Component: Core httpd configuration; specifically, the handling of
.htaccess
files and theAllowOverride
directive. - Risk Severity: High (can reveal critical configuration information).
- Mitigation Strategies:
- Ensure proper
AllowOverride
settings: The default configuration usually protects.htaccess
files. Avoid usingAllowOverride All
unless absolutely necessary. Use more specificAllowOverride
options (e.g.,AllowOverride AuthConfig Limit
). - Verify file permissions: Ensure that
.htaccess
files have appropriate file system permissions (typically 644) and are owned by the correct user. - Centralize configuration (if possible): Avoid using
.htaccess
files altogether by placing configuration directives in the main server configuration files. This is generally more secure and performant.
- Ensure proper
- Description: If misconfigured,
Threat: Weak SSL/TLS Configuration
-
Threat: Weak SSL/TLS Configuration
- Description: The server is configured to use outdated or insecure SSL/TLS protocols (e.g., SSLv2, SSLv3) or weak cipher suites. An attacker can perform a man-in-the-middle attack, decrypting or modifying the traffic between the client and the server.
- Impact: Loss of confidentiality and integrity of encrypted communications. Attackers can steal sensitive data (passwords, credit card numbers, etc.) or inject malicious content.
- Affected Component:
mod_ssl
(the SSL/TLS module); configuration directives related to SSL/TLS (e.g.,SSLCipherSuite
,SSLProtocol
). - Risk Severity: High (compromises the security of encrypted connections).
- Mitigation Strategies:
- Disable outdated protocols: Use
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
to enable only TLS 1.2 and TLS 1.3. - Use strong cipher suites: Configure
SSLCipherSuite
to use only strong, modern cipher suites. Consult security best practices (e.g., Mozilla's SSL Configuration Generator) for recommended cipher suites. - Enable HSTS (HTTP Strict Transport Security): Use the
Strict-Transport-Security
header to force browsers to always connect to the server over HTTPS. - Use a valid and trusted certificate: Obtain a certificate from a reputable Certificate Authority (CA).
- Regularly review and update SSL/TLS configuration: Stay informed about new vulnerabilities and best practices.
- Disable outdated protocols: Use
Threat: Misconfigured CGI Scripts
-
Threat: Misconfigured CGI Scripts
- Description: If CGI scripts are enabled, and a CGI script itself has vulnerabilities (e.g., command injection, shell injection), an attacker can exploit these vulnerabilities to execute arbitrary commands on the server. This is often due to flaws within the CGI script, but httpd's configuration enables the execution.
- Impact: Remote code execution; complete server compromise. The attacker gains control of the server with the privileges of the user running the httpd process (or the user configured with
suexec
). - Affected Component:
mod_cgi
ormod_cgid
(the CGI modules); configuration directives related to CGI execution (e.g.,ScriptAlias
,AddHandler
). - Risk Severity: Critical (can lead to complete server compromise).
- Mitigation Strategies:
- Avoid CGI scripts if possible: Use more secure alternatives like FastCGI (e.g., with PHP-FPM), WSGI (for Python), or server-side modules.
- Secure CGI scripts: If CGI is unavoidable, ensure that the scripts themselves are secure and follow secure coding practices. Sanitize all user input.
- Use
ScriptAlias
carefully: Restrict CGI execution to specific directories usingScriptAlias
. - Run CGI scripts with minimal privileges: Use
suexec
to run CGI scripts under different user accounts, limiting the damage an attacker can do. - Regularly audit CGI scripts: Review the code of CGI scripts for vulnerabilities.
-
Threat: Vulnerability in Third-Party Module leading to RCE.
- Description: A third-party Apache module contains a security vulnerability, such as a buffer overflow or similar, that allows remote code execution. An attacker exploits this vulnerability to gain control of the httpd process and execute arbitrary code.
- Impact: Remote code execution and complete server compromise. The attacker gains control of the server.
- Affected Component: The specific vulnerable third-party module.
- Risk Severity: Critical (can lead to complete server compromise).
- Mitigation Strategies:
- Use only trusted modules: Download modules only from reputable sources.
- Keep modules updated: Regularly check for updates to all installed modules and apply them promptly.
- Review module code (if possible): If the module is open-source, review the code for potential vulnerabilities.
- Run httpd with minimal privileges: Use a dedicated user account with limited file system access to run httpd.
- Disable unnecessary modules: Only load modules that are absolutely necessary.
- Sandboxing (advanced): Consider using techniques like sandboxing or containerization to isolate httpd processes.