WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
202401
REGRESSION (Safari 13): WebSocket payload is truncated when x-webkit-deflate-frame is used
https://bugs.webkit.org/show_bug.cgi?id=202401
Summary
REGRESSION (Safari 13): WebSocket payload is truncated when x-webkit-deflate-...
Volodymyr Sorokin
Reported
2019-10-01 06:03:40 PDT
Since Safari 13.0 release, webkit starts to truncate websocket's payload to 4092 bytes when 'x-webkit-deflate-frame' extension is used. The issue is fairly easy to reproduce - just send to a websocket any data whose compressed size is 5kb or more. Moreover, the websocket (most likely the deflator component) on the browser side also gets 'corrupted' once a large message is sent. This leads to a 'Failed to compress frame' error in console on subsequent attempts to send more messages (even small messages) to the socket. This behavior is only reproducible when 'x-webkit-deflate-frame' extension enabled. If server rejects the extension - then browser behaves correctly and the payload does not get truncated, but obviously the compression is not used in this case. Safari 12 does not have this issue. In Safari 12 the 'x-webkit-deflate-frame' extension behaves as expected and large payload does not get truncated.
Attachments
Patch
(5.71 KB, patch)
2019-11-22 01:08 PST
,
youenn fablet
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2019-10-02 13:43:02 PDT
Thank you for the report! Do you have a live website that we could reproduce this?
Radar WebKit Bug Importer
Comment 2
2019-10-02 13:43:16 PDT
<
rdar://problem/55922632
>
Volodymyr Sorokin
Comment 3
2019-10-03 06:55:11 PDT
I wasn't able to find a public working websocket server that supports 'permessage-deflate' extension. But I created a simple server on java to reproduce the issue: 1) Clone it from
https://github.com/vlsorokin/websocket-sandbox
2) Run server
> mvn compile exec:java
3) To run client open this jsfiddle in Safari 13:
http://jsfiddle.net/sorrro/8b3yawod/
4) Click - Connect, Send short text, Send large text, Send short text This will send to a websocket a random string of 10 characters, then a random string of 10,000 characters, then 10 characters again 5) You will notice an error in console saying: 'Failed to compress frame' 6) Server logs will indicate that the server has not received less than 10,000 characters 7) If you inspect traffic with Wireshark you may notice that in Safari 13, a large frame gets truncated to 4092 bytes and the second short message does not get sent. At the same time, these steps work fine in Chrome.
Alexey Proskuryakov
Comment 4
2019-10-03 09:13:38 PDT
Thank you. More direct steps to reproduce would help (it's unlikely that anyone here has JDK installed), but we can probably figure it out. Sadly, we had a test for deflate fail for a long time: ../OpenSource/LayoutTests/platform/win/TestExpectations:3177:http/tests/websocket/tests/hybi/deflate-frame-parameter.html [ Failure ] ../OpenSource/LayoutTests/platform/ios/TestExpectations:2886:# <
rdar://problem/33630526
> http/tests/websocket/tests/hybi/deflate-frame-parameter.html is failing on iOS 11 ../OpenSource/LayoutTests/platform/ios/TestExpectations:2887:http/tests/websocket/tests/hybi/deflate-frame-parameter.html [ Failure ] ../OpenSource/LayoutTests/platform/mac/TestExpectations:1569:[ HighSierra+ ] http/tests/websocket/tests/hybi/deflate-frame-parameter.html [ Failure ] ../OpenSource/LayoutTests/platform/wincairo/TestExpectations:972:http/tests/websocket/tests/hybi/deflate-frame-parameter.html [ Failure ]
Volodymyr Sorokin
Comment 5
2019-10-03 10:40:38 PDT
There is nothing special in that java websocket server (I shared it to have a complete working example) I.e. any server that supports `x-webkit-deflate-frame` extension should be enough, so hopefully you will be able to reproduce the bug with your own server (just make sure you use Safari 13 and `x-webkit-deflate-frame` extension is enabled). p.s minor correction: I wrote "permessage-deflate extension" in my previous comment, but I meant "x-webkit-deflate-frame extension" (which is default in Safari)
Fabrizio Ruggeri
Comment 6
2019-10-26 02:18:05 PDT
Any news on the status of this? Does it affect any other browser?
berkus
Comment 7
2019-11-15 11:26:34 PST
Fabrizio, as far as I'm aware it only affects Safari 13 (Safari 13.0.2 included), but on both macOS and iOS (and probably ipadOS).
youenn fablet
Comment 8
2019-11-21 20:43:25 PST
I can repro the failure with Volodymyr repro case. Failure happens after sending 32kb roughly. Reverting
https://trac.webkit.org/changeset/246573
fixes the issue in that specific case.
youenn fablet
Comment 9
2019-11-22 01:08:06 PST
Created
attachment 384131
[details]
Patch
berkus
Comment 10
2019-11-22 06:12:34 PST
@Volodymyr Sorokin We have force-disabled support for "x-webkit-deflate-frame" extension on the server side. This seems to work around the problem for the time being.
Alexey Proskuryakov
Comment 11
2019-11-22 09:32:22 PST
***
Bug 204237
has been marked as a duplicate of this bug. ***
WebKit Commit Bot
Comment 12
2019-11-25 00:50:20 PST
Comment on
attachment 384131
[details]
Patch Clearing flags on attachment: 384131 Committed
r252847
: <
https://trac.webkit.org/changeset/252847
>
WebKit Commit Bot
Comment 13
2019-11-25 00:50:22 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug