Headline
CVE-2021-3690: [UNDERTOW-1935] buffer leak on incoming websocket PONG message
A flaw was found in Undertow. A buffer leak on the incoming WebSocket PONG message may lead to memory exhaustion. This flaw allows an attacker to cause a denial of service. The highest threat from this vulnerability is availability.
If websocket endpoint did not added the handler for PongMessage and sends the PING messages.
On unconfigured wildfly it leads to “XNIO001007: A channel event listener threw an exception: java.lang.OutOfMemoryError: Direct buffer memory” errors in server.log and server eventually stops servicing any requests (not only websocket connections).
After configuring Byte Buffer Pool with Leak detection percent = 100, every gc leads to the following messages in log (one message per single PONG frame):
2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) java.lang.Throwable: Buffer leak detected 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.server.DefaultByteBufferPool$LeakDetector.<init>(DefaultByteBufferPool.java:314) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.server.DefaultByteBufferPool$LeakDetector.<init>(DefaultByteBufferPool.java:308) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.server.DefaultByteBufferPool$DefaultPooledBuffer.<init>(DefaultByteBufferPool.java:254) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.server.DefaultByteBufferPool.allocate(DefaultByteBufferPool.java:157) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.websockets.core.BufferedBinaryMessage.read(BufferedBinaryMessage.java:90) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.websockets.core.AbstractReceiveListener.readBufferedBinary(AbstractReceiveListener.java:124) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.websockets.core.AbstractReceiveListener.bufferFullMessage(AbstractReceiveListener.java:94) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.websockets.core.AbstractReceiveListener.onPong(AbstractReceiveListener.java:66) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.websockets.core.AbstractReceiveListener.handleEvent(AbstractReceiveListener.java:46) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.websockets.core.AbstractReceiveListener.handleEvent(AbstractReceiveListener.java:33) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.server.protocol.framed.AbstractFramedChannel$FrameReadListener.handleEvent(AbstractFramedChannel.java:952) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at io.undertow.server.protocol.framed.AbstractFramedChannel$FrameReadListener.handleEvent(AbstractFramedChannel.java:932) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89) 2021-07-30 23:04:28,400 ERROR [stderr] (Finalizer) at org.xnio.nio.WorkerThread.run(WorkerThread.java:591)
Related news
Buffer leak on incoming WebSocket PONG message(s) in Undertow before 2.0.40 and 2.2.10 can lead to memory exhaustion and allow a denial of service.
Vulnerability in the Oracle Java SE, Oracle GraalVM Enterprise Edition product of Oracle Java SE (component: JNDI). Supported versions that are affected are Oracle Java SE: 7u331, 8u321, 11.0.14, 17.0.2, 18; Oracle GraalVM Enterprise Edition: 20.3.5, 21.3.1 and 22.0.0.2. Easily exploitable vulnerability allows unauthenticated attacker with network access via multiple protocols to compromise Oracle Java SE, Oracle GraalVM Enterprise Edition. Successful attacks of this vulnerability can result in unauthorized update, insert or delete access to some of Oracle Java SE, Oracle GraalVM Enterprise Edition accessible data. Note: This vulnerability applies to Java deployments, typically in clients running sandboxed Java Web Start applications or sandboxed Java applets, that load and run untrusted code (e.g., code that comes from the internet) and rely on the Java sandbox for security. This vulnerability can also be exploited by using APIs in the specified Component, e.g., through a web service ...
This advisory resolves CVE issues filed against XP2 releases that have been fixed in the underlying EAP 7.3.x base. There are no changes to the EAP XP2 code base. NOTE: This advisory is informational only. There are no code changes associated with it. No action is required. Red Hat Product Security has rated this update as having a security impact of Important. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available for each vulnerability from the CVE link(s) in the References section.This content is licensed under the Creative Commons Attribution 4.0 International License (https://creativecommons.org/licenses/by/4.0/). If you distribute this content, or a modified version of it, you must provide attribution to Red Hat Inc. and provide a link to the original. Related CVEs: * CVE-2021-3597: undertow: HTTP2SourceChannel fails to write final frame under some circumstances may lead to DoS * CVE-2021-3644: wildfly-core: Invalid Sensitiv...
An update is now available for Red Hat support for Spring Boot. Red Hat Product Security has rated this update as having a security impact of Important. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available for each vulnerability. For more information, see the CVE links in the References section.This content is licensed under the Creative Commons Attribution 4.0 International License (https://creativecommons.org/licenses/by/4.0/). If you distribute this content, or a modified version of it, you must provide attribution to Red Hat Inc. and provide a link to the original. Related CVEs: * CVE-2020-27782: undertow: special character in query results in server errors * CVE-2021-3690: undertow: buffer leak on incoming websocket PONG message may lead to DoS * CVE-2021-24122: tomcat: Information disclosure when using NTFS file system * CVE-2021-25122: tomcat: Request mix-up with h2c * CVE-2021-25329: tomcat: Incomplete fix for CVE-2020-9...