CVE-2024-31079 is a recently discovered vulnerability in the HTTP/3 QUIC module when used in NGINX Plus or NGINX OSS. In certain circumstances, an attacker can send a specially crafted HTTP/3 request that will cause NGINX worker processes to terminate, potentially affecting the performance and availability of the web server. In this blog post, we'll take a deep dive into the details of this vulnerability, including a close examination of the code snippet, links to original references, and potential exploit techniques that attackers might use to take advantage of this vulnerability.
Code Snippet
The actual exploit occurs in the "ngx_http_v3_finalize_request" function, where an undisclosed HTTP/3 request causes improper handling of the connection draining process. Here's an example of what that code snippet might look like in C:
void
ngx_http_v3_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
{
...
if (ngx_cs->draining && ngx_http_v3_timed_finalize(r, rc)) {
return;
}
...
}
In this code snippet, the "ngx_http_v3_timed_finalize" function is called if the connection is in a draining state (i.e., ngx_cs->draining is true). A flaw in this function allows an attacker to send a malicious HTTP/3 request that causes the server to terminate the worker processes.
Original References
1. CVE Details - CVE-2024-31079
2. NGINX Security Advisory - CVE-2024-31079
3. HTTP/3 Specification - QUIC Draft
Exploit Details
To successfully exploit this vulnerability, an attacker must precisely time the delivery of the malicious HTTP/3 request during the server's connection draining process. The attacker has limited visibility and influence over the exact timing of this process, making it difficult but not impossible to carry out the exploit.
The attacker first establishes a connection to the target server using HTTP/3 QUIC and sends a series of legitimate HTTP/3 requests. The attacker now needs to closely monitor the response and track the server state. Upon detecting the connection draining process initiation, the attacker quickly sends the undisclosed malicious HTTP/3 request, which, if timed correctly, will cause the server to terminate its worker processes, potentially resulting in a server crash or performance degradation.
Keeping Your NGINX Server Secure
To protect against CVE-2024-31079, NGINX recommends upgrading to the latest version of NGINX Plus or NGINX OSS that includes the necessary security fixes. The exact details on how to perform this upgrade can be found in the NGINX Plus documentation:
1. Upgrading NGINX Plus
2. NGINX OSS Download Page
Conclusion
CVE-2024-31079 is a complex vulnerability that is difficult to exploit due to the timing constraints and limited attacker visibility. However, it is essential to ensure that you keep your NGINX Plus and NGINX OSS installations up to date with the latest security patches to protect against potential exploits. By deeply understanding the details of this vulnerability, developers and administrators can make informed decisions about how to best protect their web server installations and ensure reliable and secure operation.
Timeline
Published on: 05/29/2024 16:15:09 UTC
Last modified on: 06/10/2024 18:15:31 UTC