Proxy credentials in the proxy URL are not percent-decoded
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 74/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- python
- 領域
- networking
調査の方向性
websockets.proxy のエントリーポイントである parse_proxy() から始め、認証情報が connect_socks_proxy() と connect_http_proxy() にどのように渡されるかを追跡します。パーセントエンコードされたパスワードを含む再現用 URL を検証し、その後、両方のプロキシ経路がデコード済みのユーザー名とパスワードの値を受け取り、既存のプロキシテストが通ることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Description
parse_proxy() takes username and password from urllib.parse.urlparse(...) as they are, without percent-decoding them. A password that contains a reserved character has to be percent-encoded to be representable in the URL at all (socks5://alice:p%40ss@host:1080 for the password p@ss), but websockets then sends the literal string p%40ss to the proxy: connect_socks_proxy() hands proxy.username / proxy.password to python-socks unchanged, and connect_http_proxy() base64-encodes them unchanged for Proxy-Authorization.
python-socks itself (python_socks._helpers.parse_proxy_url) applies unquote() to both, so the same URL works with python-socks directly and with other clients that build on it, but not through websockets' proxy= parameter. RFC 3986 section 3.2.1 defines userinfo as percent-encoded.
Reproduction
>>> from websockets.proxy import parse_proxy
>>> p = parse_proxy("socks5://alice:p%[email protected]:1080")
>>> p.password
'p%40ss'
Against a SOCKS5 proxy with user/password auth the connection is rejected (ProxyError: failed to connect to SOCKS proxy), against an HTTP CONNECT proxy with basic auth it is answered with 407.
Environment
websockets 16.0, Python 3.13.5, python-socks 3.1.1, Linux x86_64.
Expected
parse_proxy() percent-decodes username and password (e.g. urllib.parse.unquote), like python-socks and requests do for proxy URLs, so that credentials with @, :, / or % can be used.
- 主要言語
- Python
- スター
- 5.7k
- フォーク
- 617
- 平均マージ
- 1日 14時間
- マージ済み PR(30日)
- 7
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python-websockets/websockets のほかの issue
-
documentation
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
python-websockets/websockets#1756 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
python-websockets/websockets の issue をすべて見る
似ている issue
-
adr
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
kristofdegrave/homeassistant-smart-charging#1607 ·
メンテナーはふだん 1 日以内に返信
-
namespace operations
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
EclipseFdn/open-vsx.org#13665 ·
メンテナーはふだん 1 日以内に返信
-
doc good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
collective/icalendar#1865 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
canonical/opentelemetry-collector-operator#409 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
mozilla/addons-release-tests#1243 ·
メンテナーはふだん 1 日以内に返信