]
Juho Tykkälä commented on JBWEB-317:
------------------------------------
Original bug fixed at 2018-08-08 06:34:22 UTC
Fixed in:
- trunk for 9.0.11 onwards
- 8.5.x for 8.5.33 onwards
- 7.0.x for 7.0.91 onwards
WsWebSocketContainer#connectToServer throws BufferOverflowException
-------------------------------------------------------------------
Key: JBWEB-317
URL:
https://issues.redhat.com/browse/JBWEB-317
Project: JBoss Web
Issue Type: Bug
Components: Tomcat
Affects Versions: JBossWeb-7.5.0.GA
Reporter: Juho Tykkälä
Assignee: Remy Maucherat
Priority: Major
Labels: WebSocket, jbossweb, tomcat, websocket, websockets
WsWebSocketContainer#connectToServer throws BufferOverflowException when headers supplied
by ClientEndpointConfig.Configurator#beforeRequest are too large.
{code:java}
Exception in thread "main" java.nio.BufferOverflowException
at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:189)
at java.nio.ByteBuffer.put(ByteBuffer.java:859)
at
org.apache.tomcat.websocket.WsWebSocketContainer.addHeader(WsWebSocketContainer.java:755)
at
org.apache.tomcat.websocket.WsWebSocketContainer.createRequest(WsWebSocketContainer.java:736)
at
org.apache.tomcat.websocket.WsWebSocketContainer.connectToServerRecursive(WsWebSocketContainer.java:275)
at
org.apache.tomcat.websocket.WsWebSocketContainer.connectToServer(WsWebSocketContainer.java:195)
{code}
In our application, we are forwarding an Authorization header/token of close to 4000
bytes, which when combined with other headers results in a request larger than the 4096
allocated to the ByteBuffer in WsWebSocketContainer#createRequest.
Original bug at Apache BugZilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=62596