cole-bq commented on code in PR #1838:
URL: https://github.com/apache/tinkerpop/pull/1838#discussion_r1029815951


##########
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WebSocketChannelizer.java:
##########
@@ -108,7 +109,7 @@ public void configure(final ChannelPipeline pipeline) {
                 
closeOnProtocolViolation(false).allowExtensions(true).maxFramePayloadLength(settings.maxContentLength).build();
         pipeline.addLast(PIPELINE_REQUEST_HANDLER, new 
WebSocketServerProtocolHandler(GREMLIN_ENDPOINT,
                 null, false, false, 10000L, wsDecoderConfig));
-
+        pipeline.addLast("ws-user-agent-handler", new WsUserAgentHandler());

Review Comment:
   Unfortunately I'm not sure this reordering is possible without substantial 
change. The user agent handler triggers on a HandShake.Complete event right as 
the handshake is finishing. The authentication and authorization handlers take 
effect after the handshake is finished. Since the user agent is sent as an http 
header though, it is limited by MaxHeaderSize which defaults to 8192. This 
should be sufficient protection against maliciously large headers being sent 
from unauthenticated users. I will add a test which confirms this behavior.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to