CVE-2024-1635: Undertow: out-of-memory error after several closed connections with wildfly-http-client protocol
A vulnerability was found in Undertow. This vulnerability impacts a server that supports the wildfly-http-client protocol. Whenever a malicious user opens and closes a connection with the HTTP port of the server and then closes the connection immediately, the server will end with both memory and open file limits exhausted at some point, depending on the amount of memory available.
At HTTP upgrade to remoting, the WriteTimeoutStreamSinkConduit leaks connections if RemotingConnection is closed by Remoting ServerConnectionOpenListener. Because the remoting connection originates in Undertow as part of the HTTP upgrade, there is an external layer to the remoting connection. This connection is unaware of the outermost layer when closing the connection during the connection opening procedure. Hence, the Undertow WriteTimeoutStreamSinkConduit is not notified of the closed connection in this scenario. Because WriteTimeoutStreamSinkConduit creates a timeout task, the whole dependency tree leaks via that task, which is added to XNIO WorkerThread. So, the workerThread points to the Undertow conduit, which contains the connections and causes the leak.
Other sources
A vulnerability was found under the scope of Undertow. This vulnerability impacts a server that supports the wildfly-http-client protocol. Whenever a malicious user opens and close a connection with the HTTP port of the server and close the connection immediately, the server will end with both memory and open files limits exhausted at some point, depending on the amount of memory available.
At Http upgrade to remoting, WriteTimeoutStreamSinkConduit leaks connections if RemotingConnection is closed by Remoting ServerConnectionOpenListener Because the remoting connection originates in Undertow as part of the HTTP upgrade, we have an external layer to the remoting connection. This connection is unaware of the outermost layer when closing the connection during connection opening procedure, and hence the Undertow WriteTimeoutStreamSinkConduit is not notified of the connection being closed in this scenario. Because WriteTimeoutStreamSinkConduit creates a timeout task, the whole dependency tree leaks via that task, that is added to XNIO WorkerThread. So, the workerThread points to the Undertow conduit, that contains the connections and causes the leak.
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
maven/io.undertow:undertow-coreto a version that resolves this vulnerability.Fixed in 2.2.31.Final - Upgrade
Upgrade
maven/io.undertow:undertow-coreto a version that resolves this vulnerability.Fixed in 2.3.12.Final - Upgrade
Upgrade
redhat/undertowto a version that resolves this vulnerability.Fixed in 2.3.10. - Upgrade
Upgrade
redhat/undertowto a version that resolves this vulnerability.Fixed in 2.2.30.
Event History
Frequently Asked Questions
What is the severity of CVE-2024-1635?
CVE-2024-1635 is classified as a medium severity vulnerability impacting Undertow servers.
How do I fix CVE-2024-1635?
To mitigate CVE-2024-1635, upgrade Undertow to version 2.3.12.Final or higher if using Maven or 2.3.10 or higher for Red Hat packages.
What versions are affected by CVE-2024-1635?
CVE-2024-1635 affects Undertow versions up to 2.3.10 and 2.2.30, as well as specific vulnerable ranges of 2.2.31.Final and 2.3.0.Final to 2.3.12.Final.
What is the impact of CVE-2024-1635 on my server?
CVE-2024-1635 can lead to denial-of-service conditions, as a malicious user can manipulate HTTP connections.
Is CVE-2024-1635 publicly disclosed?
Yes, CVE-2024-1635 has been publicly disclosed and is referenced in various security advisories.