Incorrect header created for payloads longer than 125 bytes using RFC6455 patch
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- php
- 領域
- networking
調査の方向性
まず PHP の wrap 関数を見つけ、WebSocket ヘッダーの構築方法を確認します。125 バイトを超える payload で問題を再現し、その後、クライアントが RFC6455 に従って拡張された 16 ビットおよび 64 ビットの長さを正しくデコードすることを確認します。
索引モデルが issue の本文から書いたものです。
説明
What steps will reproduce the problem?
1. Apply RFC6455 patch
2. Send a message with a payload larger than 125bytes
3. Websocket clients will not be able to correctly decode the length of the
payload
The problem is with the wrap function not correctly implementing the payload
length section of the web sockets standard. If the payload is longer than
125bytes then a length of 126 or 127 bytes needs to be sent in the payload
length section of the header and an additional 16 bit (with 126 sent in the
length section) or 64 bit (with 127 sent in the length section) unsigned, big
endian integer length also needs to be sent as part of the header. Here is a
fix that works for payload lengths up to 4,294,967,295 or the maximum of a
32-bit unsigned integer. A full implementation should be able to handle payload
lengths up to the maximum of a 64-bit unsigned integer.
function wrap($msg=""){
$length=strlen($msg);
if ($length<126)
$header=chr(0x81).chr($length);
elseif ($length<65536)
$header=chr(0x81).chr(126).pack("n",$length);
else
$header=chr(0x81).chr(127).pack("N",$length);
$msg=$header.$msg;
return $msg;
}
Original issue reported on code.google.com by [email protected] on 10 May 2012 at 3:04
- 主要言語
- PHP
- スター
- 0
- フォーク
- 0
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
et-nik/phpwebsocket のほかの issue
-
auto-migrated Priority-Medium Type-Defect
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
et-nik/phpwebsocket#77 ·
-
auto-migrated Priority-Medium Type-Defect
難易度 3/5 1〜2日 初心者へのやさしさ 20/100
et-nik/phpwebsocket#78 ·
-
auto-migrated Type-Patch
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
et-nik/phpwebsocket#72 ·
-
auto-migrated Type-Patch
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
et-nik/phpwebsocket#73 ·
-
auto-migrated Type-Patch
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
et-nik/phpwebsocket#74 ·
et-nik/phpwebsocket の issue をすべて見る
似ている issue
-
maintenance
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
hawk-digital-environments/HAWKI#443 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
crazy-goat/rabbit-stream#799 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
Code Quality
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Automattic/safe-publish#708 ·
メンテナーはふだん 1 日以内に返信