My favorites | Sign in
Project Home Downloads Wiki Issues Code Search
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 47390: WebSocket in a worker sends malformed Sec-WebSocketKey{1,2} headers
2 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  yutak@chromium.org
Closed:  Jul 2010
Cc:  ukai@chromium.org
M-6

Restricted
  • Only users with EditIssue permission may comment.


Sign in to add a comment
 
Reported by nori.0...@gmail.com, Jun 24, 2010
Chrome Version       : 6.0.437.3 (Official Build 50164) dev (on Windows Vista)
URLs (if applicable) : my opinion <URL: http://github.com/nori0428/mod_websocket/issues#issue/2>
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
  Chrome 6.0.437.3 (Official Build 50164) dev on MAC OS X : OK
  Webkit Trunk: OK
  Minefield Trunk : OK
  other browser does not have Websocket func(Spec-76)

What steps will reproduce the problem?
1. Sorry, I don't know way to dump packet.

What is the expected result?

What happens instead?

Please provide any additional information below. Attach a screenshot if
possible.

Jun 24, 2010
#1 yutak@chromium.org
I could not reproduce the issue with Chrome 6.0.447.0 dev on Windows Vista. I sniffed the packets and I've got something like:

GET /websocket/tests/simple HTTP/1.1
Upgrade: WebSocket
Connection: Upgrade
Host: ******
Origin: ******
Sec-WebSocket-Key1: 598191 8^1 2
Sec-WebSocket-Key2: 3 2-1 - 4#  836YC %6o   3~ @F K6"

~..h.`.y

Where the last 8 characters are binary. This sounds legitimate to me.

Could you try again with the newest dev version? It should send random keys like above, not a constant such as "!0" or 8 bytes of "\0".
Cc: yu...@chromium.org u...@chromium.org
Labels: -Area-Undefined Area-WebKit Feature-WebSocket
Jun 28, 2010
#2 nori.0...@gmail.com
Thank you for testing.
I tested with Chrome 6.0.447.0 dev on Windows Vista.

And I found that you can reproduce this bug to do new WebSocket() in Worker.

regards.
Jun 28, 2010
#3 yutak@chromium.org
Aha, I didn't know it was in a Worker. Will look into it.
Jun 28, 2010
#4 nori.0...@gmail.com
Sorry for poor information.Thanks!!
Jun 28, 2010
#5 yutak@chromium.org
Confirmed.
Summary: WebSocket in a worker sends malformed Sec-WebSocketKey{1,2} headers
Status: Started
Owner: yu...@chromium.org
Cc: -yu...@chromium.org
Jun 28, 2010
#6 yutak@chromium.org
This issue occurs only on Windows.

The source of failure is:
- Call to rand_s (in WebCore::randomNumber) fails due to sandbox, and it always returns 0.
- generateWebSocketKey might insert a space to front of the key string, which is clearly prohibited in WebSocket spec.

We need the following fixes:
(a) Fix generateWebSocketKey,
(b) Make randomNumber check the return value of rand_s() and fall back to rand() if necessary, and
(c) Allow worker process to call rand_s (probably RtlGenRandom API).

(a) and (b) require changes to WebKit and are not difficult. I have no idea of how to do (c) for now.
Labels: OS-Windows
Jul 2, 2010
#8 ka...@chromium.org
upstream bug says fixed. so marking this fixed.
Status: Fixed
Jul 4, 2010
#9 yutak@chromium.org
Well, it is not actually fixed. I need to make a Chromium-side change, too, and I'm writing a layout test for it.
Status: Started
Jul 7, 2010
#10 ka...@chromium.org
ah ok apologies. i will move it to m6. will you be able to finish it by the m6 deadline?
Labels: Mstone-6
Jul 20, 2010
#11 bugdroid1@gmail.com
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=53027 

------------------------------------------------------------------------
r53027 | yutak@chromium.org | 2010-07-20 02:25:23 -0700 (Tue, 20 Jul 2010) | 9 lines
Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/worker/worker_main.cc?r1=53027&r2=53026
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/worker/worker_uitest.cc?r1=53027&r2=53026

Call rand_s() in a worker process before entering the sandbox.

We need to do it to cause advapi32.dll to load the sandbox is turned on.
Otherwise rand_s() will fail in the sandbox.

BUG=47390
TEST=Run "ui_tests --gtest_filter=WorkerTest.WorkerWebSocketLayoutTests".

Review URL: http://codereview.chromium.org/2799047
------------------------------------------------------------------------

Jul 20, 2010
#12 yutak@chromium.org
(No comment was entered for this change.)
Status: Fixed
Aug 10, 2010
#13 bugdroid1@gmail.com
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=55555 

------------------------------------------------------------------------
r55555 | yutak@chromium.org | 2010-08-10 03:37:43 -0700 (Tue, 10 Aug 2010) | 12 lines
Changed paths:
   M http://src.chromium.org/viewvc/chrome/branches/472/src/chrome/worker/worker_main.cc?r1=55555&r2=55554
   M http://src.chromium.org/viewvc/chrome/branches/472/src/chrome/worker/worker_uitest.cc?r1=55555&r2=55554

Merge 53027 - Call rand_s() in a worker process before entering the sandbox.

We need to do it to cause advapi32.dll to load the sandbox is turned on.
Otherwise rand_s() will fail in the sandbox.

BUG=47390
TEST=Run "ui_tests --gtest_filter=WorkerTest.WorkerWebSocketLayoutTests".

Review URL: http://codereview.chromium.org/2799047

TBR=yutak@chromium.org
Review URL: http://codereview.chromium.org/3119003
------------------------------------------------------------------------

Oct 12, 2012
#14 bugdroid1@chromium.org
This issue has been closed for some time. No one will pay attention to new comments.
If you are seeing this bug or have new data, please click New Issue to start a new bug.
Labels: Restrict-AddIssueComment-Commit
Mar 10, 2013
#15 bugdroid1@chromium.org
(No comment was entered for this change.)
Labels: -Area-WebKit -Mstone-6 Cr-Content M-6
Mar 13, 2013
#16 bugdroid1@chromium.org
(No comment was entered for this change.)
Labels: -Restrict-AddIssueComment-Commit Restrict-AddIssueComment-EditIssue
Apr 5, 2013
#17 bugdroid1@chromium.org
(No comment was entered for this change.)
Labels: -Cr-Content Cr-Blink
Sign in to add a comment

Powered by Google Project Hosting