-
-
Notifications
You must be signed in to change notification settings - Fork 16k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
max_window_bits is inclusive of 8 for WebSocket permessage-deflate compression #8702
Comments
This is because of the following check in netty/codec/src/main/java/io/netty/handler/codec/compression/JZlibEncoder.java Lines 125 to 128 in fa84e2b
That because of a similar check in jzlib: But the window size from the range 8..15 is supported in zlib: I created an issue in jzlib on this even though the project does not seem to be maintained: |
Interesting thoughts about this situation: https://github.com/faye/permessage-deflate-node/wiki/Denial-of-service-caused-by-invalid-windowBits-parameter-passed-to-zlib.createDeflateRaw()
|
@uzador Hello, I didn't look deeply what can be done on the Netty side. |
Expected behavior
It should be possible to have the window size for permessage-deflate compression as 8 according to the spec: https://tools.ietf.org/html/draft-ietf-hybi-permessage-compression-13#section-8.1.2
Actual behavior
Though it is allowed the encoding of a WebSocket frame when the window size is 8 fails:
Steps to reproduce
Create a client implementation as in the following project:
https://github.com/riyafa/netty-websocket-compression.git
Note that I am using a custom
WebSocketClientCompressionHandler
Use the autobahn testsuite and run the server. Use the following content in the fuzzingserver.json file:
Simply run the main method of the
WebSocketClient
after starting the autobahn server.If using any other server the response from server should be something similar to the following:
with client_max_window_bits=8
Minimal yet complete reproducer code (or URL to code)
https://github.com/riyafa/netty-websocket-compression.git
Netty version
4.1.32.Final
JVM version (e.g.
java -version
)1.8.0_191
OS version (e.g.
uname -a
)Ubuntu 18.10
The text was updated successfully, but these errors were encountered: