[jboss-jira] [JBoss JIRA] (JBWEB-317) WsWebSocketContainer#connectToServer throws BufferOverflowException

Juho Tykkälä (Jira) issues at jboss.org
Thu Mar 5 06:30:19 EST 2020


Juho Tykkälä created JBWEB-317:
----------------------------------

             Summary: 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


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



--
This message was sent by Atlassian Jira
(v7.13.8#713008)



More information about the jboss-jira mailing list