Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Websocket proxy auth truncates passwords that contain a colon

オープン 初心者向け
#2,734 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
86/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

kubernetes/stream/ws_client.py の602行目付近にある認証情報の分割箇所から始め、近くにある websocket_proxycare のテストを調べてください。コロンを含む password と不正な認証情報を含め、提供されたスニペットで再現してください。完全な password が保持され、不正なヘッダーで未捕捉の IndexError が発生しなくなり、両方のケースをテストでカバーできたら完了です。

索引モデルが issue の本文から書いたものです。

説明

help wanted

What happened (please include outputs or screenshots):

While testing an experimental version of Perch, we found the following and figured it was worth a report.

websocket_proxycare splits the decoded proxy-authorization credentials on every : and keeps only the first two parts. A proxy password that contains a colon is cut off, so websocket calls (stream for exec, attach and port-forward) through an authenticated proxy send the wrong password.

import base64
from types import SimpleNamespace
from kubernetes.stream.ws_client import websocket_proxycare

cred = base64.b64encode(b"alice:pa:ss:word").decode()
cfg = SimpleNamespace(no_proxy=None, proxy="http://proxy:3128",
                      proxy_headers={"proxy-authorization": "Basic " + cred})
print(websocket_proxycare({}, cfg, "wss://h", {})["http_proxy_auth"])
# ('alice', 'pa')

The same code raises IndexError: list index out of range when the header is just Basic, or when the decoded value has no colon.

What you expected to happen:

('alice', 'pa:ss:word'). RFC 7617 allows colons in the password; only the user-id can't contain one.

How to reproduce it (as minimally and precisely as possible):

Run the snippet above against master. No cluster is needed.

Anything else we need to know?:

The split is at kubernetes/stream/ws_client.py:602:

auth = urlsafe_b64decode(b64value).decode().split(':')
connect_opt.update({'http_proxy_auth': (auth[0], auth[1]) })

split(':', 1) would keep the full password.

Environment:

  • Kubernetes version (kubectl version): not needed, no cluster involved
  • OS (e.g., MacOS 10.13.6): macOS 26.2 (arm64)
  • Python version (python --version): 3.14.2
  • Python client version (pip list | grep kubernetes): 37.0.0+snapshot (master, bb9199f7)
主要言語
Python
スター
7.7k
フォーク
3.5k
平均マージ
1日 13時間
マージ済み PR(30日)
19

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

kubernetes-client/python のほかの issue

kubernetes-client/python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。